summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-07-11 20:10:48 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-07-11 20:10:48 +0000
commitc25e7581b9b8088910da31702d4ca21c4734c6d7 (patch)
treee4bb95c96a33fda5d5204f2c9d1b906084760415 /lib/ExecutionEngine/ExecutionEngine.cpp
parentd51ffcf303070b0a5aea7f365b85f6f969c384cb (diff)
downloadllvm-c25e7581b9b8088910da31702d4ca21c4734c6d7.tar.gz
llvm-c25e7581b9b8088910da31702d4ca21c4734c6d7.tar.bz2
llvm-c25e7581b9b8088910da31702d4ca21c4734c6d7.tar.xz
assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 7c7456562b..226cd4fea0 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -421,7 +421,7 @@ void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) {
const_cast<GlobalVariable *>(dyn_cast<GlobalVariable>(GV)))
EmitGlobalVariable(GVar);
else
- assert(0 && "Global hasn't had an address allocated yet!");
+ LLVM_UNREACHABLE("Global hasn't had an address allocated yet!");
return state.getGlobalAddressMap(locked)[GV];
}
@@ -548,7 +548,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
GenericValue GV = getConstantValue(Op0);
const Type* DestTy = CE->getType();
switch (Op0->getType()->getTypeID()) {
- default: assert(0 && "Invalid bitcast operand");
+ default: LLVM_UNREACHABLE("Invalid bitcast operand");
case Type::IntegerTyID:
assert(DestTy->isFloatingPoint() && "invalid bitcast");
if (DestTy == Type::FloatTy)
@@ -590,7 +590,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
default: LLVM_UNREACHABLE("Bad add type!");
case Type::IntegerTyID:
switch (CE->getOpcode()) {
- default: assert(0 && "Invalid integer opcode");
+ default: LLVM_UNREACHABLE("Invalid integer opcode");
case Instruction::Add: GV.IntVal = LHS.IntVal + RHS.IntVal; break;
case Instruction::Sub: GV.IntVal = LHS.IntVal - RHS.IntVal; break;
case Instruction::Mul: GV.IntVal = LHS.IntVal * RHS.IntVal; break;
@@ -638,7 +638,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
case Type::FP128TyID: {
APFloat apfLHS = APFloat(LHS.IntVal);
switch (CE->getOpcode()) {
- default: assert(0 && "Invalid long double opcode");llvm_unreachable();
+ default: LLVM_UNREACHABLE("Invalid long double opcode");llvm_unreachable();
case Instruction::FAdd:
apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
GV.IntVal = apfLHS.bitcastToAPInt();
@@ -698,7 +698,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
else if (const GlobalVariable* GV = dyn_cast<GlobalVariable>(C))
Result = PTOGV(getOrEmitGlobalVariable(const_cast<GlobalVariable*>(GV)));
else
- assert(0 && "Unknown constant pointer type!");
+ LLVM_UNREACHABLE("Unknown constant pointer type!");
break;
default:
std::string msg;
@@ -881,7 +881,7 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) {
}
cerr << "Bad Type: " << *Init->getType() << "\n";
- assert(0 && "Unknown constant type to initialize memory with!");
+ LLVM_UNREACHABLE("Unknown constant type to initialize memory with!");
}
/// EmitGlobals - Emit all of the global variables to memory, storing their