[llvm] r188874 - MC CFG: Don't insert preds/succs again.

Ahmed Bougacha ahmed.bougacha at gmail.com
Wed Aug 21 00:27:51 PDT 2013


Author: ab
Date: Wed Aug 21 02:27:50 2013
New Revision: 188874

URL: http://llvm.org/viewvc/llvm-project?rev=188874&view=rev
Log:
MC CFG: Don't insert preds/succs again.

Modified:
    llvm/trunk/lib/MC/MCFunction.cpp

Modified: llvm/trunk/lib/MC/MCFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCFunction.cpp?rev=188874&r1=188873&r2=188874&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCFunction.cpp (original)
+++ llvm/trunk/lib/MC/MCFunction.cpp Wed Aug 21 02:27:50 2013
@@ -37,7 +37,8 @@ MCBasicBlock::MCBasicBlock(const MCTextA
 {}
 
 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 MCB
 }
 
 void MCBasicBlock::addPredecessor(const MCBasicBlock *MCBB) {
-  Predecessors.push_back(MCBB);
+  if (!isPredecessor(MCBB))
+    Predecessors.push_back(MCBB);
 }
 
 bool MCBasicBlock::isPredecessor(const MCBasicBlock *MCBB) const {





More information about the llvm-commits mailing list