summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2018-10-15 10:10:54 +0000
committerChandler Carruth <chandlerc@gmail.com>2018-10-15 10:10:54 +0000
commit52eaaf3ff8cf7321612d8f5197362fd08094d391 (patch)
tree80725d9570948dc32680a8f2f4385abb4d6d20e5 /llvm/lib/Transforms
parentedb12a838a22f212d7bee970ff637192f7ea8576 (diff)
downloadbcm5719-llvm-52eaaf3ff8cf7321612d8f5197362fd08094d391.tar.gz
bcm5719-llvm-52eaaf3ff8cf7321612d8f5197362fd08094d391.zip
[TI removal] Rework `InstVisitor` to support visiting instructions that
are terminators without relying on the specific `TerminatorInst` type. This required cleaning up two users of `InstVisitor`s usage of `TerminatorInst` as well. llvm-svn: 344503
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 11e5549c332..b7340f294fd 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -563,7 +563,7 @@ private:
// getFeasibleSuccessors - Return a vector of booleans to indicate which
// successors are reachable from a given terminator instruction.
- void getFeasibleSuccessors(TerminatorInst &TI, SmallVectorImpl<bool> &Succs);
+ void getFeasibleSuccessors(Instruction &TI, SmallVectorImpl<bool> &Succs);
// OperandChangedState - This method is invoked on all of the users of an
// instruction that was just changed state somehow. Based on this
@@ -604,7 +604,7 @@ private:
// Terminators
void visitReturnInst(ReturnInst &I);
- void visitTerminatorInst(TerminatorInst &TI);
+ void visitTerminator(Instruction &TI);
void visitCastInst(CastInst &I);
void visitSelectInst(SelectInst &I);
@@ -615,7 +615,7 @@ private:
void visitCatchSwitchInst(CatchSwitchInst &CPI) {
markOverdefined(&CPI);
- visitTerminatorInst(CPI);
+ visitTerminator(CPI);
}
// Instructions that cannot be folded away.
@@ -630,12 +630,12 @@ private:
void visitInvokeInst (InvokeInst &II) {
visitCallSite(&II);
- visitTerminatorInst(II);
+ visitTerminator(II);
}
void visitCallSite (CallSite CS);
- void visitResumeInst (TerminatorInst &I) { /*returns void*/ }
- void visitUnreachableInst(TerminatorInst &I) { /*returns void*/ }
+ void visitResumeInst (ResumeInst &I) { /*returns void*/ }
+ void visitUnreachableInst(UnreachableInst &I) { /*returns void*/ }
void visitFenceInst (FenceInst &I) { /*returns void*/ }
void visitInstruction(Instruction &I) {
@@ -650,7 +650,7 @@ private:
// getFeasibleSuccessors - Return a vector of booleans to indicate which
// successors are reachable from a given terminator instruction.
-void SCCPSolver::getFeasibleSuccessors(TerminatorInst &TI,
+void SCCPSolver::getFeasibleSuccessors(Instruction &TI,
SmallVectorImpl<bool> &Succs) {
Succs.resize(TI.getNumSuccessors());
if (auto *BI = dyn_cast<BranchInst>(&TI)) {
@@ -837,7 +837,7 @@ void SCCPSolver::visitReturnInst(ReturnInst &I) {
}
}
-void SCCPSolver::visitTerminatorInst(TerminatorInst &TI) {
+void SCCPSolver::visitTerminator(Instruction &TI) {
SmallVector<bool, 16> SuccFeasible;
getFeasibleSuccessors(TI, SuccFeasible);
OpenPOWER on IntegriCloud