summaryrefslogtreecommitdiff
path: root/unittests/ADT
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2013-07-26 21:39:15 +0000
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>2013-07-26 21:39:15 +0000
commitd063a326b2567c3ca759f069e7680979036b9d5e (patch)
tree224c374c0d4849c84378a77dbf270d2b7a5d58bb /unittests/ADT
parent388d3225dd26d5ebe1eaf4d993eff8cf602c258f (diff)
downloadllvm-d063a326b2567c3ca759f069e7680979036b9d5e.tar.gz
llvm-d063a326b2567c3ca759f069e7680979036b9d5e.tar.bz2
llvm-d063a326b2567c3ca759f069e7680979036b9d5e.tar.xz
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT')
-rw-r--r--unittests/ADT/BitVectorTest.cpp2
-rw-r--r--unittests/ADT/PackedVectorTest.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/unittests/ADT/BitVectorTest.cpp b/unittests/ADT/BitVectorTest.cpp
index d7cde891fb..4d3223e418 100644
--- a/unittests/ADT/BitVectorTest.cpp
+++ b/unittests/ADT/BitVectorTest.cpp
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
// Some of these tests fail on PowerPC for unknown reasons.
-#ifndef __ppc__
+#if !defined(__ppc__) && !defined(__powerpc__)
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallBitVector.h"
diff --git a/unittests/ADT/PackedVectorTest.cpp b/unittests/ADT/PackedVectorTest.cpp
index 55b5d8d049..b6a7e58301 100644
--- a/unittests/ADT/PackedVectorTest.cpp
+++ b/unittests/ADT/PackedVectorTest.cpp
@@ -9,7 +9,7 @@
// BitVectorTest tests fail on PowerPC for unknown reasons, so disable this
// as well since it depends on a BitVector.
-#ifndef __ppc__
+#if !defined(__ppc__) && !defined(__powerpc__)
#include "llvm/ADT/PackedVector.h"
#include "gtest/gtest.h"