[PATCH] D38409: [dwarfdump] Add -lookup option

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 11:46:11 PDT 2017


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

Thanks! (Minor nitpick + future work inside :-)



================
Comment at: include/llvm/DebugInfo/DIContext.h:64
+    OS << "Line info: ";
+    if (FileName != "<invalid>")
+      OS << "file '" << FileName << "', ";
----------------
optimization opportunity: this and the fact that we initialize the std::string with "<invalid>" seems kind of expensive. Perhaps switch to StringRef and handle the empty string in dump()?


================
Comment at: lib/DebugInfo/DWARF/DWARFContext.cpp:748
+
+    for (auto Child : DIE) {
+      Worklist.push_back(Child);
----------------
extra {}


================
Comment at: tools/llvm-dwarfdump/llvm-dwarfdump.cpp:264
+
+  if (DILineInfo LineInfo = DICtx.getLineInfoForAddress(Lookup)) {
+    LineInfo.dump(OS);
----------------
extra {}


Repository:
  rL LLVM

https://reviews.llvm.org/D38409





More information about the llvm-commits mailing list