X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FAsmPrinter%2FDwarfDebug.cpp;h=882720fcae6badceb53d7b2c0330cdf7154ce5af;hb=f7952d3a5f294b2c4a9e59e06edc927fddf37e78;hp=7abd2f1dc73018e69047220a80e03c7fdc63e9cb;hpb=34fa5640b805e6bc7a8259e181eed64051c09b4e;p=oota-llvm.git diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 7abd2f1dc73..882720fcae6 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -413,8 +413,11 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU, } SPCU->addLabelAddress(SPDie, dwarf::DW_AT_low_pc, FunctionBeginSym); - SPCU->addLabelDelta(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym, - FunctionBeginSym); + if (DwarfVersion < 4 || Triple(Asm->getTargetTriple()).isOSDarwin()) + SPCU->addLabelAddress(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym); + else + SPCU->addLabelDelta(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym, + FunctionBeginSym); const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo(); MachineLocation Location(RI->getFrameRegister(*Asm->MF)); @@ -1607,7 +1610,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { History.push_back(MI); } else { // Not a DBG_VALUE instruction. - if (!MI->isLabel()) + if (!MI->isPosition()) AtBlockEntry = false; // First known non-DBG_VALUE and non-frame setup location marks