[llvm-commits] [compiler-rt] r166099 - in /compiler-rt/trunk/lib/asan/tests: asan_test.cc asan_test_utils.h
Alexey Samsonov
samsonov at google.com
Wed Oct 17 06:19:59 PDT 2012
Author: samsonov
Date: Wed Oct 17 08:19:59 2012
New Revision: 166099
URL: http://llvm.org/viewvc/llvm-project?rev=166099&view=rev
Log:
[ASan] don't use attribute no_address_safety_analysis if it's unknown to compiler
Modified:
compiler-rt/trunk/lib/asan/tests/asan_test.cc
compiler-rt/trunk/lib/asan/tests/asan_test_utils.h
Modified: compiler-rt/trunk/lib/asan/tests/asan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test.cc?rev=166099&r1=166098&r2=166099&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Wed Oct 17 08:19:59 2012
@@ -1811,7 +1811,7 @@
*Ident(&a) = *Ident(&a);
}
-__attribute__((no_address_safety_analysis))
+ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
static void NoAddressSafety() {
char *foo = new char[10];
Ident(foo)[10] = 0;
Modified: compiler-rt/trunk/lib/asan/tests/asan_test_utils.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test_utils.h?rev=166099&r1=166098&r2=166099&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test_utils.h (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test_utils.h Wed Oct 17 08:19:59 2012
@@ -38,6 +38,13 @@
#define __has_feature(x) 0
#endif
+#if __has_feature(address_sanitizer)
+# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \
+ __attribute__((no_address_safety_analysis))
+#else
+# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+#endif
+
#ifndef __WORDSIZE
#if __LP64__ || defined(_WIN64)
#define __WORDSIZE 64
More information about the llvm-commits
mailing list