summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2016-11-21 11:05:15 +0000
committerAlex Lorenz <arphaman@gmail.com>2016-11-21 11:05:15 +0000
commit9229d332bfc4521d6213d3cc9b485e70f812f1ee (patch)
tree92ed0dbc82ebd7b22a1bb3636f773dcdaa4da04e /clang/lib/Frontend/InitPreprocessor.cpp
parent3bc6fe78f62fb5e43feeba25e32fbaedfc647ef8 (diff)
downloadbcm5719-llvm-9229d332bfc4521d6213d3cc9b485e70f812f1ee.tar.gz
bcm5719-llvm-9229d332bfc4521d6213d3cc9b485e70f812f1ee.zip
[Frontend] Add a predefined macro that describes the Objective-C bool type
This commit adds a new predefined macro named __OBJC_BOOL_IS_BOOL that describes the Objective-C boolean type: its value is zero if the Objective-C boolean uses the signed character type, otherwise its value is one as the Objective-C boolean uses the builtin boolean type. rdar://21170440 Differential Revision: https://reviews.llvm.org/D26234 llvm-svn: 287529
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 613248a7f1c..7e078fec924 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -591,6 +591,9 @@ 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__");
OpenPOWER on IntegriCloud