summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-23 16:37:45 +0000
committerChris Lattner <sabre@nondot.org>2003-04-23 16:37:45 +0000
commite408e25132b8de8c757db1e3ddcd70432dfeb24d (patch)
tree629c22dc753c0a18f2188a3089f0a8d19fc73464 /lib
parent2ee82e05e3e41fa23951d3503db5483a36dc3ae3 (diff)
downloadllvm-e408e25132b8de8c757db1e3ddcd70432dfeb24d.tar.gz
llvm-e408e25132b8de8c757db1e3ddcd70432dfeb24d.tar.bz2
llvm-e408e25132b8de8c757db1e3ddcd70432dfeb24d.tar.xz
Remove unnecesary &*'s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp2
-rw-r--r--lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp2
-rw-r--r--lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp2
-rw-r--r--lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp2
-rw-r--r--lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp16
-rw-r--r--lib/Transforms/Instrumentation/TraceValues.cpp6
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp4
-rw-r--r--lib/Transforms/Scalar/CorrelatedExprs.cpp8
-rw-r--r--lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp2
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp2
-rw-r--r--lib/Transforms/Scalar/LICM.cpp4
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp2
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp2
-rw-r--r--lib/Transforms/Utils/BreakCriticalEdges.cpp2
-rw-r--r--lib/Transforms/Utils/LoopSimplify.cpp4
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp4
-rw-r--r--lib/Transforms/Utils/Mem2Reg.cpp2
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp4
-rw-r--r--lib/VMCore/BasicBlock.cpp4
19 files changed, 37 insertions, 37 deletions
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index afa4890f03..a2dbf2ef4c 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -169,7 +169,7 @@ static inline bool ShouldInlineFunction(const CallInst *CI, const Function *F) {
static inline bool DoFunctionInlining(BasicBlock *BB) {
for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) {
- if (CallInst *CI = dyn_cast<CallInst>(&*I)) {
+ if (CallInst *CI = dyn_cast<CallInst>(I)) {
// Check to see if we should inline this function
Function *F = CI->getCalledFunction();
if (F && ShouldInlineFunction(CI, F)) {
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp b/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
index 8fabbc9ca3..61c60ec7c5 100644
--- a/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
+++ b/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
@@ -386,7 +386,7 @@ void insertBB(Edge ed,
for(BasicBlock::iterator BB2Inst = BB2->begin(), BBend = BB2->end();
BB2Inst != BBend; ++BB2Inst){
- if(PHINode *phiInst=dyn_cast<PHINode>(&*BB2Inst)){
+ if(PHINode *phiInst=dyn_cast<PHINode>(BB2Inst)){
int bbIndex=phiInst->getBasicBlockIndex(BB1);
assert(bbIndex>=0);
phiInst->setIncomingBlock(bbIndex, newBB);
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp b/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
index c876238a1e..64075c8024 100644
--- a/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
+++ b/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
@@ -133,7 +133,7 @@ void getBackEdgesVisit(BasicBlock *u,
for(BasicBlock::iterator BB2Inst = BB->begin(), BBend = BB->end();
BB2Inst != BBend; ++BB2Inst){
- if(PHINode *phiInst=dyn_cast<PHINode>(&*BB2Inst)){
+ if (PHINode *phiInst = dyn_cast<PHINode>(BB2Inst)){
int bbIndex = phiInst->getBasicBlockIndex(u);
if(bbIndex>=0){
phiInst->setIncomingBlock(bbIndex, newBB);
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
index 57b17a590f..79b94e8755 100644
--- a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
+++ b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
@@ -87,7 +87,7 @@ bool ProfilePaths::runOnFunction(Function &F){
nodes.push_back(nd);
if(&*BB == ExitNode)
exitNode=nd;
- if(&*BB==F.begin())
+ if(BB==F.begin())
startNode=nd;
}
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp b/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp
index c222bdfb34..805250fd9a 100644
--- a/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp
+++ b/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp
@@ -140,7 +140,7 @@ void getBBtrace(vector<BasicBlock *> &vBB, int pathNo, Function *M){//,
BasicBlock *ExitNode = 0;
for (Function::iterator I = M->begin(), E = M->end(); I != E; ++I){
if (isa<ReturnInst>(I->getTerminator())) {
- ExitNode = &*I;
+ ExitNode = I;
break;
}
}
@@ -160,7 +160,7 @@ void getBBtrace(vector<BasicBlock *> &vBB, int pathNo, Function *M){//,
if(BB->size()==3 || BB->size() ==2){
for(BasicBlock::iterator II = BB->begin(), IE = BB->end();
II != IE; ++II){
- if(CallInst *callInst = dyn_cast<CallInst>(&*II)){
+ if(CallInst *callInst = dyn_cast<CallInst>(II)){
//std::cerr<<*callInst;
Function *calledFunction = callInst->getCalledFunction();
if(calledFunction && calledFunction->getName() == "trigger"){
@@ -199,7 +199,7 @@ void getBBtrace(vector<BasicBlock *> &vBB, int pathNo, Function *M){//,
continue;
//if(BB->size()==3)
- //if(CallInst *callInst = dyn_cast<CallInst>(&*BB->getInstList().begin()))
+ //if(CallInst *callInst = dyn_cast<CallInst>(BB->getInstList().begin()))
//if(callInst->getCalledFunction()->getName() == "trigger")
//continue;
@@ -216,20 +216,20 @@ void getBBtrace(vector<BasicBlock *> &vBB, int pathNo, Function *M){//,
Node *nd=findBB(nodes, BB);
assert(nd && "No node for this edge!");
- for(BasicBlock::succ_iterator s=succ_begin(&*BB), se=succ_end(&*BB);
+ for(BasicBlock::succ_iterator s=succ_begin(BB), se=succ_end(BB);
s!=se; ++s){
if(triggerBBs[*s] == 9){
//if(!pathReg[M]){ //Get the path register for this!
//if(BB->size()>8)
- // if(LoadInst *ldInst = dyn_cast<LoadInst>(&*BB->getInstList().begin()))
+ // if(LoadInst *ldInst = dyn_cast<LoadInst>(BB->getInstList().begin()))
// pathReg[M] = ldInst->getPointerOperand();
//}
continue;
}
//if((*s)->size()==3)
//if(CallInst *callInst =
- // dyn_cast<CallInst>(&*(*s)->getInstList().begin()))
+ // dyn_cast<CallInst>((*s)->getInstList().begin()))
// if(callInst->getCalledFunction()->getName() == "trigger")
// continue;
@@ -284,11 +284,11 @@ void getBBtrace(vector<BasicBlock *> &vBB, int pathNo, Function *M){//,
VBI != VBE; ++VBI){
for(BasicBlock::iterator BBI = (*VBI)->begin(), BBE = (*VBI)->end();
BBI != BBE; ++BBI){
- if(LoadInst *ldInst = dyn_cast<LoadInst>(&*BBI)){
+ if(LoadInst *ldInst = dyn_cast<LoadInst>(BBI)){
if(pathReg[M] == ldInst->getPointerOperand())
instToErase.push_back(ldInst);
}
- else if(StoreInst *stInst = dyn_cast<StoreInst>(&*BBI)){
+ else if(StoreInst *stInst = dyn_cast<StoreInst>(BBI)){
if(pathReg[M] == stInst->getPointerOperand())
instToErase.push_back(stInst);
}
diff --git a/lib/Transforms/Instrumentation/TraceValues.cpp b/lib/Transforms/Instrumentation/TraceValues.cpp
index 75149ce912..499bc4cf9d 100644
--- a/lib/Transforms/Instrumentation/TraceValues.cpp
+++ b/lib/Transforms/Instrumentation/TraceValues.cpp
@@ -298,9 +298,9 @@ ReleasePtrSeqNumbers(BasicBlock *BB,
ExternalFuncs& externalFuncs) {
for (BasicBlock::iterator II=BB->begin(), IE = BB->end(); II != IE; ++II)
- if (FreeInst *FI = dyn_cast<FreeInst>(&*II))
+ if (FreeInst *FI = dyn_cast<FreeInst>(II))
InsertReleaseInst(FI->getOperand(0), BB, FI,externalFuncs.ReleasePtrFunc);
- else if (AllocaInst *AI = dyn_cast<AllocaInst>(&*II))
+ else if (AllocaInst *AI = dyn_cast<AllocaInst>(II))
InsertRecordInst(AI, BB, AI->getNext(), externalFuncs.RecordPtrFunc);
}
@@ -332,7 +332,7 @@ static void TraceValuesAtBBExit(BasicBlock *BB,
// instruction *preceding* InsertPos to check when to terminate the loop.
//
for (BasicBlock::iterator II = BB->begin(); &*II != InsertPos; ++II) {
- if (StoreInst *SI = dyn_cast<StoreInst>(&*II)) {
+ if (StoreInst *SI = dyn_cast<StoreInst>(II)) {
assert(valuesStoredInFunction &&
"Should not be printing a store instruction at function exit");
LoadInst *LI = new LoadInst(SI->getPointerOperand(), "reload." +
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index e7bc1357ff..5e2a2755fb 100644
--- a/lib/Transforms/Scalar/ADCE.cpp
+++ b/lib/Transforms/Scalar/ADCE.cpp
@@ -119,7 +119,7 @@ bool ADCE::dropReferencesOfDeadInstructionsInLiveBlock(BasicBlock *BB) {
for (BasicBlock::iterator I = BB->begin(), E = --BB->end(); I != E; )
if (!LiveSet.count(I)) { // Is this instruction alive?
I->dropAllReferences(); // Nope, drop references...
- if (PHINode *PN = dyn_cast<PHINode>(&*I)) {
+ if (PHINode *PN = dyn_cast<PHINode>(I)) {
// We don't want to leave PHI nodes in the program that have
// #arguments != #predecessors, so we remove them now.
//
@@ -310,7 +310,7 @@ bool ADCE::doADCE() {
// should be identical to the incoming values for LastDead.
//
for (BasicBlock::iterator II = NextAlive->begin();
- PHINode *PN = dyn_cast<PHINode>(&*II); ++II) {
+ PHINode *PN = dyn_cast<PHINode>(II); ++II) {
// Get the incoming value for LastDead...
int OldIdx = PN->getBasicBlockIndex(LastDead);
assert(OldIdx != -1 && "LastDead is not a pred of NextAlive!");
diff --git a/lib/Transforms/Scalar/CorrelatedExprs.cpp b/lib/Transforms/Scalar/CorrelatedExprs.cpp
index cb8bd6109c..c560e83697 100644
--- a/lib/Transforms/Scalar/CorrelatedExprs.cpp
+++ b/lib/Transforms/Scalar/CorrelatedExprs.cpp
@@ -450,11 +450,11 @@ bool CEE::ForwardCorrelatedEdgeDestination(TerminatorInst *TI, unsigned SuccNo,
// Put the newly discovered information into the RegionInfo...
for (BasicBlock::iterator I = OldSucc->begin(), E = OldSucc->end(); I!=E; ++I)
- if (PHINode *PN = dyn_cast<PHINode>(&*I)) {
+ if (PHINode *PN = dyn_cast<PHINode>(I)) {
int OpNum = PN->getBasicBlockIndex(BB);
assert(OpNum != -1 && "PHI doesn't have incoming edge for predecessor!?");
PropagateEquality(PN, PN->getIncomingValue(OpNum), NewRI);
- } else if (SetCondInst *SCI = dyn_cast<SetCondInst>(&*I)) {
+ } else if (SetCondInst *SCI = dyn_cast<SetCondInst>(I)) {
Relation::KnownResult Res = getSetCCResult(SCI, NewRI);
if (Res == Relation::Unknown) return false;
PropagateEquality(SCI, ConstantBool::get(Res), NewRI);
@@ -563,7 +563,7 @@ void CEE::ForwardSuccessorTo(TerminatorInst *TI, unsigned SuccNo,
// node with a new value.
//
for (BasicBlock::iterator I = OldSucc->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ) {
+ PHINode *PN = dyn_cast<PHINode>(I); ) {
// Get the value flowing across the old edge and remove the PHI node entry
// for this edge: we are about to remove the edge! Don't remove the PHI
@@ -993,7 +993,7 @@ void CEE::ComputeReplacements(RegionInfo &RI) {
bool CEE::SimplifyBasicBlock(BasicBlock &BB, const RegionInfo &RI) {
bool Changed = false;
for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ) {
- Instruction *Inst = &*I++;
+ Instruction *Inst = I++;
// Convert instruction arguments to canonical forms...
Changed |= SimplifyInstruction(Inst, RI);
diff --git a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
index d0f47d8b80..65cf465acd 100644
--- a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
+++ b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
@@ -44,7 +44,7 @@ DecomposePass::runOnBasicBlock(BasicBlock &BB)
{
bool changed = false;
for (BasicBlock::iterator II = BB.begin(); II != BB.end(); )
- if (GetElementPtrInst *gep = dyn_cast<GetElementPtrInst>(&*II++)) // pre-inc
+ if (GetElementPtrInst *gep = dyn_cast<GetElementPtrInst>(II++)) // pre-inc
if (gep->getNumIndices() >= 2)
changed |= DecomposeArrayRef(gep); // always modifies II
return changed;
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index ff2b9939c7..993e533abc 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -45,7 +45,7 @@ static bool TransformLoop(LoopInfo *Loops, Loop *Loop) {
//
std::vector<InductionVariable> IndVars; // Induction variables for block
BasicBlock::iterator AfterPHIIt = Header->begin();
- for (; PHINode *PN = dyn_cast<PHINode>(&*AfterPHIIt); ++AfterPHIIt)
+ for (; PHINode *PN = dyn_cast<PHINode>(AfterPHIIt); ++AfterPHIIt)
IndVars.push_back(InductionVariable(PN, Loops));
// AfterPHIIt now points to first nonphi instruction...
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 3df11a5ca2..9069338e32 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -319,12 +319,12 @@ void LICM::PromoteValuesInLoop() {
// Rewrite all loads and stores in the block of the pointer...
for (BasicBlock::iterator II = (*I)->begin(), E = (*I)->end();
II != E; ++II) {
- if (LoadInst *L = dyn_cast<LoadInst>(&*II)) {
+ if (LoadInst *L = dyn_cast<LoadInst>(II)) {
std::map<Value*, AllocaInst*>::iterator
I = ValueToAllocaMap.find(L->getOperand(0));
if (I != ValueToAllocaMap.end())
L->setOperand(0, I->second); // Rewrite load instruction...
- } else if (StoreInst *S = dyn_cast<StoreInst>(&*II)) {
+ } else if (StoreInst *S = dyn_cast<StoreInst>(II)) {
std::map<Value*, AllocaInst*>::iterator
I = ValueToAllocaMap.find(S->getOperand(1));
if (I != ValueToAllocaMap.end())
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index df0a64188f..3414c410ac 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -224,7 +224,7 @@ bool Reassociate::ReassociateBB(BasicBlock *BB) {
// the two operands are sorted incorrectly, fix it now.
//
if (BI->isAssociative()) {
- BinaryOperator *I = cast<BinaryOperator>(&*BI);
+ BinaryOperator *I = cast<BinaryOperator>(BI);
if (!I->use_empty()) {
// Make sure that we don't have a tree-shaped computation. If we do,
// linearize it. Convert (A+B)+(C+D) into ((A+B)+C)+D
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 66818bc3b6..77b41f4e36 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -474,7 +474,7 @@ void SCCP::visitTerminatorInst(TerminatorInst &TI) {
// constant now may not be.
//
for (BasicBlock::iterator I = Succ->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ++I)
+ PHINode *PN = dyn_cast<PHINode>(I); ++I)
visitPHINode(*PN);
}
}
diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp
index c44f9d324e..a87dbce2a0 100644
--- a/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -85,7 +85,7 @@ void SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P) {
// merge incoming values from NewBB instead of from TIBB.
//
for (BasicBlock::iterator I = DestBB->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ++I) {
+ PHINode *PN = dyn_cast<PHINode>(I); ++I) {
// We no longer enter through TIBB, now we come in through NewBB.
PN->replaceUsesOfWith(TIBB, NewBB);
}
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp
index 5a68dda1af..d5988b1652 100644
--- a/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/lib/Transforms/Utils/LoopSimplify.cpp
@@ -132,7 +132,7 @@ BasicBlock *Preheaders::SplitBlockPredecessors(BasicBlock *BB,
//
if (!Preds.empty()) { // Is the loop not obviously dead?
for (BasicBlock::iterator I = BB->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ++I) {
+ PHINode *PN = dyn_cast<PHINode>(I); ++I) {
// Create the new PHI node, insert it into NewBB at the end of the block
PHINode *NewPHI = new PHINode(PN->getType(), PN->getName()+".ph", BI);
@@ -160,7 +160,7 @@ BasicBlock *Preheaders::SplitBlockPredecessors(BasicBlock *BB,
} else { // Otherwise the loop is dead...
for (BasicBlock::iterator I = BB->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ++I)
+ PHINode *PN = dyn_cast<PHINode>(I); ++I)
// Insert dummy values as the incoming value...
PN->addIncoming(Constant::getNullValue(PN->getType()), NewBB);
}
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index 0148134d03..68fb74efaf 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/lib/Transforms/Utils/LowerAllocations.cpp
@@ -85,7 +85,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
// Loop over all of the instructions, looking for malloc or free instructions
for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) {
- if (MallocInst *MI = dyn_cast<MallocInst>(&*I)) {
+ if (MallocInst *MI = dyn_cast<MallocInst>(I)) {
const Type *AllocTy = MI->getType()->getElementType();
// Get the number of bytes to be allocated for one element of the
@@ -114,7 +114,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
I = --BBIL.erase(I); // remove and delete the malloc instr...
Changed = true;
++NumLowered;
- } else if (FreeInst *FI = dyn_cast<FreeInst>(&*I)) {
+ } else if (FreeInst *FI = dyn_cast<FreeInst>(I)) {
// Cast the argument to free into a ubyte*...
CastInst *MCast = new CastInst(FI->getOperand(0),
PointerType::get(Type::UByteTy), "", I);
diff --git a/lib/Transforms/Utils/Mem2Reg.cpp b/lib/Transforms/Utils/Mem2Reg.cpp
index 848c4d6706..6bd859a403 100644
--- a/lib/Transforms/Utils/Mem2Reg.cpp
+++ b/lib/Transforms/Utils/Mem2Reg.cpp
@@ -43,7 +43,7 @@ bool PromotePass::runOnFunction(Function &F) {
// Find allocas that are safe to promote, by looking at all instructions in
// the entry node
for (BasicBlock::iterator I = BB.begin(), E = --BB.end(); I != E; ++I)
- if (AllocaInst *AI = dyn_cast<AllocaInst>(&*I)) // Is it an alloca?
+ if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) // Is it an alloca?
if (isAllocaPromotable(AI, TD))
Allocas.push_back(AI);
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index 25d835684b..e1910446de 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -40,7 +40,7 @@ static bool PropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
// Loop over all of the PHI nodes checking to see if there are
// incompatible values coming in.
for (BasicBlock::iterator I = Succ->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ++I) {
+ PHINode *PN = dyn_cast<PHINode>(I); ++I) {
// Loop up the entries in the PHI node for BB and for *PI if the values
// coming in are non-equal, we cannot merge these two blocks (instead we
// should insert a conditional move or something, then merge the
@@ -56,7 +56,7 @@ static bool PropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
// Loop over all of the PHI nodes in the successor BB
for (BasicBlock::iterator I = Succ->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ++I) {
+ PHINode *PN = dyn_cast<PHINode>(I); ++I) {
Value *OldVal = PN->removeIncomingValue(BB, false);
assert(OldVal && "No entry in PHI for Pred BB!");
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp
index 89f9a27f8d..04f4e1cfc0 100644
--- a/lib/VMCore/BasicBlock.cpp
+++ b/lib/VMCore/BasicBlock.cpp
@@ -196,7 +196,7 @@ void BasicBlock::removePredecessor(BasicBlock *Pred) {
} else {
// Okay, now we know that we need to remove predecessor #pred_idx from all
// PHI nodes. Iterate over each PHI node fixing them up
- for (iterator II = begin(); PHINode *PN = dyn_cast<PHINode>(&*II); ++II)
+ for (iterator II = begin(); PHINode *PN = dyn_cast<PHINode>(II); ++II)
PN->removeIncomingValue(Pred);
}
}
@@ -243,7 +243,7 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I) {
// incoming values...
BasicBlock *Successor = *I;
for (BasicBlock::iterator II = Successor->begin();
- PHINode *PN = dyn_cast<PHINode>(&*II); ++II) {
+ PHINode *PN = dyn_cast<PHINode>(II); ++II) {
int IDX = PN->getBasicBlockIndex(this);
while (IDX != -1) {
PN->setIncomingBlock((unsigned)IDX, New);