[PATCH] D147698: [clang][dataflow] Add support for new and delete expressions.

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 6 04:28:02 PDT 2023


mboehme created this revision.
Herald added subscribers: martong, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
mboehme requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

To model the fact that values get deleted by a delete expression, this also
necessitates adding `DataflowEnvironment::unsetValue(StorageLocation &)` and
`StructValue::unsetValue(ValueDecl &)`.

Modeling object deletion in this way isn't perfect. In the framework, a value
that isn't present typically simply means "we didn't compute a value for this
storage location or struct field". Still, removing the values still seems better
than leaving them in place.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147698

Files:
  clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
  clang/include/clang/Analysis/FlowSensitive/Value.h
  clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
  clang/lib/Analysis/FlowSensitive/Transfer.cpp
  clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147698.511366.patch
Type: text/x-patch
Size: 8063 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230406/75ed4776/attachment-0001.bin>


More information about the cfe-commits mailing list