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 | 39cde8cc9066be316cd863e95d83ded1492f7c53 (patch) | |
tree | c4617cec3992299cf658d7de75f856c903fb6802 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 4086bf715680ef4ed9f0ecb08da85e6c2493392e (diff) | |
download | bcm5719-llvm-39cde8cc9066be316cd863e95d83ded1492f7c53.tar.gz bcm5719-llvm-39cde8cc9066be316cd863e95d83ded1492f7c53.zip |
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.
llvm-svn: 199263
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index f2cc172efa7..c895f17931d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/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); |