Debug Info: Bail out of AddMachineRegPiece() if MachineReg is not a

physical register. The call to getMinimalPhysRegClass() later on asserts
on this condition.

llvm-svn: 225852
This commit is contained in:
Adrian Prantl 2015-01-13 23:39:15 +00:00
parent 092d9489ed
commit e8e0bac270
1 changed files with 6 additions and 0 deletions

View File

@ -93,6 +93,12 @@ void DwarfExpression::AddMachineRegPiece(unsigned MachineReg,
unsigned PieceSizeInBits,
unsigned PieceOffsetInBits) {
const TargetRegisterInfo *TRI = getTRI();
if (!TRI->isPhysicalRegister(MachineReg)) {
// FIXME: We have no reasonable way of handling errors in here.
EmitOp(dwarf::DW_OP_nop, "nop (could not find a dwarf register number)");
return;
}
int Reg = TRI->getDwarfRegNum(MachineReg, false);
// If this is a valid register number, emit it.