From b67bc4ea0d23c2dc11d2123aaf37d1b3ef83c940 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 3 Sep 2014 21:37:43 +0000 Subject: Make the ASAN RAII object a nop when building w/o ASAN llvm-svn: 217082 --- libcxx/include/vector | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libcxx/include/vector') diff --git a/libcxx/include/vector b/libcxx/include/vector index 12195df5612..cd9aab32465 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -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 -- cgit v1.2.3