summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-01-20 16:48:25 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-01-20 16:48:25 +0000
commit41d13152b139860742dc749a4e6172c4cae22d92 (patch)
treef953e3f09a74dc28b81a44c2c0e488d76b59ecc6 /clang/lib/Frontend/InitPreprocessor.cpp
parent8f34ae2aae4025d041d5358f00affecd92aa8cae (diff)
downloadbcm5719-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.cpp8
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);
OpenPOWER on IntegriCloud