[PATCH] D139544: [clang][dataflow] Add support for structured bindings of tuple-like types.
Yitzhak Mandelbaum via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 9 07:49:55 PST 2022
ymandel added a comment.
In D139544#3984532 <https://reviews.llvm.org/D139544#3984532>, @isuckatcs wrote:
>> Sorry, I should fix my response above: I *never* see the BindingDecls in the CFG, whether or not they are used.
>
> It was my fault, I was wrong with the wording. I meant the `DeclRefExpr`s that refer to the `BindingDecl`s. You can
> access the `BindingDecl`s through the `DeclRefExpr`s, they are not present in the CFG directly.
>
> That's also how the static analyzer handles the `BindingDecl`s in `ExprEngine::VisitCommonDeclRefExpr()`.
Got it, thanks!
So, I think everything is resolved now, you've been incredibly helpful. Based on my now understanding the CFG representation of DecompositionDecls a lot better, I found a simpler solution that doesn't even need to involve our handling of `DeclRefExpr`s and is therefore consistent with how we already handle the struct references.
I think there's a separate discussion we might want to have about whether it would be valuable (to the static analyzer and the dataflow framework, among others) to update CFG to explicitly represent BindingDecls and the AST nodes in their bindings. But, that seems better for a discourse thread. :)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139544/new/
https://reviews.llvm.org/D139544
More information about the cfe-commits
mailing list