labath added a comment.

Looks pretty good, I just think the std::function solution is too smart for its 
own good.



================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h:82
+  /// The object will remain valid during the whole call statement:
+  /// Function(name, DIERefCallback({callback, name}));
+  struct DIERefCallbackArgs {
----------------
jankratochvil wrote:
> This calling with curly brackets is a bit tricky but I found it the least 
> worst option.
I think it would be much simpler to make this a callable object instead (though 
I'm not sure we need to worry about optimizing to this level of detail):
```
class ResultProcessor (?) {
  ResultProcessor(callback, name);
  bool operator()(DIERef ref);
};
```


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp:186
 
+  auto dierefcallback = DIERefCallback({callback, class_name.GetStringRef()});
   for (DIERef ref : incomplete_types)
----------------
dangling `DIERefCallbackArgs` here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77970



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to