[PATCH] D147952: [DWARFLinkerParallel] Add interface files, create a skeleton implementation.

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 07:22:15 PDT 2023


JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM modulo inline comments. They're all nits so feel free to land this once they've been addressed.



================
Comment at: llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h:22-23
+
+/// this class represents DWARF information for source file
+/// and it`s address map.
+///
----------------



================
Comment at: llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h:43-49
+///     1. load input DWARF for Compile Unit.
+///     2. report warnings for Clang modules.
+///     3. analyze live DIEs and type names(if ODR deduplication is requested).
+///     4. clone DIEs(Generate output DIEs and resulting DWARF tables).
+///        The result is in OutDebugInfoBytes, which is ELF file containg
+///        DWARF tables corresponding for current compile unit.
+///     5. cleanup Input and Output DIEs.
----------------



================
Comment at: llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h:56-57
+/// if (ODR deduplication is requested)
+///   generate artificial compilation unit "Type Table"(It uses partially
+///   generated dies at clone stage).
+///
----------------



================
Comment at: llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h:61-65
+///     1. set offsets to Compile Units DWARF tables.
+///     2. sort offsets/attributes/patches to have a predictable result.
+///     3. patch size/offsets fields.
+///     4. generate index tables.
+///     5. move DWARF tables of compile units into the resulting file.
----------------



================
Comment at: llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h:69-72
+/// i.e. every compile unit is processed separately, visited only once
+/// (except case inter-CU references exist), and used data are freed
+/// after the compile unit is processed. The resulting file is glued
+/// from generated debug tables, corresponding to separate compile units.
----------------



================
Comment at: llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h:91-92
+
+/// ExtraDwarfEmitter allows to add extra data to the DWARFLinker output.
+/// The finish() method should be called after all extra data are emitted.
+class ExtraDwarfEmitter {
----------------



================
Comment at: llvm/tools/dsymutil/DwarfLinkerForBinary.cpp:557
+    default:
+      llvm_unreachable("");
+    }
----------------
Can we add a meaningful error string? 


================
Comment at: llvm/tools/dsymutil/DwarfLinkerForBinary.cpp:594
+  }
+}
 
----------------
This probably needs an unreachable to make (older versions) of gcc happy.

```
  llvm_unreachable("All cases handled above!");
```


================
Comment at: llvm/tools/dsymutil/dsymutil.cpp:248-254
+
+    if (S == "apple")
+      return DsymutilDWARFLinkerType::Apple;
+
+    if (S == "llvm")
+      return DsymutilDWARFLinkerType::LLVM;
+
----------------
Let's remove these newlines to be consistent with the existing code surrounding it. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147952/new/

https://reviews.llvm.org/D147952



More information about the llvm-commits mailing list