summaryrefslogtreecommitdiff
path: root/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorRobert Lytton <robert@xmos.com>2014-03-10 12:06:29 +0000
committerRobert Lytton <robert@xmos.com>2014-03-10 12:06:29 +0000
commitf58bc2e3c56009708c7c8bbee0308ef4dd439722 (patch)
tree97d80b82f76bf941e0d9f662d36714bb8ffd2b79 /lib/Frontend/InitPreprocessor.cpp
parentf2d2d02c15b4e7afb5c129f50b844ae3fe8e1ead (diff)
downloadclang-f58bc2e3c56009708c7c8bbee0308ef4dd439722.tar.gz
clang-f58bc2e3c56009708c7c8bbee0308ef4dd439722.tar.bz2
clang-f58bc2e3c56009708c7c8bbee0308ef4dd439722.tar.xz
Make __LITTLE_ENDIAN__/__BIG_ENDOAN__ common PredefinedMacros
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--lib/Frontend/InitPreprocessor.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
index ca51297bb2..a5b0267355 100644
--- a/lib/Frontend/InitPreprocessor.cpp
+++ b/lib/Frontend/InitPreprocessor.cpp
@@ -541,11 +541,13 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("__ORDER_LITTLE_ENDIAN__", "1234");
Builder.defineMacro("__ORDER_BIG_ENDIAN__", "4321");
Builder.defineMacro("__ORDER_PDP_ENDIAN__", "3412");
- if (TI.isBigEndian())
+ if (TI.isBigEndian()) {
Builder.defineMacro("__BYTE_ORDER__", "__ORDER_BIG_ENDIAN__");
- else
+ Builder.defineMacro("__BIG_ENDIAN__");
+ } else {
Builder.defineMacro("__BYTE_ORDER__", "__ORDER_LITTLE_ENDIAN__");
-
+ Builder.defineMacro("__LITTLE_ENDIAN__");
+ }
if (TI.getPointerWidth(0) == 64 && TI.getLongWidth() == 64
&& TI.getIntWidth() == 32) {