[Lldb-commits] [clang] [lldb] [clang][DebugInfo] Expand detection of structured bindings to account for std::get free function (PR #122265)

via lldb-commits lldb-commits at lists.llvm.org
Sat Jan 11 12:47:19 PST 2025


cor3ntin 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



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


More information about the lldb-commits mailing list