From c809e1493facfee2a47e47d735c6db16a5c65ea4 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Sun, 9 Feb 2014 05:30:48 +0000 Subject: 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 --- lib/Frontend/InitPreprocessor.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/Frontend/InitPreprocessor.cpp') 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"); -- cgit v1.2.3