summaryrefslogtreecommitdiffstats
path: root/clang/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
commit158ba130eec9997716b22bdf2bfe476d9f73104a (patch)
tree0e518abb7dd34a9f327040560a43faeff97ef763 /clang/lib/Frontend/InitPreprocessor.cpp
parentd1fc17b931dac5f02baf9400000e44840c2bd5ba (diff)
downloadbcm5719-llvm-158ba130eec9997716b22bdf2bfe476d9f73104a.tar.gz
bcm5719-llvm-158ba130eec9997716b22bdf2bfe476d9f73104a.zip
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. llvm-svn: 201037
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 39c474b82df..7b3166da081 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/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");
OpenPOWER on IntegriCloud