[clang][dataflow] Add `create<T>()` methods to `Environment` and `DataflowAnalysisCon...
authorMartin Braenne <mboehme@google.com>
Mon, 3 Apr 2023 14:45:13 +0000 (14:45 +0000)
committerMartin Braenne <mboehme@google.com>
Tue, 4 Apr 2023 07:13:44 +0000 (07:13 +0000)
commit745a957f9dc562477cbe587fb3fa8305713b51b3
tree0ff99bf94ed0b233f9b32dec0b745bfcd6321646
parent3ce5ac51700f11a62ee5b25393082d44028906ed
[clang][dataflow] Add `create<T>()` methods to `Environment` and `DataflowAnalysisContext`.

These methods provide a less verbose way of allocating `StorageLocation`s and
`Value`s than the existing `takeOwnership(make_unique(...))` pattern.

In addition, because allocation of `StorageLocation`s and `Value`s now happens
within the `DataflowAnalysisContext`, the `create<T>()` open up the possibility
of using `BumpPtrAllocator` to allocate these objects if it turns out this
helps performance.

Reviewed By: ymandel, xazax.hun, gribozavr2

Differential Revision: https://reviews.llvm.org/D147302
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
clang/lib/Analysis/FlowSensitive/Transfer.cpp
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp