summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2013-06-12 19:20:32 +0000
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>2013-06-12 19:20:32 +0000
commitdab366bf25ef00a37e5d9306c6dcbbb7c1d3e19a (patch)
treea4ce9a0d97efa5f2ed42409303003f05fed7dd10 /lib
parent4bf771b4e6d37ae1d6ae08ea27c4070a3a09784d (diff)
downloadllvm-dab366bf25ef00a37e5d9306c6dcbbb7c1d3e19a.tar.gz
llvm-dab366bf25ef00a37e5d9306c6dcbbb7c1d3e19a.tar.bz2
llvm-dab366bf25ef00a37e5d9306c6dcbbb7c1d3e19a.tar.xz
[PowerPC] Fix switch warnings from r183841.
Introducing PRED_BAD caused some unexpected warnings that are now suppressed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp1
-rw-r--r--lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp b/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
index 432167e335..f0a57c080a 100644
--- a/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
+++ b/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
@@ -90,6 +90,7 @@ void PPCInstPrinter::printPredicateOperand(const MCInst *MI, unsigned OpNo,
if (StringRef(Modifier) == "cc") {
switch ((PPC::Predicate)Code) {
+ default: llvm_unreachable("Bad predicate!");
case PPC::PRED_LT: O << "lt"; return;
case PPC::PRED_LE: O << "le"; return;
case PPC::PRED_EQ: O << "eq"; return;
diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
index 853e505395..1c69a0bcd9 100644
--- a/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
+++ b/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
@@ -18,6 +18,7 @@ using namespace llvm;
PPC::Predicate PPC::InvertPredicate(PPC::Predicate Opcode) {
switch (Opcode) {
+ default: llvm_unreachable("Unknown PPC branch opcode!");
case PPC::PRED_EQ: return PPC::PRED_NE;
case PPC::PRED_NE: return PPC::PRED_EQ;
case PPC::PRED_LT: return PPC::PRED_GE;
@@ -27,11 +28,11 @@ PPC::Predicate PPC::InvertPredicate(PPC::Predicate Opcode) {
case PPC::PRED_NU: return PPC::PRED_UN;
case PPC::PRED_UN: return PPC::PRED_NU;
}
- llvm_unreachable("Unknown PPC branch opcode!");
}
PPC::Predicate PPC::getSwappedPredicate(PPC::Predicate Opcode) {
switch (Opcode) {
+ default: llvm_unreachable("Unknown PPC branch opcode!");
case PPC::PRED_EQ: return PPC::PRED_EQ;
case PPC::PRED_NE: return PPC::PRED_NE;
case PPC::PRED_LT: return PPC::PRED_GT;
@@ -41,6 +42,5 @@ PPC::Predicate PPC::getSwappedPredicate(PPC::Predicate Opcode) {
case PPC::PRED_NU: return PPC::PRED_NU;
case PPC::PRED_UN: return PPC::PRED_UN;
}
- llvm_unreachable("Unknown PPC branch opcode!");
}