X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FMachineBasicBlock.cpp;h=1d68d7cd2b9dc541e2ad294da7d323c715f6f6a8;hb=236aa8a5032282d8793b537c0f3f7ffb381a83d4;hp=5cfeeb63a756af8e8989f5d9cdbff577b0eaf6e2;hpb=fed90b6d097d50881afb45e4d79f430db66dd741;p=oota-llvm.git diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 5cfeeb63a75..1d68d7cd2b9 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -221,7 +221,7 @@ MachineBasicBlock::succ_iterator MachineBasicBlock::removeSuccessor(succ_iterator I) { assert(I != Successors.end() && "Not a current successor!"); (*I)->removePredecessor(this); - return(Successors.erase(I)); + return Successors.erase(I); } void MachineBasicBlock::addPredecessor(MachineBasicBlock *pred) { @@ -254,6 +254,11 @@ bool MachineBasicBlock::isSuccessor(MachineBasicBlock *MBB) const { return I != Successors.end(); } +bool MachineBasicBlock::isLayoutSuccessor(MachineBasicBlock *MBB) const { + MachineFunction::const_iterator I(this); + return next(I) == MachineFunction::const_iterator(MBB); +} + /// removeFromParent - This method unlinks 'this' from the containing function, /// and returns it, but does not delete it. MachineBasicBlock *MachineBasicBlock::removeFromParent() { @@ -285,7 +290,8 @@ void MachineBasicBlock::ReplaceUsesOfBlockWith(MachineBasicBlock *Old, // Scan the operands of this machine instruction, replacing any uses of Old // with New. for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) - if (I->getOperand(i).isMBB() && I->getOperand(i).getMBB() == Old) + if (I->getOperand(i).isMBB() && + I->getOperand(i).getMBB() == Old) I->getOperand(i).setMBB(New); }