X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=lib%2FCodeGen%2FAsmPrinter%2FDwarfDebug.cpp;h=d30be28236127cd930e902bbbee03fcee6da641e;hb=27cfb7a41d02e2f36f9dbcd467b557116c86c3f0;hp=943bb43d02b05caf26a579d46ae5f326bd652005;hpb=7cf97649660c15c81ce7dfdd4eed564297e15bde;p=oota-llvm.git diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 943bb43d02b..d30be282361 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -23,10 +23,10 @@ #include "llvm/ADT/Triple.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" -#include "llvm/DebugInfo.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DIBuilder.h" #include "llvm/IR/DataLayout.h" +#include "llvm/IR/DebugInfo.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" #include "llvm/IR/ValueHandle.h" @@ -733,13 +733,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 @@ -2310,10 +2304,10 @@ void DwarfDebug::emitDebugPubNames(bool GnuStyle) { GnuStyle ? Asm->getObjFileLowering().getDwarfGnuPubNamesSection() : Asm->getObjFileLowering().getDwarfPubNamesSection(); - DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder; - const SmallVectorImpl &Units = Holder.getUnits(); - for (unsigned i = 0; i != Units.size(); ++i) { - DwarfUnit *TheU = Units[i]; + for (const auto &NU : CUMap) { + DwarfCompileUnit *TheU = NU.second; + if (auto Skeleton = static_cast(TheU->getSkeleton())) + TheU = Skeleton; unsigned ID = TheU->getUniqueID(); // Start the dwarf pubnames section. @@ -2374,10 +2368,10 @@ void DwarfDebug::emitDebugPubTypes(bool GnuStyle) { GnuStyle ? Asm->getObjFileLowering().getDwarfGnuPubTypesSection() : Asm->getObjFileLowering().getDwarfPubTypesSection(); - DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder; - const SmallVectorImpl &Units = Holder.getUnits(); - for (unsigned i = 0; i != Units.size(); ++i) { - DwarfUnit *TheU = Units[i]; + for (const auto &NU : CUMap) { + DwarfCompileUnit *TheU = NU.second; + if (auto Skeleton = static_cast(TheU->getSkeleton())) + TheU = Skeleton; unsigned ID = TheU->getUniqueID(); // Start the dwarf pubtypes section. @@ -2532,11 +2526,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()) {