diff options
author | Eric Christopher <echristo@gmail.com> | 2014-01-15 00:04:29 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-01-15 00:04:29 +0000 |
commit | 1ad8457570e8641f9729b8cd45d2468bea59a754 (patch) | |
tree | d861d4a0767e8bcb390f5a91cc7e1481f1163ce8 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | e9fab9b0778b2df4480d9cd7fa0d2a3ac4c8bfac (diff) | |
download | bcm5719-llvm-1ad8457570e8641f9729b8cd45d2468bea59a754.tar.gz bcm5719-llvm-1ad8457570e8641f9729b8cd45d2468bea59a754.zip |
Make sure we emit a relocation to the debug_ranges section in the
presence of CU ranges.
llvm-svn: 199276
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index c895f17931d..f76e898cfb5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -209,6 +209,10 @@ 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()); @@ -1057,8 +1061,7 @@ void DwarfDebug::finalizeModuleInfo() { // FIXME: We should use ranges if we have multiple compile units or // allow reordering of code ala .subsections_via_symbols in mach-o. DwarfCompileUnit *U = SkCU ? SkCU : static_cast<DwarfCompileUnit *>(TheU); - if ((DwarfCURanges || TargetMachine::getFunctionSections()) && - TheU->getRanges().size()) + if (useCURanges() && TheU->getRanges().size()) addSectionLabel(Asm, U, U->getUnitDie(), dwarf::DW_AT_ranges, Asm->GetTempSymbol("cu_ranges", U->getUniqueID()), DwarfDebugRangeSectionSym); @@ -2910,7 +2913,7 @@ void DwarfDebug::emitDebugRanges() { } // Now emit a range for the CU itself. - if (DwarfCURanges) { + if (useCURanges()) { Asm->OutStreamer.EmitLabel( Asm->GetTempSymbol("cu_ranges", TheCU->getUniqueID())); const SmallVectorImpl<RangeSpan> &Ranges = TheCU->getRanges(); |