aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/InstSelectSimple.cpp
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-04-28 04:19:37 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-04-28 04:19:37 +0000
commitea9ca673042fdd99eda1dd98a21e6b88832ef6a1 (patch)
tree79e819364e9d683deb5f1c06a7597f87bafc4668 /lib/Target/X86/InstSelectSimple.cpp
parent8560af4f5fe589cf792bd44617c2308c4f087ba8 (diff)
Update the machine-CFG edges whenever we see a branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/InstSelectSimple.cpp')
-rw-r--r--lib/Target/X86/InstSelectSimple.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp
index 0715e20c32..8617f0662c 100644
--- a/lib/Target/X86/InstSelectSimple.cpp
+++ b/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?