[Lldb-commits] [PATCH] D77326: 1/2: [nfc] [lldb] Unindent code

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 3 15:11:30 PDT 2020


clayborg added a comment.

Does anyone know why harbormaster is useless?



================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:2014
 
-        if (!method_die_offsets.empty()) {
-          DWARFDebugInfo &debug_info = dwarf->DebugInfo();
----------------
kwk wrote:
> I assume this can be removed because you're iterating over `num_matches == 0` when it's empty. But I cannot tell about the `DWARFDebugInfo &debug_info = dwarf->DebugInfo();` and how costly this call is and if it makes sense to run when the offsets are empty.
not costly at all. This will be fine.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp:70-71
     const dw_tag_t die_tag = die_info_array[i].tag;
-    if (die_tag == 0 || die_tag == DW_TAG_class_type ||
-        die_tag == DW_TAG_structure_type) {
-      if (die_info_array[i].type_flags & eTypeFlagClassIsImplementation) {
----------------
This logic is easy to understand by reading the code.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp:70-71
     const dw_tag_t die_tag = die_info_array[i].tag;
-    if (die_tag == 0 || die_tag == DW_TAG_class_type ||
-        die_tag == DW_TAG_structure_type) {
-      if (die_info_array[i].type_flags & eTypeFlagClassIsImplementation) {
-        if (return_implementation_only_if_available) {
-          // We found the one true definition for this class, so only return
-          // that
-          die_offsets.clear();
-          die_offsets.emplace_back(die_info_array[i]);
-          return;
-        } else {
-          // Put the one true definition as the first entry so it matches first
-          die_offsets.emplace(die_offsets.begin(), die_info_array[i]);
-        }
-      } else {
+    if (die_tag != 0 && die_tag != DW_TAG_class_type &&
+        die_tag != DW_TAG_structure_type)
+      continue;
----------------
clayborg wrote:
> This logic is easy to understand by reading the code.
This logic is harder to follow. Maybe:
```
if (!(die_tag == 0 || die_tag == DW_TAG_class_type || die_tag == DW_TAG_structure_type))
  continue;
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77326





More information about the lldb-commits mailing list