[PATCH] D38282: llvm-dwarfdump: implement --find=<name>

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 15:31:35 PDT 2017


JDevlieghere added inline comments.


================
Comment at: include/llvm/DebugInfo/DWARF/DWARFContext.h:242
 
+  /// Get a pointer to the parsed accelerator table object.
+  const DWARFAcceleratorTable &getAppleNames();
----------------
s/pointer/reference/


================
Comment at: lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp:198
+DWARFAcceleratorTable::ValueIterator::ValueIterator(
+    const DWARFAcceleratorTable &AccelTable, unsigned Ofs)
+    : AccelTable(&AccelTable), DataOffset(Ofs) {
----------------
Why not Offset?


================
Comment at: lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp:241
+  for (unsigned HashIdx = Index; HashIdx < Hdr.NumHashes; ++HashIdx) {
+    unsigned HashOffset = HashesBase + HashIdx*4;
+    unsigned OffsetsOffset = OffsetsBase + HashIdx*4;
----------------
Not clang-formatted?


================
Comment at: tools/llvm-dwarfdump/llvm-dwarfdump.cpp:254
+          if (auto Offset = Atom.getAsSectionOffset())
+            DumpOffsets[DIDT_ID_DebugInfo] = *Offset;
+    // Early exit if --find was specified but the current file doesn't have it.
----------------
Would it be worthwhile to stop iterating once found?


https://reviews.llvm.org/D38282





More information about the llvm-commits mailing list