[Lldb-commits] [lldb] Change GetNumChildren()/CalculateNumChildren() methods return llvm::Expected (PR #84219)

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 6 11:42:38 PST 2024


================
@@ -1397,7 +1398,9 @@ ValueObjectSP GetValueForOffset(StackFrame &frame, ValueObjectSP &parent,
     return parent;
   }
 
-  for (int ci = 0, ce = parent->GetNumChildren(); ci != ce; ++ci) {
+  for (int ci = 0, ce = llvm::expectedToStdOptional(parent->GetNumChildren())
----------------
walter-erquinigo wrote:

I'm afraid that calls to `expectedToStdOptional` will just silence important warnings.

https://github.com/llvm/llvm-project/pull/84219


More information about the lldb-commits mailing list