[Lldb-commits] [PATCH] D133910: [NFCI] Refactor FormatterContainerPair into TieredFormatterContainer.
    Pavel Labath via Phabricator via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Tue Sep 20 00:48:26 PDT 2022
    
    
  
labath added inline comments.
================
Comment at: lldb/include/lldb/DataFormatters/TypeCategory.h:76
+    uint32_t result = 0;
+    for (auto sc : m_subcontainers) {
+      result += sc->GetCount();
----------------
According to <https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements> this loop body should not use the `{}` braces.
================
Comment at: lldb/include/lldb/DataFormatters/TypeCategory.h:90
+    }
+    assert(false && "formatter index out of range");
+  }
----------------
Is this reachable from the SB API (perhaps via `SBTypeCategory::GetXXXAtIndex`). If so, we'd want to do something different here (return a default/empty value), or add a check somewhere in the SB layer.
================
Comment at: lldb/include/lldb/DataFormatters/TypeCategory.h:132
+    }
+    assert(false && "formatter index out of range");
   }
----------------
same question.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133910/new/
https://reviews.llvm.org/D133910
    
    
More information about the lldb-commits
mailing list