summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-09-23 21:28:24 +0000
committerSteve Naroff <snaroff@apple.com>2008-09-23 21:28:24 +0000
commitde2d5b75c2352c954d99b1e7c94f42c24f7972f0 (patch)
tree4ded3fcba5540e96fffb4e319001650d0bf1bab5 /clang/lib/Lex/Preprocessor.cpp
parent4f6646780e9d91365a2e0e61e8d85e564c47799a (diff)
downloadbcm5719-llvm-de2d5b75c2352c954d99b1e7c94f42c24f7972f0.tar.gz
bcm5719-llvm-de2d5b75c2352c954d99b1e7c94f42c24f7972f0.zip
Fix <rdar://problem/6240065> clang: __BLOCKS__ should be defined.
llvm-svn: 56503
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 50fafdc73b8..81a09f5bfa4 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -477,9 +477,10 @@ static void InitializePredefinedMacros(Preprocessor &PP,
DefineBuiltinMacro(Buf, "__declspec(X)=");
}
// Directly modeled after the attribute-based implementation in GCC.
- if (PP.getLangOptions().Blocks)
+ if (PP.getLangOptions().Blocks) {
DefineBuiltinMacro(Buf, "__block=__attribute__((__blocks__(byref)))");
- else
+ DefineBuiltinMacro(Buf, "__BLOCKS__=1");
+ } else
// This allows "__block int unusedVar;" even when blocks are disabled.
// This is modeled after GCC's handling of __strong/__weak.
DefineBuiltinMacro(Buf, "__block=");
OpenPOWER on IntegriCloud