[PATCH] D49522: [DWARF v5] Don't emit duplicate DW_AT_rnglists_base and address review comments from previous review

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 11:35:51 PDT 2018


wolfgangp added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2068
 
-void DwarfDebug::emitDebugRnglists() {
-
-  // Don't emit a rangelist table if there are no ranges.
-  if (llvm::all_of(CUMap,
-                   [](const decltype(CUMap)::const_iterator::value_type &Pair) {
-                     DwarfCompileUnit *TheCU = Pair.second;
-                     if (auto *Skel = TheCU->getSkeleton())
-                       TheCU = Skel;
-                     return TheCU->getRangeLists().empty();
-                   }))
-    return;
-
-  assert(getDwarfVersion() >= 5 && "Dwarf version must be 5 or greater");
-  // FIXME: As long as we don't support DW_RLE_base_addrx, we cannot generate
-  // any tables in the .debug_rnglists.dwo section.
-  Asm->OutStreamer->SwitchSection(
-      Asm->getObjFileLowering().getDwarfRnglistsSection());
+static void emitRnglistsTableHeader(AsmPrinter *Asm, DwarfFile &Holder,
+                                    MCSymbol *&TableEnd) {
----------------
JDevlieghere wrote:
> Can we simplify this by returning a `MCSymbol*` instead?
Yes, I was a bit hesitant to return something from a function called 'emit' but it's simpler that way.


https://reviews.llvm.org/D49522





More information about the llvm-commits mailing list