Skip to content

Commit b7609cd

Browse files
author
Matt Beaumont-Gay
committed
Move default to top of switch
llvm-svn: 141366
1 parent 318d6ba commit b7609cd

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/VMCore/Core.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -660,25 +660,23 @@ LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size) {
660660
static LLVMOpcode map_to_llvmopcode(int opcode)
661661
{
662662
switch (opcode) {
663+
default:
664+
assert(0 && "Unhandled Opcode.");
663665
#define HANDLE_INST(num, opc, clas) case num: return LLVM##opc;
664666
#include "llvm/Instruction.def"
665667
#undef HANDLE_INST
666-
default:
667-
assert(false && "Unhandled Opcode.");
668668
}
669-
return static_cast<LLVMOpcode>(0);
670669
}
671670

672671
static int map_from_llvmopcode(LLVMOpcode code)
673672
{
674673
switch (code) {
674+
default:
675+
assert(0 && "Unhandled Opcode.");
675676
#define HANDLE_INST(num, opc, clas) case LLVM##opc: return num;
676677
#include "llvm/Instruction.def"
677678
#undef HANDLE_INST
678-
default:
679-
assert(false && "Unhandled Opcode.");
680679
}
681-
return 0;
682680
}
683681

684682
/*--.. Constant expressions ................................................--*/

0 commit comments

Comments
 (0)