[libcxx] r217082 - Make the ASAN RAII object a nop when building w/o ASAN

Marshall Clow mclow.lists at gmail.com
Wed Sep 3 14:37:43 PDT 2014


Author: marshall
Date: Wed Sep  3 16:37:43 2014
New Revision: 217082

URL: http://llvm.org/viewvc/llvm-project?rev=217082&view=rev
Log:
Make the ASAN RAII object a nop when building w/o ASAN

Modified:
    libcxx/trunk/include/vector

Modified: libcxx/trunk/include/vector
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/vector?rev=217082&r1=217081&r2=217082&view=diff
==============================================================================
--- libcxx/trunk/include/vector (original)
+++ libcxx/trunk/include/vector Wed Sep  3 16:37:43 2014
@@ -863,6 +863,7 @@ private:
       __annotate_contiguous_container(data(), data() + capacity(),
                                       data() + __old_size, data() + size());
     }
+#ifndef _LIBCPP_HAS_NO_ASAN
     // The annotation for size increase should happen before the actual increase,
     // but if an exception is thrown after that the annotation has to be undone.
     struct __RAII_IncreaseAnnotator {
@@ -879,6 +880,13 @@ private:
       size_type __n;
       const vector &__v;
     };
+#else
+    struct __RAII_IncreaseAnnotator {
+      inline __RAII_IncreaseAnnotator(const vector &, size_type __n = 1) {}
+      inline void __done() {}
+    };
+#endif
+
 };
 
 template <class _Tp, class _Allocator>





More information about the cfe-commits mailing list