summaryrefslogtreecommitdiff
path: root/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-02-09 05:30:48 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-02-09 05:30:48 +0000
commitc809e1493facfee2a47e47d735c6db16a5c65ea4 (patch)
tree1ccfae3daaa2b54c8b073972fdc0fb88aee104a6 /lib/Frontend/InitPreprocessor.cpp
parentbe9778d3046b54d4b399b3f4523b12c3286da474 (diff)
downloadclang-c809e1493facfee2a47e47d735c6db16a5c65ea4.tar.gz
clang-c809e1493facfee2a47e47d735c6db16a5c65ea4.tar.bz2
clang-c809e1493facfee2a47e47d735c6db16a5c65ea4.tar.xz
Preprocessor: Add __ALIGNOF_MAX_ALIGN_T__
TargetInfo::getSuitableAlign() was introduced in r146762 and is defined as alignof(std::max_align_t). Introduce __ALIGNOF_MAX_ALIGN_T__ which exposes getSuitableAlign() so that libc++ may take advantage of it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--lib/Frontend/InitPreprocessor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
index 39c474b82d..7b3166da08 100644
--- a/lib/Frontend/InitPreprocessor.cpp
+++ b/lib/Frontend/InitPreprocessor.cpp
@@ -600,6 +600,9 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
DefineType("__CHAR16_TYPE__", TI.getChar16Type(), Builder);
DefineType("__CHAR32_TYPE__", TI.getChar32Type(), Builder);
+ Builder.defineMacro("__ALIGNOF_MAX_ALIGN_T__",
+ Twine(TI.getSuitableAlign() / TI.getCharWidth()));
+
DefineFloatMacros(Builder, "FLT", &TI.getFloatFormat(), "F");
DefineFloatMacros(Builder, "DBL", &TI.getDoubleFormat(), "");
DefineFloatMacros(Builder, "LDBL", &TI.getLongDoubleFormat(), "L");