[llvm] r183854 - [PowerPC] Fix switch warnings from r183841.
Bill Schmidt
wschmidt at linux.vnet.ibm.com
Wed Jun 12 12:20:32 PDT 2013
Author: wschmidt
Date: Wed Jun 12 14:20:32 2013
New Revision: 183854
URL: http://llvm.org/viewvc/llvm-project?rev=183854&view=rev
Log:
[PowerPC] Fix switch warnings from r183841.
Introducing PRED_BAD caused some unexpected warnings that are now
suppressed.
Modified:
llvm/trunk/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
Modified: llvm/trunk/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp?rev=183854&r1=183853&r2=183854&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp Wed Jun 12 14:20:32 2013
@@ -90,6 +90,7 @@ void PPCInstPrinter::printPredicateOpera
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;
Modified: llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp?rev=183854&r1=183853&r2=183854&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp Wed Jun 12 14:20:32 2013
@@ -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:
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(
case PPC::PRED_NU: return PPC::PRED_NU;
case PPC::PRED_UN: return PPC::PRED_UN;
}
- llvm_unreachable("Unknown PPC branch opcode!");
}
More information about the llvm-commits
mailing list