[llvm-commits] [llvm] r153643 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp

Benjamin Kramer benny.kra at googlemail.com
Thu Mar 29 05:37:26 PDT 2012


Author: d0k
Date: Thu Mar 29 07:37:26 2012
New Revision: 153643

URL: http://llvm.org/viewvc/llvm-project?rev=153643&view=rev
Log:
Replace assert(0) with llvm_unreachable to avoid warnings about dropping off the end of a non-void function in Release builds.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=153643&r1=153642&r2=153643&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Mar 29 07:37:26 2012
@@ -1908,23 +1908,22 @@
   return true;
 }
 
-/// getFusedLdStOpcode - Get the appropriate X86 opcode for an in memory 
-/// increment or decrement. Opc should be X86ISD::DEC or X86ISD:INC.
+/// getFusedLdStOpcode - Get the appropriate X86 opcode for an in memory
+/// increment or decrement. Opc should be X86ISD::DEC or X86ISD::INC.
 static unsigned getFusedLdStOpcode(EVT &LdVT, unsigned Opc) {
   if (Opc == X86ISD::DEC) {
     if (LdVT == MVT::i64) return X86::DEC64m;
     if (LdVT == MVT::i32) return X86::DEC32m;
     if (LdVT == MVT::i16) return X86::DEC16m;
     if (LdVT == MVT::i8)  return X86::DEC8m;
-    assert(0 && "unrecognized size for LdVT");
-  }
-  else {
+  } else {
+    assert(Opc == X86ISD::INC && "unrecognized opcode");
     if (LdVT == MVT::i64) return X86::INC64m;
     if (LdVT == MVT::i32) return X86::INC32m;
     if (LdVT == MVT::i16) return X86::INC16m;
     if (LdVT == MVT::i8)  return X86::INC8m;
-    assert(0 && "unrecognized size for LdVT");
   }
+  llvm_unreachable("unrecognized size for LdVT");
 }
 
 SDNode *X86DAGToDAGISel::Select(SDNode *Node) {





More information about the llvm-commits mailing list