Skip to content

Commit 9fc2b96

Browse files
committed
[msandr] Remove one more use of std::string and put all STL headers under ifdef.
llvm-svn: 197031
1 parent d109363 commit 9fc2b96

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

compiler-rt/lib/msandr/msandr.cc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,22 @@
3939
#include <sys/mman.h>
4040
#include <sys/syscall.h> /* for SYS_mmap */
4141

42+
#include <string.h>
43+
44+
// XXX: it seems setting macro in CMakeLists.txt does not work,
45+
// so manually set it here now.
46+
47+
// Building msandr client for running in DynamoRIO hybrid mode,
48+
// which allows some module running natively.
49+
// TODO: turn it on by default when hybrid is stable enough
50+
// #define MSANDR_NATIVE_EXEC
51+
52+
#ifndef MSANDR_NATIVE_EXEC
4253
#include <algorithm>
43-
#include <string>
4454
#include <set>
55+
#include <string>
4556
#include <vector>
46-
#include <string.h>
57+
#endif
4758

4859
#define TESTALL(mask, var) (((mask) & (var)) == (mask))
4960
#define TESTANY(mask, var) (((mask) & (var)) != 0)
@@ -60,14 +71,6 @@
6071

6172
#define VERBOSITY 0
6273

63-
// XXX: it seems setting macro in CMakeLists.txt does not work,
64-
// so manually set it here now.
65-
66-
// Building msandr client for running in DynamoRIO hybrid mode,
67-
// which allows some module running natively.
68-
// TODO: turn it on by default when hybrid is stable enough
69-
// #define MSANDR_NATIVE_EXEC
70-
7174
// Building msandr client for standalone test that does not need to
7275
// run with msan build executables. Disable by default.
7376
// #define MSANDR_STANDALONE_TEST
@@ -91,8 +94,6 @@
9194

9295
namespace {
9396

94-
std::string g_app_path;
95-
9697
int msan_retval_tls_offset;
9798
int msan_param_tls_offset;
9899

@@ -186,7 +187,6 @@ void InitializeMSanCallbacks() {
186187
dr_get_application_name());
187188
CHECK(app);
188189
}
189-
g_app_path = app->full_path;
190190

191191
__msan_get_retval_tls_offset = (int (*)())
192192
LookupCallback(app, "__msan_get_retval_tls_offset");

0 commit comments

Comments
 (0)