forked from OSchip/llvm-project
[TI removal] Remove TerminatorInst as an input parameter from all public
LLVM APIs. There weren't very many. We still have the instruction visitor, and APIs with TerminatorInst as a return type or an output parameter. llvm-svn: 344494
This commit is contained in:
parent
296a862cbe
commit
b99a24689b
|
@ -25,7 +25,6 @@ class DominatorTree;
|
|||
class Function;
|
||||
class Instruction;
|
||||
class LoopInfo;
|
||||
class TerminatorInst;
|
||||
|
||||
/// Analyze the specified function to find all of the loop backedges in the
|
||||
/// function and return them. This is a relatively cheap (compared to
|
||||
|
@ -46,7 +45,7 @@ unsigned GetSuccessorNumber(const BasicBlock *BB, const BasicBlock *Succ);
|
|||
/// edges from a block with multiple successors to a block with multiple
|
||||
/// predecessors.
|
||||
///
|
||||
bool isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
|
||||
bool isCriticalEdge(const Instruction *TI, unsigned SuccNum,
|
||||
bool AllowIdenticalEdges = false);
|
||||
|
||||
/// Determine whether instruction 'To' is reachable from 'From',
|
||||
|
|
|
@ -128,7 +128,7 @@ struct CriticalEdgeSplittingOptions {
|
|||
/// IndirectBrInst. Splitting these edges will almost always create an invalid
|
||||
/// program because the address of the new block won't be the one that is jumped
|
||||
/// to.
|
||||
BasicBlock *SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
|
||||
BasicBlock *SplitCriticalEdge(Instruction *TI, unsigned SuccNum,
|
||||
const CriticalEdgeSplittingOptions &Options =
|
||||
CriticalEdgeSplittingOptions());
|
||||
|
||||
|
|
|
@ -85,8 +85,9 @@ unsigned llvm::GetSuccessorNumber(const BasicBlock *BB,
|
|||
/// isCriticalEdge - Return true if the specified edge is a critical edge.
|
||||
/// Critical edges are edges from a block with multiple successors to a block
|
||||
/// with multiple predecessors.
|
||||
bool llvm::isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
|
||||
bool llvm::isCriticalEdge(const Instruction *TI, unsigned SuccNum,
|
||||
bool AllowIdenticalEdges) {
|
||||
assert(TI->isTerminator() && "Must be a terminator to have successors!");
|
||||
assert(SuccNum < TI->getNumSuccessors() && "Illegal edge specification!");
|
||||
if (TI->getNumSuccessors() == 1) return false;
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ static void createPHIsForSplitLoopExit(ArrayRef<BasicBlock *> Preds,
|
|||
}
|
||||
|
||||
BasicBlock *
|
||||
llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
|
||||
llvm::SplitCriticalEdge(Instruction *TI, unsigned SuccNum,
|
||||
const CriticalEdgeSplittingOptions &Options) {
|
||||
if (!isCriticalEdge(TI, SuccNum, Options.MergeIdenticalEdges))
|
||||
return nullptr;
|
||||
|
|
Loading…
Reference in New Issue