Move default to top of switch
authorMatt Beaumont-Gay <matthewbg@google.com>
Fri, 7 Oct 2011 16:27:01 +0000 (16:27 +0000)
committerMatt Beaumont-Gay <matthewbg@google.com>
Fri, 7 Oct 2011 16:27:01 +0000 (16:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141366 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Core.cpp

index 96760579b656ceec3e06217d6c3a442c1cfcc706..3c780794528045f05041cc8a59eeaba108f2a0f2 100644 (file)
@@ -660,25 +660,23 @@ LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size) {
 static LLVMOpcode map_to_llvmopcode(int opcode)
 {
     switch (opcode) {
+      default:
+        assert(0 && "Unhandled Opcode.");
 #define HANDLE_INST(num, opc, clas) case num: return LLVM##opc;
 #include "llvm/Instruction.def"
 #undef HANDLE_INST
-       default:
-           assert(false && "Unhandled Opcode.");
     }
-    return static_cast<LLVMOpcode>(0);
 }
 
 static int map_from_llvmopcode(LLVMOpcode code)
 {
     switch (code) {
+      default:
+        assert(0 && "Unhandled Opcode.");
 #define HANDLE_INST(num, opc, clas) case LLVM##opc: return num;
 #include "llvm/Instruction.def"
 #undef HANDLE_INST
-       default:
-           assert(false && "Unhandled Opcode.");
     }
-    return 0;
 }
 
 /*--.. Constant expressions ................................................--*/