Skip to content

Commit

Permalink
fix accidentally inverted conditional and add comment.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79312 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Aug 18, 2009
1 parent a006d4e commit b49a30c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/CodeGen/MachineBasicBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() {
return I;
}

/// isOnlyReachableViaFallthough - Return true if this basic block has
/// exactly one predecessor and the control transfer mechanism between
/// the predecessor and this block is a fall-through.
bool MachineBasicBlock::isOnlyReachableByFallthrough() const {
// If this is a landing pad, it isn't a fall through. If it has no preds,
// then nothing falls through to it.
Expand All @@ -152,7 +155,7 @@ bool MachineBasicBlock::isOnlyReachableByFallthrough() const {

// Otherwise, check the last instruction.
const MachineInstr &LastInst = Pred->back();
return LastInst.getDesc().isBarrier();
return !LastInst.getDesc().isBarrier();
}

void MachineBasicBlock::dump() const {
Expand Down

0 comments on commit b49a30c

Please sign in to comment.