[llvm-commits] [llvm] r141366 - /llvm/trunk/lib/VMCore/Core.cpp
Matt Beaumont-Gay
matthewbg at google.com
Fri Oct 7 09:27:01 PDT 2011
Author: matthewbg
Date: Fri Oct 7 11:27:01 2011
New Revision: 141366
URL: http://llvm.org/viewvc/llvm-project?rev=141366&view=rev
Log:
Move default to top of switch
Modified:
llvm/trunk/lib/VMCore/Core.cpp
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=141366&r1=141365&r2=141366&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Fri Oct 7 11:27:01 2011
@@ -660,25 +660,23 @@
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 ................................................--*/
More information about the llvm-commits
mailing list