diff options
| author | Adrian Prantl <aprantl@apple.com> | 2015-01-13 23:39:15 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2015-01-13 23:39:15 +0000 |
| commit | e8e0bac270b6e6da76b7ae9f153cefe3bd15597b (patch) | |
| tree | 06d164331f8234ede5092f72b88e672987f9a883 | |
| parent | 092d9489ede3c8cfc4f7c6d56f3c61fa13f1056c (diff) | |
| download | bcm5719-llvm-e8e0bac270b6e6da76b7ae9f153cefe3bd15597b.tar.gz bcm5719-llvm-e8e0bac270b6e6da76b7ae9f153cefe3bd15597b.zip | |
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
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp index 4c16ae70d1f..26c2a20dea1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp @@ -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. |

