[compiler-rt] r178866 - [msan] Conditionally disable new() and delete() wrappers.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Fri Apr 5 05:03:47 PDT 2013


Author: eugenis
Date: Fri Apr  5 07:03:47 2013
New Revision: 178866

URL: http://llvm.org/viewvc/llvm-project?rev=178866&view=rev
Log:
[msan] Conditionally disable new() and delete() wrappers.

To be used with static libstdc++.

Modified:
    compiler-rt/trunk/lib/msan/msan.cc
    compiler-rt/trunk/lib/msan/msan.h

Modified: compiler-rt/trunk/lib/msan/msan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.cc?rev=178866&r1=178865&r2=178866&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.cc (original)
+++ compiler-rt/trunk/lib/msan/msan.cc Fri Apr  5 07:03:47 2013
@@ -244,7 +244,8 @@ void __msan_init() {
   InitTlsSize();
   InitializeInterceptors();
 
-  ReplaceOperatorsNewAndDelete();
+  if (MSAN_REPLACE_OPERATORS_NEW_AND_DELETE)
+    ReplaceOperatorsNewAndDelete();
   const char *msan_options = GetEnv("MSAN_OPTIONS");
   InitializeFlags(&msan_flags, msan_options);
   if (StackSizeIsUnlimited()) {

Modified: compiler-rt/trunk/lib/msan/msan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.h?rev=178866&r1=178865&r2=178866&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.h (original)
+++ compiler-rt/trunk/lib/msan/msan.h Fri Apr  5 07:03:47 2013
@@ -20,6 +20,10 @@
 #include "msan_interface_internal.h"
 #include "msan_flags.h"
 
+#ifndef MSAN_REPLACE_OPERATORS_NEW_AND_DELETE
+# define MSAN_REPLACE_OPERATORS_NEW_AND_DELETE 1
+#endif
+
 #define MEM_TO_SHADOW(mem) (((uptr)mem)       & ~0x400000000000ULL)
 #define MEM_TO_ORIGIN(mem) (MEM_TO_SHADOW(mem) + 0x200000000000ULL)
 #define MEM_IS_APP(mem)    ((uptr)mem >=         0x600000000000ULL)





More information about the llvm-commits mailing list