diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-01-20 16:48:25 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-01-20 16:48:25 +0000 |
commit | 41d13152b139860742dc749a4e6172c4cae22d92 (patch) | |
tree | f953e3f09a74dc28b81a44c2c0e488d76b59ecc6 /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | 8f34ae2aae4025d041d5358f00affecd92aa8cae (diff) | |
download | bcm5719-llvm-41d13152b139860742dc749a4e6172c4cae22d92.tar.gz bcm5719-llvm-41d13152b139860742dc749a4e6172c4cae22d92.zip |
[Frontend] The macro that describes the Objective-C bool type should
be defined for non Objective-C code as well
rdar://29794915
Differential Revision: https://reviews.llvm.org/D28349
llvm-svn: 292617
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 4502c92499a..e5a07962d83 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -593,9 +593,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI, Builder.defineMacro("OBJC_ZEROCOST_EXCEPTIONS"); } - Builder.defineMacro("__OBJC_BOOL_IS_BOOL", - Twine(TI.useSignedCharForObjCBool() ? "0" : "1")); - if (LangOpts.getGC() != LangOptions::NonGC) Builder.defineMacro("__OBJC_GC__"); @@ -626,6 +623,11 @@ static void InitializePredefinedMacros(const TargetInfo &TI, Builder.defineMacro("IB_DESIGNABLE", ""); } + // Define a macro that describes the Objective-C boolean type even for C + // and C++ since BOOL can be used from non Objective-C code. + Builder.defineMacro("__OBJC_BOOL_IS_BOOL", + Twine(TI.useSignedCharForObjCBool() ? "0" : "1")); + if (LangOpts.CPlusPlus) InitializeCPlusPlusFeatureTestMacros(LangOpts, Builder); |