diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-13 17:33:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-13 17:33:56 +0000 |
commit | 8d269dc329e2f76670cc9a33ecdad76c69f83c7d (patch) | |
tree | a4057a36fd19d240f9bf3339c665ae8f94607fb4 /clang/lib/Frontend/RewriteObjC.cpp | |
parent | 8a2dae57e229dc0b6e3ae6582709f96696483143 (diff) | |
download | bcm5719-llvm-8d269dc329e2f76670cc9a33ecdad76c69f83c7d.tar.gz bcm5719-llvm-8d269dc329e2f76670cc9a33ecdad76c69f83c7d.zip |
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).
llvm-svn: 101149
Diffstat (limited to 'clang/lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | clang/lib/Frontend/RewriteObjC.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index cba92987a3d..83d392aab33 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/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 { |