diff options
author | Eric Christopher <echristo@gmail.com> | 2014-01-14 22:44:17 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-01-14 22:44:17 +0000 |
commit | 6389abdd02bd3d7749770104c99fca76a80c9115 (patch) | |
tree | 4de2e5584d3a83b4bd945dd54f5b5e2a811c08d3 | |
parent | b59bdadd34203cb73055a059a4cc6f3950dd6c25 (diff) | |
download | llvm-6389abdd02bd3d7749770104c99fca76a80c9115.tar.gz llvm-6389abdd02bd3d7749770104c99fca76a80c9115.tar.bz2 llvm-6389abdd02bd3d7749770104c99fca76a80c9115.tar.xz |
Enable use of ranges for translation units in the presence of
-ffunction-sections and update comments and TODOs about other
places that we should enable this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199263 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index f2cc172efa..c895f17931 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1050,13 +1050,15 @@ void DwarfDebug::finalizeModuleInfo() { dwarf::DW_FORM_data8, ID); } - // If we've requested ranges and have them emit a DW_AT_ranges attribute - // on the unit that will remain in the .o file, otherwise add a - // DW_AT_low_pc. + // If we have code split among multiple sections or we've requested + // it then emit a DW_AT_ranges attribute on the unit that will remain + // in the .o file, otherwise add a DW_AT_low_pc. // FIXME: Also add a high pc if we can. - // FIXME: We should use ranges if we have multiple compile units. + // 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 && TheU->getRanges().size()) + if ((DwarfCURanges || TargetMachine::getFunctionSections()) && + TheU->getRanges().size()) addSectionLabel(Asm, U, U->getUnitDie(), dwarf::DW_AT_ranges, Asm->GetTempSymbol("cu_ranges", U->getUniqueID()), DwarfDebugRangeSectionSym); |