aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-13 17:33:56 +0000
committerChris Lattner <sabre@nondot.org>2010-04-13 17:33:56 +0000
commit553e583e1d30fe30ac2de3526536bbebee6da1ce (patch)
tree8f8fd654d5fdb30231e64f98a03f744f87b4f483 /lib/Frontend/RewriteObjC.cpp
parentabe183dd2faa124ac0d1f0e29a4f4216a483748c (diff)
make the rewriter add a #ifndef around the #define of __attribute__.
Without it, there is no reason for a compiler that supports it to emit the dead static globals that the rewriter labels attribute(used). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r--lib/Frontend/RewriteObjC.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index cba92987a3..83d392aab3 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/lib/Frontend/RewriteObjC.cpp
@@ -640,7 +640,9 @@ void RewriteObjC::Initialize(ASTContext &context) {
if (LangOpts.Microsoft) {
Preamble += "#undef __OBJC_RW_DLLIMPORT\n";
Preamble += "#undef __OBJC_RW_STATICIMPORT\n";
+ Preamble += "#ifndef KEEP_ATTRIBUTES\n"; // We use this for clang tests.
Preamble += "#define __attribute__(X)\n";
+ Preamble += "#endif\n";
Preamble += "#define __weak\n";
}
else {