mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
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
This commit is contained in:
@ -1295,6 +1295,11 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) {
|
|||||||
/// just make a fall-through (but we don't currently).
|
/// just make a fall-through (but we don't currently).
|
||||||
///
|
///
|
||||||
void ISel::visitBranchInst(BranchInst &BI) {
|
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
|
BasicBlock *NextBB = getBlockAfter(BI.getParent()); // BB after current one
|
||||||
|
|
||||||
if (!BI.isConditional()) { // Unconditional branch?
|
if (!BI.isConditional()) { // Unconditional branch?
|
||||||
|
@ -1295,6 +1295,11 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) {
|
|||||||
/// just make a fall-through (but we don't currently).
|
/// just make a fall-through (but we don't currently).
|
||||||
///
|
///
|
||||||
void ISel::visitBranchInst(BranchInst &BI) {
|
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
|
BasicBlock *NextBB = getBlockAfter(BI.getParent()); // BB after current one
|
||||||
|
|
||||||
if (!BI.isConditional()) { // Unconditional branch?
|
if (!BI.isConditional()) { // Unconditional branch?
|
||||||
|
Reference in New Issue
Block a user