mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-12 02:47:10 +00:00
Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
use it instead of duplicating its functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51499 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ee335e35ac
commit
02dea8b39f
@ -7,8 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// This file contains the declaration of the BasicBlock class.
|
// This file contains the declaration of the BasicBlock class.
|
||||||
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#ifndef LLVM_BASICBLOCK_H
|
#ifndef LLVM_BASICBLOCK_H
|
||||||
@ -106,6 +106,9 @@ public:
|
|||||||
/// the first instruction, which might be PHI.
|
/// the first instruction, which might be PHI.
|
||||||
/// Returns 0 is there's no non-PHI instruction.
|
/// Returns 0 is there's no non-PHI instruction.
|
||||||
Instruction* getFirstNonPHI();
|
Instruction* getFirstNonPHI();
|
||||||
|
const Instruction* getFirstNonPHI() const {
|
||||||
|
return const_cast<BasicBlock*>(this)->getFirstNonPHI();
|
||||||
|
}
|
||||||
|
|
||||||
/// removeFromParent - This method unlinks 'this' from the containing
|
/// removeFromParent - This method unlinks 'this' from the containing
|
||||||
/// function, but does not delete it.
|
/// function, but does not delete it.
|
||||||
|
@ -100,8 +100,8 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName,
|
|||||||
void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
|
void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
|
||||||
GlobalValue *CounterArray) {
|
GlobalValue *CounterArray) {
|
||||||
// Insert the increment after any alloca or PHI instructions...
|
// Insert the increment after any alloca or PHI instructions...
|
||||||
BasicBlock::iterator InsertPos = BB->begin();
|
BasicBlock::iterator InsertPos = BB->getFirstNonPHI();
|
||||||
while (isa<AllocaInst>(InsertPos) || isa<PHINode>(InsertPos))
|
while (isa<AllocaInst>(InsertPos))
|
||||||
++InsertPos;
|
++InsertPos;
|
||||||
|
|
||||||
// Create the getelementptr constant expression
|
// Create the getelementptr constant expression
|
||||||
|
@ -265,14 +265,11 @@ void GlobalRandomCounterOpt::PrepFunction(Function* F) {
|
|||||||
new StoreInst(l, Counter, bib);
|
new StoreInst(l, Counter, bib);
|
||||||
|
|
||||||
BasicBlock* bb = cast<InvokeInst>(bib)->getNormalDest();
|
BasicBlock* bb = cast<InvokeInst>(bib)->getNormalDest();
|
||||||
BasicBlock::iterator i = bb->begin();
|
BasicBlock::iterator i = bb->getFirstNonPHI();
|
||||||
while (isa<PHINode>(i))
|
|
||||||
++i;
|
|
||||||
l = new LoadInst(Counter, "counter", i);
|
l = new LoadInst(Counter, "counter", i);
|
||||||
|
|
||||||
bb = cast<InvokeInst>(bib)->getUnwindDest();
|
bb = cast<InvokeInst>(bib)->getUnwindDest();
|
||||||
i = bb->begin();
|
i = bb->getFirstNonPHI();
|
||||||
while (isa<PHINode>(i)) ++i;
|
|
||||||
l = new LoadInst(Counter, "counter", i);
|
l = new LoadInst(Counter, "counter", i);
|
||||||
new StoreInst(l, AI, i);
|
new StoreInst(l, AI, i);
|
||||||
} else if (isa<UnwindInst>(&*bib) || isa<ReturnInst>(&*bib)) {
|
} else if (isa<UnwindInst>(&*bib) || isa<ReturnInst>(&*bib)) {
|
||||||
@ -343,8 +340,8 @@ bool RSProfilers_std::isProfiling(Value* v) {
|
|||||||
void RSProfilers_std::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
|
void RSProfilers_std::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
|
||||||
GlobalValue *CounterArray) {
|
GlobalValue *CounterArray) {
|
||||||
// Insert the increment after any alloca or PHI instructions...
|
// Insert the increment after any alloca or PHI instructions...
|
||||||
BasicBlock::iterator InsertPos = BB->begin();
|
BasicBlock::iterator InsertPos = BB->getFirstNonPHI();
|
||||||
while (isa<AllocaInst>(InsertPos) || isa<PHINode>(InsertPos))
|
while (isa<AllocaInst>(InsertPos))
|
||||||
++InsertPos;
|
++InsertPos;
|
||||||
|
|
||||||
// Create the getelementptr constant expression
|
// Create the getelementptr constant expression
|
||||||
|
@ -385,8 +385,7 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){
|
|||||||
CastInst *&InsertedCast = InsertedCasts[UserBB];
|
CastInst *&InsertedCast = InsertedCasts[UserBB];
|
||||||
|
|
||||||
if (!InsertedCast) {
|
if (!InsertedCast) {
|
||||||
BasicBlock::iterator InsertPt = UserBB->begin();
|
BasicBlock::iterator InsertPt = UserBB->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPt)) ++InsertPt;
|
|
||||||
|
|
||||||
InsertedCast =
|
InsertedCast =
|
||||||
CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "",
|
CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "",
|
||||||
@ -443,8 +442,7 @@ static bool OptimizeCmpExpression(CmpInst *CI){
|
|||||||
CmpInst *&InsertedCmp = InsertedCmps[UserBB];
|
CmpInst *&InsertedCmp = InsertedCmps[UserBB];
|
||||||
|
|
||||||
if (!InsertedCmp) {
|
if (!InsertedCmp) {
|
||||||
BasicBlock::iterator InsertPt = UserBB->begin();
|
BasicBlock::iterator InsertPt = UserBB->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPt)) ++InsertPt;
|
|
||||||
|
|
||||||
InsertedCmp =
|
InsertedCmp =
|
||||||
CmpInst::Create(CI->getOpcode(), CI->getPredicate(), CI->getOperand(0),
|
CmpInst::Create(CI->getOpcode(), CI->getPredicate(), CI->getOperand(0),
|
||||||
@ -1039,8 +1037,7 @@ bool CodeGenPrepare::OptimizeExtUses(Instruction *I) {
|
|||||||
Instruction *&InsertedTrunc = InsertedTruncs[UserBB];
|
Instruction *&InsertedTrunc = InsertedTruncs[UserBB];
|
||||||
|
|
||||||
if (!InsertedTrunc) {
|
if (!InsertedTrunc) {
|
||||||
BasicBlock::iterator InsertPt = UserBB->begin();
|
BasicBlock::iterator InsertPt = UserBB->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPt)) ++InsertPt;
|
|
||||||
|
|
||||||
InsertedTrunc = new TruncInst(I, Src->getType(), "", InsertPt);
|
InsertedTrunc = new TruncInst(I, Src->getType(), "", InsertPt);
|
||||||
}
|
}
|
||||||
|
@ -319,8 +319,7 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L) {
|
|||||||
BlockToInsertInto = ExitBlocks[0];
|
BlockToInsertInto = ExitBlocks[0];
|
||||||
else
|
else
|
||||||
BlockToInsertInto = Preheader;
|
BlockToInsertInto = Preheader;
|
||||||
BasicBlock::iterator InsertPt = BlockToInsertInto->begin();
|
BasicBlock::iterator InsertPt = BlockToInsertInto->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPt)) ++InsertPt;
|
|
||||||
|
|
||||||
bool HasConstantItCount = isa<SCEVConstant>(SE->getIterationCount(L));
|
bool HasConstantItCount = isa<SCEVConstant>(SE->getIterationCount(L));
|
||||||
|
|
||||||
@ -535,8 +534,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
// Now that we have a canonical induction variable, we can rewrite any
|
// Now that we have a canonical induction variable, we can rewrite any
|
||||||
// recurrences in terms of the induction variable. Start with the auxillary
|
// recurrences in terms of the induction variable. Start with the auxillary
|
||||||
// induction variables, and recursively rewrite any of their uses.
|
// induction variables, and recursively rewrite any of their uses.
|
||||||
BasicBlock::iterator InsertPt = Header->begin();
|
BasicBlock::iterator InsertPt = Header->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPt)) ++InsertPt;
|
|
||||||
|
|
||||||
// If there were induction variables of other sizes, cast the primary
|
// If there were induction variables of other sizes, cast the primary
|
||||||
// induction variable to the right size for them, avoiding the need for the
|
// induction variable to the right size for them, avoiding the need for the
|
||||||
|
@ -9592,8 +9592,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
|||||||
// If this is an invoke instruction, we should insert it after the first
|
// If this is an invoke instruction, we should insert it after the first
|
||||||
// non-phi, instruction in the normal successor block.
|
// non-phi, instruction in the normal successor block.
|
||||||
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
|
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
|
||||||
BasicBlock::iterator I = II->getNormalDest()->begin();
|
BasicBlock::iterator I = II->getNormalDest()->getFirstNonPHI();
|
||||||
while (isa<PHINode>(I)) ++I;
|
|
||||||
InsertNewInstBefore(NC, *I);
|
InsertNewInstBefore(NC, *I);
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, it's a call, just insert cast right after the call instr
|
// Otherwise, it's a call, just insert cast right after the call instr
|
||||||
@ -11068,8 +11067,7 @@ bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) {
|
|||||||
|
|
||||||
// Advance to a place where it is safe to insert the new store and
|
// Advance to a place where it is safe to insert the new store and
|
||||||
// insert it.
|
// insert it.
|
||||||
BBI = DestBB->begin();
|
BBI = DestBB->getFirstNonPHI();
|
||||||
while (isa<PHINode>(BBI)) ++BBI;
|
|
||||||
InsertNewInstBefore(new StoreInst(MergedVal, SI.getOperand(1),
|
InsertNewInstBefore(new StoreInst(MergedVal, SI.getOperand(1),
|
||||||
OtherStore->isVolatile()), *BBI);
|
OtherStore->isVolatile()), *BBI);
|
||||||
|
|
||||||
@ -11737,8 +11735,7 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicBlock::iterator InsertPos = DestBlock->begin();
|
BasicBlock::iterator InsertPos = DestBlock->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPos)) ++InsertPos;
|
|
||||||
|
|
||||||
I->moveBefore(InsertPos);
|
I->moveBefore(InsertPos);
|
||||||
++NumSunkInst;
|
++NumSunkInst;
|
||||||
|
@ -116,9 +116,8 @@ BasicBlock *JumpThreading::FactorCommonPHIPreds(PHINode *PN, Constant *CstVal) {
|
|||||||
/// getJumpThreadDuplicationCost - Return the cost of duplicating this block to
|
/// getJumpThreadDuplicationCost - Return the cost of duplicating this block to
|
||||||
/// thread across it.
|
/// thread across it.
|
||||||
static unsigned getJumpThreadDuplicationCost(const BasicBlock *BB) {
|
static unsigned getJumpThreadDuplicationCost(const BasicBlock *BB) {
|
||||||
BasicBlock::const_iterator I = BB->begin();
|
|
||||||
/// Ignore PHI nodes, these will be flattened when duplication happens.
|
/// Ignore PHI nodes, these will be flattened when duplication happens.
|
||||||
while (isa<PHINode>(*I)) ++I;
|
BasicBlock::const_iterator I = BB->getFirstNonPHI();
|
||||||
|
|
||||||
// Sum up the cost of each instruction until we get to the terminator. Don't
|
// Sum up the cost of each instruction until we get to the terminator. Don't
|
||||||
// include the terminator because the copy won't include it.
|
// include the terminator because the copy won't include it.
|
||||||
|
@ -472,8 +472,7 @@ void LICM::sink(Instruction &I) {
|
|||||||
// nodes in it.
|
// nodes in it.
|
||||||
I.removeFromParent();
|
I.removeFromParent();
|
||||||
|
|
||||||
BasicBlock::iterator InsertPt = ExitBlocks[0]->begin();
|
BasicBlock::iterator InsertPt = ExitBlocks[0]->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPt)) ++InsertPt;
|
|
||||||
ExitBlocks[0]->getInstList().insert(InsertPt, &I);
|
ExitBlocks[0]->getInstList().insert(InsertPt, &I);
|
||||||
}
|
}
|
||||||
} else if (ExitBlocks.empty()) {
|
} else if (ExitBlocks.empty()) {
|
||||||
@ -542,8 +541,7 @@ void LICM::sink(Instruction &I) {
|
|||||||
// If we haven't already processed this exit block, do so now.
|
// If we haven't already processed this exit block, do so now.
|
||||||
if (InsertedBlocks.insert(ExitBlock).second) {
|
if (InsertedBlocks.insert(ExitBlock).second) {
|
||||||
// Insert the code after the last PHI node...
|
// Insert the code after the last PHI node...
|
||||||
BasicBlock::iterator InsertPt = ExitBlock->begin();
|
BasicBlock::iterator InsertPt = ExitBlock->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPt)) ++InsertPt;
|
|
||||||
|
|
||||||
// If this is the first exit block processed, just move the original
|
// If this is the first exit block processed, just move the original
|
||||||
// instruction, otherwise clone the original instruction and insert
|
// instruction, otherwise clone the original instruction and insert
|
||||||
@ -735,9 +733,7 @@ void LICM::PromoteValuesInLoop() {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Copy all of the allocas into their memory locations.
|
// Copy all of the allocas into their memory locations.
|
||||||
BasicBlock::iterator BI = ExitBlocks[i]->begin();
|
BasicBlock::iterator BI = ExitBlocks[i]->getFirstNonPHI();
|
||||||
while (isa<PHINode>(*BI))
|
|
||||||
++BI; // Skip over all of the phi nodes in the block.
|
|
||||||
Instruction *InsertPos = BI;
|
Instruction *InsertPos = BI;
|
||||||
unsigned PVN = 0;
|
unsigned PVN = 0;
|
||||||
for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) {
|
for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) {
|
||||||
|
@ -256,9 +256,7 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
|
|||||||
// nodes will be created for all getResults later.
|
// nodes will be created for all getResults later.
|
||||||
BasicBlock::iterator InsertPoint;
|
BasicBlock::iterator InsertPoint;
|
||||||
if (InvokeInst *II = dyn_cast<InvokeInst>(In)) {
|
if (InvokeInst *II = dyn_cast<InvokeInst>(In)) {
|
||||||
InsertPoint = II->getNormalDest()->begin();
|
InsertPoint = II->getNormalDest()->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPoint))
|
|
||||||
++InsertPoint;
|
|
||||||
} else {
|
} else {
|
||||||
InsertPoint = I; // call
|
InsertPoint = I; // call
|
||||||
++InsertPoint;
|
++InsertPoint;
|
||||||
|
@ -682,8 +682,7 @@ void LoopUnswitch::SplitExitEdges(Loop *L,
|
|||||||
InsertedPHIs.insert(NewLCSSA);
|
InsertedPHIs.insert(NewLCSSA);
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicBlock::iterator InsertPt = EndBlock->begin();
|
BasicBlock::iterator InsertPt = EndBlock->getFirstNonPHI();
|
||||||
while (dyn_cast<PHINode>(InsertPt)) ++InsertPt;
|
|
||||||
for (BasicBlock::iterator I = MiddleBlock->begin();
|
for (BasicBlock::iterator I = MiddleBlock->begin();
|
||||||
(OldLCSSA = dyn_cast<PHINode>(I)) && InsertedPHIs.count(OldLCSSA) == 0;
|
(OldLCSSA = dyn_cast<PHINode>(I)) && InsertedPHIs.count(OldLCSSA) == 0;
|
||||||
++I) {
|
++I) {
|
||||||
|
@ -118,8 +118,7 @@ bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI,
|
|||||||
++PI;
|
++PI;
|
||||||
if (PI == PE) return false; // Exactly one predecessor!
|
if (PI == PE) return false; // Exactly one predecessor!
|
||||||
|
|
||||||
BasicBlock::iterator I = Dest->begin();
|
BasicBlock::iterator I = Dest->getFirstNonPHI();
|
||||||
while (isa<PHINode>(*I)) ++I;
|
|
||||||
|
|
||||||
for (unsigned Size = 0; I != Dest->end(); ++I) {
|
for (unsigned Size = 0; I != Dest->end(); ++I) {
|
||||||
if (Size == Threshold) return false; // The block is too large.
|
if (Size == Threshold) return false; // The block is too large.
|
||||||
@ -254,8 +253,7 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) {
|
|||||||
// If there are non-phi instructions in DestBlock that have no operands
|
// If there are non-phi instructions in DestBlock that have no operands
|
||||||
// defined in DestBlock, and if the instruction has no side effects, we can
|
// defined in DestBlock, and if the instruction has no side effects, we can
|
||||||
// move the instruction to DomBlock instead of duplicating it.
|
// move the instruction to DomBlock instead of duplicating it.
|
||||||
BasicBlock::iterator BBI = DestBlock->begin();
|
BasicBlock::iterator BBI = DestBlock->getFirstNonPHI();
|
||||||
while (isa<PHINode>(BBI)) ++BBI;
|
|
||||||
while (!isa<TerminatorInst>(BBI)) {
|
while (!isa<TerminatorInst>(BBI)) {
|
||||||
Instruction *I = BBI++;
|
Instruction *I = BBI++;
|
||||||
|
|
||||||
|
@ -126,8 +126,7 @@ void CodeExtractor::severSplitPHINodes(BasicBlock *&Header) {
|
|||||||
// containing PHI nodes merging values from outside of the region, and a
|
// containing PHI nodes merging values from outside of the region, and a
|
||||||
// second that contains all of the code for the block and merges back any
|
// second that contains all of the code for the block and merges back any
|
||||||
// incoming values from inside of the region.
|
// incoming values from inside of the region.
|
||||||
BasicBlock::iterator AfterPHIs = Header->begin();
|
BasicBlock::iterator AfterPHIs = Header->getFirstNonPHI();
|
||||||
while (isa<PHINode>(AfterPHIs)) ++AfterPHIs;
|
|
||||||
BasicBlock *NewBB = Header->splitBasicBlock(AfterPHIs,
|
BasicBlock *NewBB = Header->splitBasicBlock(AfterPHIs,
|
||||||
Header->getName()+".ce");
|
Header->getName()+".ce");
|
||||||
|
|
||||||
|
@ -225,9 +225,7 @@ void LCSSA::getLoopValuesUsedOutsideLoop(Loop *L,
|
|||||||
// immediately here. It will be processed in next iteration.
|
// immediately here. It will be processed in next iteration.
|
||||||
BasicBlock::iterator InsertPoint;
|
BasicBlock::iterator InsertPoint;
|
||||||
if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
|
if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
|
||||||
InsertPoint = II->getNormalDest()->begin();
|
InsertPoint = II->getNormalDest()->getFirstNonPHI();
|
||||||
while (isa<PHINode>(InsertPoint))
|
|
||||||
++InsertPoint;
|
|
||||||
} else {
|
} else {
|
||||||
InsertPoint = I;
|
InsertPoint = I;
|
||||||
InsertPoint++;
|
InsertPoint++;
|
||||||
|
@ -282,8 +282,7 @@ void LowerInvoke::rewriteExpensiveInvoke(InvokeInst *II, unsigned InvokeNo,
|
|||||||
// location afterward.
|
// location afterward.
|
||||||
new StoreInst(InvokeNoC, InvokeNum, true, II); // volatile
|
new StoreInst(InvokeNoC, InvokeNum, true, II); // volatile
|
||||||
|
|
||||||
BasicBlock::iterator NI = II->getNormalDest()->begin();
|
BasicBlock::iterator NI = II->getNormalDest()->getFirstNonPHI();
|
||||||
while (isa<PHINode>(NI)) ++NI;
|
|
||||||
// nonvolatile.
|
// nonvolatile.
|
||||||
new StoreInst(Constant::getNullValue(Type::Int32Ty), InvokeNum, false, NI);
|
new StoreInst(Constant::getNullValue(Type::Int32Ty), InvokeNum, false, NI);
|
||||||
|
|
||||||
|
@ -1493,8 +1493,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||||||
}
|
}
|
||||||
} else if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
|
} else if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
|
||||||
if (BI->isUnconditional()) {
|
if (BI->isUnconditional()) {
|
||||||
BasicBlock::iterator BBI = BB->begin(); // Skip over phi nodes...
|
BasicBlock::iterator BBI = BB->getFirstNonPHI();
|
||||||
while (isa<PHINode>(*BBI)) ++BBI;
|
|
||||||
|
|
||||||
BasicBlock *Succ = BI->getSuccessor(0);
|
BasicBlock *Succ = BI->getSuccessor(0);
|
||||||
if (BBI->isTerminator() && // Terminator is the only non-phi instruction!
|
if (BBI->isTerminator() && // Terminator is the only non-phi instruction!
|
||||||
|
@ -143,15 +143,14 @@ const TerminatorInst *BasicBlock::getTerminator() const {
|
|||||||
return dyn_cast<TerminatorInst>(&InstList.back());
|
return dyn_cast<TerminatorInst>(&InstList.back());
|
||||||
}
|
}
|
||||||
|
|
||||||
Instruction* BasicBlock::getFirstNonPHI()
|
Instruction* BasicBlock::getFirstNonPHI() {
|
||||||
{
|
BasicBlock::iterator i = begin();
|
||||||
BasicBlock::iterator i = begin();
|
// All valid basic blocks should have a terminator,
|
||||||
// All valid basic blocks should have a terminator,
|
// which is not a PHINode. If we have an invalid basic
|
||||||
// which is not a PHINode. If we have invalid basic
|
// block we'll get an assertion failure when dereferencing
|
||||||
// block we'll get assert when dereferencing past-the-end
|
// a past-the-end iterator.
|
||||||
// iterator.
|
while (isa<PHINode>(i)) ++i;
|
||||||
while (isa<PHINode>(i)) ++i;
|
return &*i;
|
||||||
return &*i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasicBlock::dropAllReferences() {
|
void BasicBlock::dropAllReferences() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user