diff options
Diffstat (limited to 'lib/CodeGen/MachineVerifier.cpp')
| -rw-r--r-- | lib/CodeGen/MachineVerifier.cpp | 20 | 
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp index 7351119f4728..f95f4112aeda 100644 --- a/lib/CodeGen/MachineVerifier.cpp +++ b/lib/CodeGen/MachineVerifier.cpp @@ -402,6 +402,11 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) {    SmallVector<MachineOperand, 4> Cond;    if (!TII->AnalyzeBranch(*const_cast<MachineBasicBlock *>(MBB),                            TBB, FBB, Cond)) { +    // If the block branches directly to a landing pad successor, pretend that +    // the landing pad is a normal block. +    LandingPadSuccs.erase(TBB); +    LandingPadSuccs.erase(FBB); +      // Ok, AnalyzeBranch thinks it knows what's going on with this block. Let's      // check whether its answers match up with reality.      if (!TBB && !FBB) { @@ -602,9 +607,7 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {      // Check Live Variables.      if (MI->isDebugValue()) {        // Liveness checks are not valid for debug values. -    } else if (MO->isUndef()) { -      // An <undef> doesn't refer to any register, so just skip it. -    } else if (MO->isUse()) { +    } else if (MO->isUse() && !MO->isUndef()) {        regsLiveInButUnused.erase(Reg);        bool isKill = false; @@ -612,13 +615,9 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {        if (MI->isRegTiedToDefOperand(MONum, &defIdx)) {          // A two-addr use counts as a kill if use and def are the same.          unsigned DefReg = MI->getOperand(defIdx).getReg(); -        if (Reg == DefReg) { +        if (Reg == DefReg)            isKill = true; -          // And in that case an explicit kill flag is not allowed. -          if (MO->isKill()) -            report("Illegal kill flag on two-address instruction operand", -                   MO, MONum); -        } else if (TargetRegisterInfo::isPhysicalRegister(Reg)) { +        else if (TargetRegisterInfo::isPhysicalRegister(Reg)) {            report("Two-address instruction operands must be identical",                   MO, MONum);          } @@ -675,8 +674,7 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {              MInfo.vregsLiveIn.insert(std::make_pair(Reg, MI));          }        } -    } else { -      assert(MO->isDef()); +    } else if (MO->isDef()) {        // Register defined.        // TODO: verify that earlyclobber ops are not used.        if (MO->isDead())  | 
