diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2013-08-21 07:27:50 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2013-08-21 07:27:50 +0000 |
commit | dca54eab53fe5d6d203adaa5ea3004586fc3c093 (patch) | |
tree | 95ef6c707166c1a5f31a7db4cbd684ab5be56724 | |
parent | 3ec498faad21e4e6aac5af2b5a3f8e244bd6d874 (diff) | |
download | external_llvm-dca54eab53fe5d6d203adaa5ea3004586fc3c093.zip external_llvm-dca54eab53fe5d6d203adaa5ea3004586fc3c093.tar.gz external_llvm-dca54eab53fe5d6d203adaa5ea3004586fc3c093.tar.bz2 |
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
-rw-r--r-- | lib/MC/MCFunction.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/MC/MCFunction.cpp b/lib/MC/MCFunction.cpp index 2665d3e..473d07b 100644 --- a/lib/MC/MCFunction.cpp +++ b/lib/MC/MCFunction.cpp @@ -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 { |