[all-commits] [llvm/llvm-project] c2bb68: [dataflow] Disallow implicit copy of Environment, ...
Sam McCall via All-commits
all-commits at lists.llvm.org
Mon Jun 26 06:26:18 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c2bb68078eb9ef79d8d928bc863c6ed0308b1965
https://github.com/llvm/llvm-project/commit/c2bb68078eb9ef79d8d928bc863c6ed0308b1965
Author: Sam McCall <sam.mccall at gmail.com>
Date: 2023-06-26 (Mon, 26 Jun 2023)
Changed paths:
M clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
M clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
M clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h
M clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
M clang/lib/Analysis/FlowSensitive/Transfer.cpp
M clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
M clang/unittests/Analysis/FlowSensitive/TestingSupport.h
Log Message:
-----------
[dataflow] Disallow implicit copy of Environment, use fork() instead
Environments are heavyweight, and copies are observably different from the
original: they introduce new SAT variables, which degrade performance &
debugging. Copies should only be done deliberately, where justified.
Empirically there are several places in the framework where we perform dubious
copies, sometimes entirely accidentally. (see e.g. D153491). Making these
explicit makes this mistake harder.
This patch forces copies to go through fork(), the copy-constructor is private.
This requires changes to existing callsites: some are correct and call fork(),
some are incorrect and are fixed, others are difficult and I left a FIXME.
Differential Revision: https://reviews.llvm.org/D153674
More information about the All-commits
mailing list