X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FAsmPrinter%2FDwarfDebug.cpp;h=882720fcae6badceb53d7b2c0330cdf7154ce5af;hb=f7952d3a5f294b2c4a9e59e06edc927fddf37e78;hp=6404e4b52299b083fde70d83a033492f9b008652;hpb=4b2ab80c3ebd3bd8214ee0ca6d991d6c691c63a8;p=oota-llvm.git diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 6404e4b5229..882720fcae6 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -413,7 +413,11 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU, } SPCU->addLabelAddress(SPDie, dwarf::DW_AT_low_pc, FunctionBeginSym); - SPCU->addLabelAddress(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym); + 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)); @@ -733,13 +737,7 @@ void DwarfDebug::addGnuPubAttributes(DwarfUnit *U, DIE *D) const { if (!GenerateGnuPubSections) return; - addSectionLabel(Asm, U, D, dwarf::DW_AT_GNU_pubnames, - Asm->GetTempSymbol("gnu_pubnames", U->getUniqueID()), - DwarfGnuPubNamesSectionSym); - - addSectionLabel(Asm, U, D, dwarf::DW_AT_GNU_pubtypes, - Asm->GetTempSymbol("gnu_pubtypes", U->getUniqueID()), - DwarfGnuPubTypesSectionSym); + U->addFlag(D, dwarf::DW_AT_GNU_pubnames); } // Create new DwarfCompileUnit for the given metadata node with tag @@ -1612,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 @@ -2532,11 +2530,11 @@ void DwarfDebug::emitDebugLoc() { unsigned char Size = Asm->getDataLayout().getPointerSize(); Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_loc", 0)); unsigned index = 1; - for (SmallVectorImpl::iterator + for (SmallVectorImpl::const_iterator I = DotDebugLocEntries.begin(), E = DotDebugLocEntries.end(); I != E; ++I, ++index) { - DotDebugLocEntry &Entry = *I; + const DotDebugLocEntry &Entry = *I; if (Entry.isMerged()) continue; if (Entry.isEmpty()) {