[PATCH] D125784: [llvm-debuginfo-analyzer] 09 - CodeView Reader

Carlos Alberto Enciso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 05:35:10 PDT 2022


CarlosAlbertoEnciso added inline comments.


================
Comment at: llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp:843
+  SmallVector<LVInlineeLine::iterator> InlineeIters;
+  std::function<void(LVScope * Parent)> FindInlinedScopes =
+      [&](LVScope *Parent) {
----------------
probinson wrote:
> Isn't a lambda usually defined with `auto`?
As the lambda is used recursively, the use of `auto` will raise:
`error: use of ‘FindInlinedScopes’ before deduction of ‘auto’`
```
  auto FindInlinedScopes =
      [&](LVScope *Parent) {
            ...
            FindInlinedScopes(Scope);  <-- Error
      };
```
Basically the name `FindInlinedScopes` is not accessible within the lambda.
By using `std::function<void(LVScope * Parent)> FindInlinedScopes` beforehand, we are able to reference it inside the lambda.


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

https://reviews.llvm.org/D125784



More information about the llvm-commits mailing list