[PATCH] D12335: Repress sanitization on User dtor.

Naomi Musgrave via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 14:27:10 PDT 2015


nmusgrave created this revision.
nmusgrave added reviewers: chandlerc, rsmith, eugenis.
nmusgrave added a subscriber: llvm-commits.

In response to bug 24578, reported against failing LLVM test.

http://reviews.llvm.org/D12335

Files:
  include/llvm/IR/User.h
  include/llvm/Support/Compiler.h

Index: include/llvm/Support/Compiler.h
===================================================================
--- include/llvm/Support/Compiler.h
+++ include/llvm/Support/Compiler.h
@@ -318,6 +318,14 @@
 # define LLVM_FUNCTION_NAME __func__
 #endif
 
+/// \macro LLVM_NO_SANITIZE_ATTRIBUTE
+/// \brief Skip memory sanitization for this function.
+#ifdef MEMORY_SANITIZER
+# define LLVM_NO_SANITIZE_ATTRIBUTE __attribute__((no_sanitize_memory))
+#else
+# define LLVM_NO_SANITIZE_ATTRIBUTE
+#endif
+
 /// \macro LLVM_MEMORY_SANITIZER_BUILD
 /// \brief Whether LLVM itself is built with MemorySanitizer instrumentation.
 #if __has_feature(memory_sanitizer)
Index: include/llvm/IR/User.h
===================================================================
--- include/llvm/IR/User.h
+++ include/llvm/IR/User.h
@@ -72,8 +72,7 @@
   void growHungoffUses(unsigned N, bool IsPhi = false);
 
 public:
-  ~User() override {
-  }
+  LLVM_NO_SANITIZE_ATTRIBUTE ~User() override {}
   /// \brief Free memory allocated for User and Use objects.
   void operator delete(void *Usr);
   /// \brief Placement delete - required by std, but never called.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12335.33122.patch
Type: text/x-patch
Size: 1132 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150825/9a441b6d/attachment.bin>


More information about the llvm-commits mailing list