[llvm] r225852 - Debug Info: Bail out of AddMachineRegPiece() if MachineReg is not a
Adrian Prantl
aprantl at apple.com
Tue Jan 13 15:39:15 PST 2015
Author: adrian
Date: Tue Jan 13 17:39:15 2015
New Revision: 225852
URL: http://llvm.org/viewvc/llvm-project?rev=225852&view=rev
Log:
Debug Info: Bail out of AddMachineRegPiece() if MachineReg is not a
physical register. The call to getMinimalPhysRegClass() later on asserts
on this condition.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp?rev=225852&r1=225851&r2=225852&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp Tue Jan 13 17:39:15 2015
@@ -93,6 +93,12 @@ void DwarfExpression::AddMachineRegPiece
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.
More information about the llvm-commits
mailing list