From 8d269dc329e2f76670cc9a33ecdad76c69f83c7d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 13 Apr 2010 17:33:56 +0000 Subject: 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 --- clang/lib/Frontend/RewriteObjC.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Frontend/RewriteObjC.cpp') 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 { -- cgit v1.2.3