Debug Info: Don't bother emitting DW_AT_frame_base if the function has

no frame register. "Tested" via an assertion triggered by DwarfExpression.

llvm-svn: 225858
This commit is contained in:
Adrian Prantl 2015-01-14 00:15:16 +00:00
parent 1411577ad9
commit 8efadbf868
1 changed files with 2 additions and 1 deletions

View File

@ -295,6 +295,7 @@ DIE &DwarfCompileUnit::updateSubprogramScopeDIE(DISubprogram SP) {
const TargetRegisterInfo *RI = const TargetRegisterInfo *RI =
Asm->TM.getSubtargetImpl()->getRegisterInfo(); Asm->TM.getSubtargetImpl()->getRegisterInfo();
MachineLocation Location(RI->getFrameRegister(*Asm->MF)); MachineLocation Location(RI->getFrameRegister(*Asm->MF));
if (RI->isPhysicalRegister(Location.getReg()))
addAddress(*SPDie, dwarf::DW_AT_frame_base, Location); addAddress(*SPDie, dwarf::DW_AT_frame_base, Location);
} }