Fix crash in machine verifier when trying to print the def of a register which has no def

llvm-svn: 160531
This commit is contained in:
Pete Cooper 2012-07-19 23:40:38 +00:00
parent 3136cf9d5b
commit dcf94db677
1 changed files with 2 additions and 0 deletions

View File

@ -837,6 +837,8 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) {
// Reserved registers may be used even when 'dead'.
if (!isReserved(Reg))
report("Using an undefined physical register", MO, MONum);
} else if (MRI->def_empty(Reg)) {
report("Reading virtual register without a def", MO, MONum);
} else {
BBInfo &MInfo = MBBInfoMap[MI->getParent()];
// We don't know which virtual registers are live in, so only complain