aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp6
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp5
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp4
-rw-r--r--lib/Transforms/Utils/BasicBlockUtils.cpp4
-rw-r--r--lib/Transforms/Utils/CodeExtractor.cpp4
5 files changed, 14 insertions, 9 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 79de4432d8..89881f739f 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -48,6 +48,7 @@
#include "llvm/Support/CallSite.h"
#include "llvm/Support/ConstantRange.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/InstVisitor.h"
#include "llvm/Support/MathExtras.h"
@@ -1927,8 +1928,7 @@ static Value *FoldOperationIntoSelectOperand(Instruction &I, Value *SO,
New = CmpInst::Create(*Context, CI->getOpcode(), CI->getPredicate(),
Op0, Op1, SO->getName()+".cmp");
else {
- assert(0 && "Unknown binary instruction type!");
- abort();
+ LLVM_UNREACHABLE("Unknown binary instruction type!");
}
return IC->InsertNewInstBefore(New, I);
}
@@ -9114,7 +9114,7 @@ static unsigned GetSelectFoldableOperands(Instruction *I) {
static Constant *GetSelectFoldableConstant(Instruction *I,
LLVMContext *Context) {
switch (I->getOpcode()) {
- default: assert(0 && "This cannot happen!"); abort();
+ default: LLVM_UNREACHABLE("This cannot happen!");
case Instruction::Add:
case Instruction::Sub:
case Instruction::Or:
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 4a156907bf..2de64c15ab 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -35,6 +35,7 @@
#include "llvm/Support/CallSite.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/InstVisitor.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
@@ -513,8 +514,10 @@ bool SCCPSolver::isEdgeFeasible(BasicBlock *From, BasicBlock *To) {
}
return false;
} else {
+#ifndef NDEBUG
cerr << "Unknown terminator instruction: " << *TI;
- abort();
+#endif
+ llvm_unreachable();
}
}
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 61fc9eed01..da2c375be9 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -34,6 +34,7 @@
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/IRBuilder.h"
#include "llvm/Support/MathExtras.h"
@@ -1510,8 +1511,7 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, uint64_t Offset) {
continue;
}
- assert(0 && "Unsupported operation!");
- abort();
+ LLVM_UNREACHABLE("Unsupported operation!");
}
}
diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp
index f52546ccc4..c9af474342 100644
--- a/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -24,6 +24,7 @@
#include "llvm/Analysis/Dominators.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/Utils/Local.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ValueHandle.h"
#include <algorithm>
using namespace llvm;
@@ -263,8 +264,7 @@ void llvm::RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum) {
case Instruction::Switch: // Should remove entry
default:
case Instruction::Ret: // Cannot happen, has no successors!
- assert(0 && "Unhandled terminator instruction type in RemoveSuccessor!");
- abort();
+ LLVM_UNREACHABLE("Unhandled terminator instruction type in RemoveSuccessor!");
}
if (NewTI) // If it's a different instruction, replace.
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp
index 09b9faf220..be02560de0 100644
--- a/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/lib/Transforms/Utils/CodeExtractor.cpp
@@ -28,6 +28,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/ADT/StringExtras.h"
#include <algorithm>
#include <set>
@@ -710,7 +711,8 @@ ExtractCodeRegion(const std::vector<BasicBlock*> &code) {
// cerr << "OLD FUNCTION: " << *oldFunction;
// verifyFunction(*oldFunction);
- DEBUG(if (verifyFunction(*newFunction)) abort());
+ DEBUG(if (verifyFunction(*newFunction))
+ llvm_report_error("verifyFunction failed!"));
return newFunction;
}