diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-07-26 21:39:15 +0000 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-07-26 21:39:15 +0000 |
commit | 419f7c2345b7a2b553629e909ed29297bdeeb566 (patch) | |
tree | f75e575b82087b767f12abe5745ba762847bbe3d /llvm/lib/Support/Unix | |
parent | 8c86ead149e154bd41901c78140d6c5e889bd739 (diff) | |
download | bcm5719-llvm-419f7c2345b7a2b553629e909ed29297bdeeb566.tar.gz bcm5719-llvm-419f7c2345b7a2b553629e909ed29297bdeeb566.zip |
[PowerPC] Improve consistency in use of __ppc__, __powerpc__, etc.
Both GCC and LLVM will implicitly define __ppc__ and __powerpc__ for
all PowerPC targets, whether 32- or 64-bit. They will both implicitly
define __ppc64__ and __powerpc64__ for 64-bit PowerPC targets, and not
for 32-bit targets. We cannot be sure that all other possible
compilers used to compile Clang/LLVM define both __ppc__ and
__powerpc__, for example, so it is best to check for both when relying
on either inside the Clang/LLVM code base.
This patch makes sure we always check for both variants. In addition,
it fixes one unnecessary check in lib/Target/PowerPC/PPCJITInfo.cpp.
(At least one of __ppc__ and __powerpc__ should always be defined when
compiling for a PowerPC target, no matter which compiler is used, so
testing for them is unnecessary.)
There are some places in the compiler that check for other variants,
like __POWERPC__ and _POWER, and I have left those in place. There is
no need to add them elsewhere. This seems to be in Apple-specific
code, and I won't take a chance on breaking it.
There is no intended change in behavior; thus, no test cases are
added.
llvm-svn: 187248
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Memory.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc index 58fda420eb6..73f586ff4a8 100644 --- a/llvm/lib/Support/Unix/Memory.inc +++ b/llvm/lib/Support/Unix/Memory.inc @@ -310,14 +310,14 @@ void Memory::InvalidateInstructionCache(const void *Addr, // icache invalidation for PPC and ARM. #if defined(__APPLE__) -# if (defined(__POWERPC__) || defined (__ppc__) || \ +# if (defined(__POWERPC__) || defined (__ppc__) || defined (__powerpc__) \ defined(_POWER) || defined(_ARCH_PPC)) || defined(__arm__) sys_icache_invalidate(const_cast<void *>(Addr), Len); # endif #else -# if (defined(__POWERPC__) || defined (__ppc__) || \ +# if (defined(__POWERPC__) || defined (__ppc__) || defined (__powerpc__) || \ defined(_POWER) || defined(_ARCH_PPC)) && defined(__GNUC__) const size_t LineSize = 32; |