From 24ec85689bb23dc22b87dfd50862c201328511b0 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Wed, 28 Apr 2004 04:19:37 +0000 Subject: Update the machine-CFG edges whenever we see a branch. llvm-svn: 13211 --- llvm/lib/Target/X86/InstSelectSimple.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Target/X86/InstSelectSimple.cpp') diff --git a/llvm/lib/Target/X86/InstSelectSimple.cpp b/llvm/lib/Target/X86/InstSelectSimple.cpp index 0715e20c325..8617f0662cc 100644 --- a/llvm/lib/Target/X86/InstSelectSimple.cpp +++ b/llvm/lib/Target/X86/InstSelectSimple.cpp @@ -1295,6 +1295,11 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) { /// just make a fall-through (but we don't currently). /// void ISel::visitBranchInst(BranchInst &BI) { + // Update machine-CFG edges + BB->addSuccessor (MBBMap[BI.getSuccessor(0)]); + if (BI.isConditional()) + BB->addSuccessor (MBBMap[BI.getSuccessor(1)]); + BasicBlock *NextBB = getBlockAfter(BI.getParent()); // BB after current one if (!BI.isConditional()) { // Unconditional branch? -- cgit v1.2.3