Debug Info: Don't bother emitting DW_AT_frame_base if the function has
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfCompileUnit.cpp
index 6901d2290e27590fcc03554c684e4c9d170a6ee2..fe01980c812f71b68ee1305ec9ecad0fe99a57ed 100644 (file)
@@ -295,7 +295,8 @@ DIE &DwarfCompileUnit::updateSubprogramScopeDIE(DISubprogram SP) {
     const TargetRegisterInfo *RI =
         Asm->TM.getSubtargetImpl()->getRegisterInfo();
     MachineLocation Location(RI->getFrameRegister(*Asm->MF));
-    addAddress(*SPDie, dwarf::DW_AT_frame_base, Location);
+    if (RI->isPhysicalRegister(Location.getReg()))
+      addAddress(*SPDie, dwarf::DW_AT_frame_base, Location);
   }
 
   // Add name to the name table, we do this here because we're guaranteed