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 | d6351e76d53bfb9d6be9487a394b8a5b75a28e42 (patch) | |
| tree | a03c1a21d8d44608c97eb2982ae3103111a56efa | |
| parent | c43aa4e88c4439a9ef28425189ad31bc74007bcf (diff) | |
| download | bcm5719-llvm-d6351e76d53bfb9d6be9487a394b8a5b75a28e42.tar.gz bcm5719-llvm-d6351e76d53bfb9d6be9487a394b8a5b75a28e42.zip | |
MC CFG: Don't insert preds/succs again.
llvm-svn: 188874
| -rw-r--r-- | llvm/lib/MC/MCFunction.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCFunction.cpp b/llvm/lib/MC/MCFunction.cpp index 2665d3e167b..473d07bf994 100644 --- a/llvm/lib/MC/MCFunction.cpp +++ b/llvm/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 { |

