MC CFG: Don't insert preds/succs again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188874 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ahmed Bougacha 2013-08-21 07:27:50 +00:00
parent 3ec498faad
commit dca54eab53

View File

@ -37,7 +37,8 @@ MCBasicBlock::MCBasicBlock(const MCTextAtom &Insts, MCFunction *Parent)
{}
void MCBasicBlock::addSuccessor(const MCBasicBlock *MCBB) {
Successors.push_back(MCBB);
if (!isSuccessor(MCBB))
Successors.push_back(MCBB);
}
bool MCBasicBlock::isSuccessor(const MCBasicBlock *MCBB) const {
@ -46,7 +47,8 @@ bool MCBasicBlock::isSuccessor(const MCBasicBlock *MCBB) const {
}
void MCBasicBlock::addPredecessor(const MCBasicBlock *MCBB) {
Predecessors.push_back(MCBB);
if (!isPredecessor(MCBB))
Predecessors.push_back(MCBB);
}
bool MCBasicBlock::isPredecessor(const MCBasicBlock *MCBB) const {