diff options
author | Alex Lorenz <arphaman@gmail.com> | 2016-11-21 11:05:15 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2016-11-21 11:05:15 +0000 |
commit | 9229d332bfc4521d6213d3cc9b485e70f812f1ee (patch) | |
tree | 92ed0dbc82ebd7b22a1bb3636f773dcdaa4da04e /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | 3bc6fe78f62fb5e43feeba25e32fbaedfc647ef8 (diff) | |
download | bcm5719-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.cpp | 3 |
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__"); |