diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 8e612c3e6eb..7ba4fece43b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -179,7 +179,7 @@ static unsigned getDwarfVersionFromModule(const Module *M) { DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) : Asm(A), MMI(Asm->MMI), FirstCU(0), SourceIdMap(DIEValueAllocator), PrevLabel(NULL), GlobalRangeCount(0), - InfoHolder(A, "info_string", DIEValueAllocator), + InfoHolder(A, "info_string", DIEValueAllocator), HasCURanges(false), SkeletonHolder(A, "skel_string", DIEValueAllocator) { DwarfInfoSectionSym = DwarfAbbrevSectionSym = DwarfStrSectionSym = 0; @@ -209,10 +209,6 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) else HasDwarfPubSections = DwarfPubSections == Enable; - // For now only turn on CU ranges if we've explicitly asked for it - // or we have -ffunction-sections enabled. - HasCURanges = DwarfCURanges || TargetMachine::getFunctionSections(); - DwarfVersion = DwarfVersionNumber ? DwarfVersionNumber : getDwarfVersionFromModule(MMI->getModule()); @@ -1126,6 +1122,13 @@ void DwarfDebug::endSections() { // Insert a final terminator. SectionMap[Section].push_back(SymbolCU(NULL, Sym)); } + + // For now only turn on CU ranges if we've explicitly asked for it, + // we have -ffunction-sections enabled, or we've emitted a function + // into a unique section. At this point all sections should be finalized + // except for dwarf sections. + HasCURanges = DwarfCURanges || Asm->TM.debugUseUniqueSections() || + TargetMachine::getFunctionSections(); } // Emit all Dwarf sections that should come after the content. |