From: Chandler Carruth Date: Tue, 25 Jun 2013 11:13:47 +0000 (+0000) Subject: Fix a couple of PPC predefined macros that I spotted while driving by X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6fa1153f882c01decb676ca1208705ae2e2508a;p=clang Fix a couple of PPC predefined macros that I spotted while driving by this code. These aren't technically standard predefines for the platform but apparantly lots of folks use them as they show up within LLVM's own codebase. ;] This may even fix some self host issues w/ the JIT!!! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184830 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 737dd873b6..c592399cbb 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -871,6 +871,7 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const { // Target identification. Builder.defineMacro("__ppc__"); + Builder.defineMacro("__PPC__"); Builder.defineMacro("_ARCH_PPC"); Builder.defineMacro("__powerpc__"); Builder.defineMacro("__POWERPC__"); @@ -878,8 +879,7 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("_ARCH_PPC64"); Builder.defineMacro("__powerpc64__"); Builder.defineMacro("__ppc64__"); - } else { - Builder.defineMacro("__ppc__"); + Builder.defineMacro("__PPC64__"); } // Target properties. diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index 40dc638851..dd71d9790f 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -1585,6 +1585,7 @@ // PPC603E:#define __NATURAL_ALIGNMENT__ 1 // PPC603E:#define __POINTER_WIDTH__ 32 // PPC603E:#define __POWERPC__ 1 +// PPC603E:#define __PPC__ 1 // PPC603E:#define __PTRDIFF_TYPE__ long int // PPC603E:#define __PTRDIFF_WIDTH__ 32 // PPC603E:#define __REGISTER_PREFIX__ @@ -1694,6 +1695,8 @@ // PPC64:#define __NATURAL_ALIGNMENT__ 1 // PPC64:#define __POINTER_WIDTH__ 64 // PPC64:#define __POWERPC__ 1 +// PPC64:#define __PPC64__ 1 +// PPC64:#define __PPC__ 1 // PPC64:#define __PTRDIFF_TYPE__ long int // PPC64:#define __PTRDIFF_WIDTH__ 64 // PPC64:#define __REGISTER_PREFIX__ @@ -1957,6 +1960,8 @@ // PPC64-LINUX:#define __NATURAL_ALIGNMENT__ 1 // PPC64-LINUX:#define __POINTER_WIDTH__ 64 // PPC64-LINUX:#define __POWERPC__ 1 +// PPC64-LINUX:#define __PPC64__ 1 +// PPC64-LINUX:#define __PPC__ 1 // PPC64-LINUX:#define __PTRDIFF_TYPE__ long int // PPC64-LINUX:#define __PTRDIFF_WIDTH__ 64 // PPC64-LINUX:#define __REGISTER_PREFIX__ @@ -2062,6 +2067,7 @@ // PPC:#define __NATURAL_ALIGNMENT__ 1 // PPC:#define __POINTER_WIDTH__ 32 // PPC:#define __POWERPC__ 1 +// PPC:#define __PPC__ 1 // PPC:#define __PTRDIFF_TYPE__ long int // PPC:#define __PTRDIFF_WIDTH__ 32 // PPC:#define __REGISTER_PREFIX__ @@ -2163,6 +2169,7 @@ // PPC-LINUX:#define __NATURAL_ALIGNMENT__ 1 // PPC-LINUX:#define __POINTER_WIDTH__ 32 // PPC-LINUX:#define __POWERPC__ 1 +// PPC-LINUX:#define __PPC__ 1 // PPC-LINUX:#define __PTRDIFF_TYPE__ int // PPC-LINUX:#define __PTRDIFF_WIDTH__ 32 // PPC-LINUX:#define __REGISTER_PREFIX__ @@ -2267,6 +2274,7 @@ // PPC-DARWIN:#define __ORDER_PDP_ENDIAN__ 3412 // PPC-DARWIN:#define __POINTER_WIDTH__ 32 // PPC-DARWIN:#define __POWERPC__ 1 +// PPC-DARWIN:#define __PPC__ 1 // PPC-DARWIN:#define __PTRDIFF_TYPE__ int // PPC-DARWIN:#define __PTRDIFF_WIDTH__ 32 // PPC-DARWIN:#define __REGISTER_PREFIX__