summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
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
commit24ec85689bb23dc22b87dfd50862c201328511b0 (patch)
tree45d1b59a6e2eece305b526d8e809590fe49004f5 /llvm/lib/Target
parent153cb8d18a49e76216a6eb8fe5e6ff656f2939ab (diff)
downloadbcm5719-llvm-24ec85689bb23dc22b87dfd50862c201328511b0.tar.gz
bcm5719-llvm-24ec85689bb23dc22b87dfd50862c201328511b0.zip
Update the machine-CFG edges whenever we see a branch.
llvm-svn: 13211
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/InstSelectSimple.cpp5
1 files changed, 5 insertions, 0 deletions
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?
OpenPOWER on IntegriCloud