aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-07-14 16:55:14 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-07-14 16:55:14 +0000
commitc23197a26f34f559ea9797de51e187087c039c42 (patch)
treebf497ec9a02cd2fc0b64e3e58eff037a719a854d /lib/VMCore
parent1f316e321a8f2fa0e193c5444584a67a8aabe9a8 (diff)
downloadexternal_llvm-c23197a26f34f559ea9797de51e187087c039c42.tar.gz
external_llvm-c23197a26f34f559ea9797de51e187087c039c42.tar.bz2
external_llvm-c23197a26f34f559ea9797de51e187087c039c42.zip
llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AsmWriter.cpp12
-rw-r--r--lib/VMCore/AutoUpgrade.cpp4
-rw-r--r--lib/VMCore/ConstantFold.cpp10
-rw-r--r--lib/VMCore/Constants.cpp10
-rw-r--r--lib/VMCore/Core.cpp4
-rw-r--r--lib/VMCore/Globals.cpp4
-rw-r--r--lib/VMCore/Instructions.cpp16
-rw-r--r--lib/VMCore/PassManager.cpp8
-rw-r--r--lib/VMCore/Type.cpp6
-rw-r--r--lib/VMCore/Value.cpp2
-rw-r--r--lib/VMCore/ValueTypes.cpp4
-rw-r--r--lib/VMCore/Verifier.cpp4
12 files changed, 42 insertions, 42 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index a49c09a1db..eab845f3ca 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -97,7 +97,7 @@ static void PrintLLVMName(raw_ostream &OS, const char *NameStr,
unsigned NameLen, PrefixType Prefix) {
assert(NameStr && "Cannot get empty name!");
switch (Prefix) {
- default: LLVM_UNREACHABLE("Bad prefix!");
+ default: llvm_unreachable("Bad prefix!");
case NoPrefix: break;
case GlobalPrefix: OS << '@'; break;
case LabelPrefix: break;
@@ -937,7 +937,7 @@ static void WriteConstantInt(raw_ostream &Out, const Constant *CV,
else if (&CFP->getValueAPF().getSemantics() == &APFloat::PPCDoubleDouble)
Out << 'M';
else
- LLVM_UNREACHABLE("Unsupported floating point type");
+ llvm_unreachable("Unsupported floating point type");
// api needed to prevent premature destruction
APInt api = CFP->getValueAPF().bitcastToAPInt();
const uint64_t* p = api.getRawData();
@@ -1210,7 +1210,7 @@ public:
else if (const Function *F = dyn_cast<Function>(G))
printFunction(F);
else
- LLVM_UNREACHABLE("Unknown global");
+ llvm_unreachable("Unknown global");
}
void write(const BasicBlock *BB) { printBasicBlock(BB); }
@@ -1350,7 +1350,7 @@ static void PrintLinkage(GlobalValue::LinkageTypes LT, raw_ostream &Out) {
case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
case GlobalValue::ExternalLinkage: break;
case GlobalValue::GhostLinkage:
- LLVM_UNREACHABLE("GhostLinkage not allowed in AsmWriter!");
+ llvm_unreachable("GhostLinkage not allowed in AsmWriter!");
}
}
@@ -1358,7 +1358,7 @@ static void PrintLinkage(GlobalValue::LinkageTypes LT, raw_ostream &Out) {
static void PrintVisibility(GlobalValue::VisibilityTypes Vis,
raw_ostream &Out) {
switch (Vis) {
- default: LLVM_UNREACHABLE("Invalid visibility style!");
+ default: llvm_unreachable("Invalid visibility style!");
case GlobalValue::DefaultVisibility: break;
case GlobalValue::HiddenVisibility: Out << "hidden "; break;
case GlobalValue::ProtectedVisibility: Out << "protected "; break;
@@ -1970,7 +1970,7 @@ void Value::print(raw_ostream &OS, AssemblyAnnotationWriter *AAW) const {
} else if (isa<InlineAsm>(this)) {
WriteAsOperand(OS, this, true, 0);
} else {
- LLVM_UNREACHABLE("Unknown value to print out!");
+ llvm_unreachable("Unknown value to print out!");
}
}
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp
index f3aa742c6b..c3405fce0e 100644
--- a/lib/VMCore/AutoUpgrade.cpp
+++ b/lib/VMCore/AutoUpgrade.cpp
@@ -334,13 +334,13 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
// Clean up the old call now that it has been completely upgraded.
CI->eraseFromParent();
} else {
- LLVM_UNREACHABLE("Unknown function for CallInst upgrade.");
+ llvm_unreachable("Unknown function for CallInst upgrade.");
}
return;
}
switch (NewFn->getIntrinsicID()) {
- default: LLVM_UNREACHABLE("Unknown function for CallInst upgrade.");
+ default: llvm_unreachable("Unknown function for CallInst upgrade.");
case Intrinsic::x86_mmx_psll_d:
case Intrinsic::x86_mmx_psll_q:
case Intrinsic::x86_mmx_psll_w:
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 4a5c2247b3..7b10f44491 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -313,7 +313,7 @@ Constant *llvm::ConstantFoldCastInstruction(LLVMContext &Context,
break;
}
- LLVM_UNREACHABLE("Failed to cast constant expression");
+ llvm_unreachable("Failed to cast constant expression");
return 0;
}
@@ -1418,7 +1418,7 @@ Constant *llvm::ConstantFoldCompareInstruction(LLVMContext &Context,
APInt V1 = cast<ConstantInt>(C1)->getValue();
APInt V2 = cast<ConstantInt>(C2)->getValue();
switch (pred) {
- default: LLVM_UNREACHABLE("Invalid ICmp Predicate"); return 0;
+ default: llvm_unreachable("Invalid ICmp Predicate"); return 0;
case ICmpInst::ICMP_EQ:
return Context.getConstantInt(Type::Int1Ty, V1 == V2);
case ICmpInst::ICMP_NE:
@@ -1445,7 +1445,7 @@ Constant *llvm::ConstantFoldCompareInstruction(LLVMContext &Context,
APFloat C2V = cast<ConstantFP>(C2)->getValueAPF();
APFloat::cmpResult R = C1V.compare(C2V);
switch (pred) {
- default: LLVM_UNREACHABLE("Invalid FCmp Predicate"); return 0;
+ default: llvm_unreachable("Invalid FCmp Predicate"); return 0;
case FCmpInst::FCMP_FALSE: return Context.getConstantIntFalse();
case FCmpInst::FCMP_TRUE: return Context.getConstantIntTrue();
case FCmpInst::FCMP_UNO:
@@ -1502,7 +1502,7 @@ Constant *llvm::ConstantFoldCompareInstruction(LLVMContext &Context,
if (C1->getType()->isFloatingPoint()) {
int Result = -1; // -1 = unknown, 0 = known false, 1 = known true.
switch (evaluateFCmpRelation(Context, C1, C2)) {
- default: LLVM_UNREACHABLE("Unknown relation!");
+ default: llvm_unreachable("Unknown relation!");
case FCmpInst::FCMP_UNO:
case FCmpInst::FCMP_ORD:
case FCmpInst::FCMP_UEQ:
@@ -1561,7 +1561,7 @@ Constant *llvm::ConstantFoldCompareInstruction(LLVMContext &Context,
// Evaluate the relation between the two constants, per the predicate.
int Result = -1; // -1 = unknown, 0 = known false, 1 = known true.
switch (evaluateICmpRelation(Context, C1, C2, CmpInst::isSigned(pred))) {
- default: LLVM_UNREACHABLE("Unknown relational!");
+ default: llvm_unreachable("Unknown relational!");
case ICmpInst::BAD_ICMP_PREDICATE:
break; // Couldn't determine anything about these constants.
case ICmpInst::ICMP_EQ: // We know the constants are equal!
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 390cb7bc14..33c8f675f8 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -964,7 +964,7 @@ namespace llvm {
template<class ConstantClass, class TypeClass>
struct VISIBILITY_HIDDEN ConvertConstantType {
static void convert(ConstantClass *OldC, const TypeClass *NewTy) {
- LLVM_UNREACHABLE("This type cannot be converted!");
+ llvm_unreachable("This type cannot be converted!");
}
};
@@ -1782,7 +1782,7 @@ namespace llvm {
if (V.opcode == Instruction::FCmp)
return new CompareConstantExpr(Ty, Instruction::FCmp, V.predicate,
V.operands[0], V.operands[1]);
- LLVM_UNREACHABLE("Invalid ConstantExpr!");
+ llvm_unreachable("Invalid ConstantExpr!");
return 0;
}
};
@@ -1874,7 +1874,7 @@ Constant *ConstantExpr::getCast(unsigned oc, Constant *C, const Type *Ty) {
switch (opc) {
default:
- LLVM_UNREACHABLE("Invalid cast opcode");
+ llvm_unreachable("Invalid cast opcode");
break;
case Instruction::Trunc: return getTrunc(C, Ty);
case Instruction::ZExt: return getZExt(C, Ty);
@@ -2113,7 +2113,7 @@ Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode,
Constant *ConstantExpr::getCompareTy(unsigned short predicate,
Constant *C1, Constant *C2) {
switch (predicate) {
- default: LLVM_UNREACHABLE("Invalid CmpInst predicate");
+ default: llvm_unreachable("Invalid CmpInst predicate");
case CmpInst::FCMP_FALSE: case CmpInst::FCMP_OEQ: case CmpInst::FCMP_OGT:
case CmpInst::FCMP_OGE: case CmpInst::FCMP_OLT: case CmpInst::FCMP_OLE:
case CmpInst::FCMP_ONE: case CmpInst::FCMP_ORD: case CmpInst::FCMP_UNO:
@@ -2715,7 +2715,7 @@ void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *ToV,
if (C2 == From) C2 = To;
Replacement = ConstantExpr::get(getOpcode(), C1, C2);
} else {
- LLVM_UNREACHABLE("Unknown ConstantExpr type!");
+ llvm_unreachable("Unknown ConstantExpr type!");
return;
}
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index 068735e490..d04701e146 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -1063,7 +1063,7 @@ unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr) {
return CI->getCallingConv();
else if (InvokeInst *II = dyn_cast<InvokeInst>(V))
return II->getCallingConv();
- LLVM_UNREACHABLE("LLVMGetInstructionCallConv applies only to call and invoke!");
+ llvm_unreachable("LLVMGetInstructionCallConv applies only to call and invoke!");
return 0;
}
@@ -1073,7 +1073,7 @@ void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC) {
return CI->setCallingConv(CC);
else if (InvokeInst *II = dyn_cast<InvokeInst>(V))
return II->setCallingConv(CC);
- LLVM_UNREACHABLE("LLVMSetInstructionCallConv applies only to call and invoke!");
+ llvm_unreachable("LLVMSetInstructionCallConv applies only to call and invoke!");
}
void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index,
diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp
index adc7a82e6d..5c05308eaa 100644
--- a/lib/VMCore/Globals.cpp
+++ b/lib/VMCore/Globals.cpp
@@ -79,7 +79,7 @@ void GlobalValue::removeDeadConstantUsers() const {
/// Override destroyConstant to make sure it doesn't get called on
/// GlobalValue's because they shouldn't be treated like other constants.
void GlobalValue::destroyConstant() {
- LLVM_UNREACHABLE("You can't GV->destroyConstant()!");
+ llvm_unreachable("You can't GV->destroyConstant()!");
}
/// copyAttributesFrom - copy all additional attributes (those not needed to
@@ -246,7 +246,7 @@ const GlobalValue *GlobalAlias::getAliasedGlobal() const {
CE->getOpcode() == Instruction::GetElementPtr))
return dyn_cast<GlobalValue>(CE->getOperand(0));
else
- LLVM_UNREACHABLE("Unsupported aliasee");
+ llvm_unreachable("Unsupported aliasee");
}
}
return 0;
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 9a49bfc154..8ce40a95b1 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -536,11 +536,11 @@ unsigned ReturnInst::getNumSuccessorsV() const {
/// Out-of-line ReturnInst method, put here so the C++ compiler can choose to
/// emit the vtable for the class in this translation unit.
void ReturnInst::setSuccessorV(unsigned idx, BasicBlock *NewSucc) {
- LLVM_UNREACHABLE("ReturnInst has no successors!");
+ llvm_unreachable("ReturnInst has no successors!");
}
BasicBlock *ReturnInst::getSuccessorV(unsigned idx) const {
- LLVM_UNREACHABLE("ReturnInst has no successors!");
+ llvm_unreachable("ReturnInst has no successors!");
return 0;
}
@@ -564,11 +564,11 @@ unsigned UnwindInst::getNumSuccessorsV() const {
}
void UnwindInst::setSuccessorV(unsigned idx, BasicBlock *NewSucc) {
- LLVM_UNREACHABLE("UnwindInst has no successors!");
+ llvm_unreachable("UnwindInst has no successors!");
}
BasicBlock *UnwindInst::getSuccessorV(unsigned idx) const {
- LLVM_UNREACHABLE("UnwindInst has no successors!");
+ llvm_unreachable("UnwindInst has no successors!");
return 0;
}
@@ -588,11 +588,11 @@ unsigned UnreachableInst::getNumSuccessorsV() const {
}
void UnreachableInst::setSuccessorV(unsigned idx, BasicBlock *NewSucc) {
- LLVM_UNREACHABLE("UnwindInst has no successors!");
+ llvm_unreachable("UnwindInst has no successors!");
}
BasicBlock *UnreachableInst::getSuccessorV(unsigned idx) const {
- LLVM_UNREACHABLE("UnwindInst has no successors!");
+ llvm_unreachable("UnwindInst has no successors!");
return 0;
}
@@ -2298,7 +2298,7 @@ CastInst::getCastOpcode(
PTy = NULL;
return BitCast; // same size, no-op cast
} else {
- LLVM_UNREACHABLE("Casting pointer or non-first class to float");
+ llvm_unreachable("Casting pointer or non-first class to float");
}
} else if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
if (const VectorType *SrcPTy = dyn_cast<VectorType>(SrcTy)) {
@@ -2709,7 +2709,7 @@ ICmpInst::makeConstantRange(Predicate pred, const APInt &C) {
APInt Upper(C);
uint32_t BitWidth = C.getBitWidth();
switch (pred) {
- default: LLVM_UNREACHABLE("Invalid ICmp opcode to ConstantRange ctor!");
+ default: llvm_unreachable("Invalid ICmp opcode to ConstantRange ctor!");
case ICmpInst::ICMP_EQ: Upper++; break;
case ICmpInst::ICMP_NE: Lower++; break;
case ICmpInst::ICMP_ULT: Lower = APInt::getMinValue(BitWidth); break;
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp
index a454b56789..659120b57b 100644
--- a/lib/VMCore/PassManager.cpp
+++ b/lib/VMCore/PassManager.cpp
@@ -724,7 +724,7 @@ void PMDataManager::verifyDomInfo(Pass &P, Function &F) {
OtherDT.dump();
cerr << "----- Invalid -----\n";
DT->dump();
- LLVM_UNREACHABLE("Invalid dominator info");
+ llvm_unreachable("Invalid dominator info");
}
DominanceFrontier *DF = P.getAnalysisIfAvailable<DominanceFrontier>();
@@ -741,7 +741,7 @@ void PMDataManager::verifyDomInfo(Pass &P, Function &F) {
OtherDF.dump();
cerr << "----- Invalid -----\n";
DF->dump();
- LLVM_UNREACHABLE("Invalid dominator info");
+ llvm_unreachable("Invalid dominator info");
}
}
@@ -883,7 +883,7 @@ void PMDataManager::add(Pass *P, bool ProcessAnalysis) {
// Keep track of higher level analysis used by this manager.
HigherLevelAnalysis.push_back(PRequired);
} else
- LLVM_UNREACHABLE("Unable to accomodate Required Pass");
+ llvm_unreachable("Unable to accomodate Required Pass");
}
// Set P as P's last user until someone starts using P.
@@ -1106,7 +1106,7 @@ void PMDataManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
cerr << "Unable to schedule '" << RequiredPass->getPassName();
cerr << "' required by '" << P->getPassName() << "'\n";
#endif
- LLVM_UNREACHABLE("Unable to schedule pass");
+ llvm_unreachable("Unable to schedule pass");
}
// Destructor
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index c94e911f40..9ceed26e60 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -265,10 +265,10 @@ const Type *Type::getForwardedTypeInternal() const {
}
void Type::refineAbstractType(const DerivedType *OldTy, const Type *NewTy) {
- LLVM_UNREACHABLE("Attempting to refine a derived type!");
+ llvm_unreachable("Attempting to refine a derived type!");
}
void Type::typeBecameConcrete(const DerivedType *AbsTy) {
- LLVM_UNREACHABLE("DerivedType is already a concrete type!");
+ llvm_unreachable("DerivedType is already a concrete type!");
}
@@ -634,7 +634,7 @@ static bool TypesEqual(const Type *Ty, const Type *Ty2,
}
return true;
} else {
- LLVM_UNREACHABLE("Unknown derived type!");
+ llvm_unreachable("Unknown derived type!");
return false;
}
}
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 94bafdf95f..f3d561fe39 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -516,7 +516,7 @@ void ValueHandleBase::ValueIsDeleted(Value *V) {
cerr << "While deleting: " << *V->getType() << " %" << V->getNameStr()
<< "\n";
#endif
- LLVM_UNREACHABLE("An asserting value handle still pointed to this"
+ llvm_unreachable("An asserting value handle still pointed to this"
" value!");
case Weak:
// Weak just goes to null, which will unlink it from the list.
diff --git a/lib/VMCore/ValueTypes.cpp b/lib/VMCore/ValueTypes.cpp
index 82b030e07f..6e2917b6e7 100644
--- a/lib/VMCore/ValueTypes.cpp
+++ b/lib/VMCore/ValueTypes.cpp
@@ -91,7 +91,7 @@ std::string MVT::getMVTString() const {
getVectorElementType().getMVTString();
if (isInteger())
return "i" + utostr(getSizeInBits());
- LLVM_UNREACHABLE("Invalid MVT!");
+ llvm_unreachable("Invalid MVT!");
return "?";
case MVT::i1: return "i1";
case MVT::i8: return "i8";
@@ -184,7 +184,7 @@ MVT MVT::getMVT(const Type *Ty, bool HandleUnknown){
switch (Ty->getTypeID()) {
default:
if (HandleUnknown) return MVT::Other;
- LLVM_UNREACHABLE("Unknown type!");
+ llvm_unreachable("Unknown type!");
return MVT::isVoid;
case Type::VoidTyID:
return MVT::isVoid;
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 1f43569dde..897e62c1eb 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -208,7 +208,7 @@ namespace {
if (!Broken) return false;
msgs << "Broken module found, ";
switch (action) {
- default: LLVM_UNREACHABLE("Unknown action");
+ default: llvm_unreachable("Unknown action");
case AbortProcessAction:
msgs << "compilation aborted!\n";
cerr << msgs.str();
@@ -1117,7 +1117,7 @@ void Verifier::visitBinaryOperator(BinaryOperator &B) {
"Shift return type must be same as operands!", &B);
break;
default:
- LLVM_UNREACHABLE("Unknown BinaryOperator opcode!");
+ llvm_unreachable("Unknown BinaryOperator opcode!");
}
visitInstruction(B);