]> granicus.if.org Git - clang/commitdiff
Add a definition for __STRUCT_PARM_ALIGN__ for elfv2 and 64-bit darwin platforms...
authorEric Christopher <echristo@gmail.com>
Wed, 15 Feb 2017 07:50:11 +0000 (07:50 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 15 Feb 2017 07:50:11 +0000 (07:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295156 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/Preprocessor/init.c

index 2ccb45902e11f2486da168aad982df3f1bc7a6bf..647b14e16d1baffdc7be172e1de3b36d53a4f7ca 100644 (file)
@@ -1232,6 +1232,11 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
   if (LongDoubleWidth == 128)
     Builder.defineMacro("__LONG_DOUBLE_128__");
 
+  // Define this for elfv2 (64-bit only) or 64-bit darwin.
+  if (ABI == "elfv2" ||
+      (getTriple().getOS() == llvm::Triple::Darwin && PointerWidth == 64))
+    Builder.defineMacro("__STRUCT_PARM_ALIGN__", "16");
+
   if (Opts.AltiVec) {
     Builder.defineMacro("__VEC__", "10206");
     Builder.defineMacro("__ALTIVEC__");
index 6ab86de2ff679684ec025f96d6bb6836dd5d7af8..a7726e3111f7808ab3a44b3312543e4e742fa066 100644 (file)
 // PPC64LE:#define __SIZE_MAX__ 18446744073709551615UL
 // PPC64LE:#define __SIZE_TYPE__ long unsigned int
 // PPC64LE:#define __SIZE_WIDTH__ 64
+// PPC64LE:#define __STRUCT_PARM_ALIGN__ 16
 // PPC64LE:#define __UINT16_C_SUFFIX__
 // PPC64LE:#define __UINT16_MAX__ 65535
 // PPC64LE:#define __UINT16_TYPE__ unsigned short