[PATCH] D38409: [dwarfdump] Add -lookup option
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 9 11:28:55 PDT 2017
dblaikie added inline comments.
================
Comment at: llvm/trunk/include/llvm/DebugInfo/DIContext.h:60
+
+ operator bool() const { return (*this) != DILineInfo(); }
+
----------------
This should be explicit (implicit bool conversion operators are problematic - can easily convert to int, etc)
================
Comment at: llvm/trunk/include/llvm/DebugInfo/DIContext.h:60
+
+ operator bool() const { return (*this) != DILineInfo(); }
+
----------------
dblaikie wrote:
> This should be explicit (implicit bool conversion operators are problematic - can easily convert to int, etc)
I probably wouldn't bother with the () around '*this'.
================
Comment at: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFContext.h:265
+ DWARFDie BlockDIE;
+ operator bool() const { return CompileUnit != nullptr; }
+ };
----------------
explicit
================
Comment at: llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:297-302
+ DIEsForAddr.CompileUnit->dump(OS, DumpOpts);
+ if (DIEsForAddr.FunctionDIE) {
+ DIEsForAddr.FunctionDIE.dump(OS, 2, DumpOpts);
+ if (DIEsForAddr.BlockDIE)
+ DIEsForAddr.BlockDIE.dump(OS, 4, DumpOpts);
+ }
----------------
What if the subprogram DIE is nested within namespaces? (GCC doesn't do this (put subprogram definitions at nested namespace scope), but LLVM does) I'd expect dumping just the subprogram to dump the parent scopes in some way? (namespaces, classes, other functions, etc - maybe all abbreviated to just their name?)
Repository:
rL LLVM
https://reviews.llvm.org/D38409
More information about the llvm-commits
mailing list