[Lldb-commits] [clang] [lldb] [clang][DebugInfo] Expand detection of structured bindings to account for std::get free function (PR #122265)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 13 02:47:54 PST 2025
Michael137 wrote:
> > > Did you try to modify `IgnoreUnlessSpelledInSource` to support CallExpr?
> >
> >
> > Yea I was thinking about it initially. But I wasn't sure what that would look like tbh. IIUC `IgnoreImplicitMemberCallSingleStep` will unwrap `CXXMemberCallExpr` into the underlying `MemberExpr`. And then further until we hit the implicit object argument? But what would we do with `CallExpr`s? Do we return the `CalleeDecl`? In our use-case, the `Decomposition` decl is the first argument of the `CallExpr`.
>
> same thing we do for constructor ?
>
> ```
> if (auto *C = dyn_cast<CXXConstructExpr>(E)) {
> auto NumArgs = C->getNumArgs();
> if (NumArgs == 1 ||
> (NumArgs > 1 && isa<CXXDefaultArgExpr>(C->getArg(1)))) {
> Expr *A = C->getArg(0);
> if (A->getSourceRange() == E->getSourceRange() || C->isElidable())
> return A;
> }
> }
> return E;
> ```
>
> Note that I think it would only be useful to `get` (afaik) - but it would be in the same place, which seems desirable
Hah good point! That's pretty much exactly the heuristic we want. Let me try this
> Do we need a test case about explicit object member function get? i.e.
Good question. I think it's worth having one
https://github.com/llvm/llvm-project/pull/122265
More information about the lldb-commits
mailing list