[Lldb-commits] [PATCH] D62211: Simplify `GetName`+`AppendTypeName` by `DWARFDIE`

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 21 12:20:30 PDT 2019


jankratochvil marked 3 inline comments as done.
jankratochvil added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:1073
+bool DWARFDebugInfoEntry::AppendTypeName(const DWARFDIE die, Stream &s) {
+  if (die) {
+    if (die.GetDIE()->IsNULL()) {
----------------
JDevlieghere wrote:
> How about turning this into an early return?
This deep nesting is a general coding style in LLDB so I try to keep it.  Yes, I would like to (and I use elsewhere) early returns to keep the nesting low. I will submit another patch for it when you say it is OK to clean it up.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h:129
 
-  static bool GetName(const DWARFUnit *cu, const dw_offset_t die_offset,
-                      lldb_private::Stream &s);
+  static bool GetName(const DWARFDIE die, lldb_private::Stream &s);
 
----------------
JDevlieghere wrote:
> Since we pass by value we can remove the `const`?
There was already `const dw_offset_t` but OK, I will remove it as it is probably a LLVM rule.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D62211





More information about the lldb-commits mailing list