[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
Wed Dec 7 08:08:55 PST 2022


ymandel created this revision.
ymandel added a reviewer: xazax.hun.
Herald added subscribers: martong, rnkovacs.
Herald added a reviewer: NoQ.
Herald added a project: All.
ymandel requested review of this revision.
Herald added a project: clang.

This patch adds interpretation of binding declarations resulting from a
structured binding (`DecompositionDecl`) to a tuple-like type. Currently, the
framework only supports binding to a struct.

Because of limitations in CFG (likely a bug), the implementation requires lazy
resolution of these `BindingDecl`s. If CFG can be updated so that the
synthesized variables occur in the block *before* the `DeclStmt` containing the
`DecompositionDecl`, then we can drop the workaround that is included in this
patch.

Fixes issue #57252.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139544

Files:
  clang/lib/Analysis/FlowSensitive/Transfer.cpp
  clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
  clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
  clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139544.480920.patch
Type: text/x-patch
Size: 11767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221207/1f21d305/attachment.bin>


More information about the cfe-commits mailing list