[all-commits] [llvm/llvm-project] 14b039: [clang][dataflow] Remove `declToLocConsistent()` a...
martinboehme via All-commits
all-commits at lists.llvm.org
Mon Oct 23 23:42:44 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 14b039c1dd1e20cf7527aa717bac05133273a7dd
https://github.com/llvm/llvm-project/commit/14b039c1dd1e20cf7527aa717bac05133273a7dd
Author: martinboehme <mboehme at google.com>
Date: 2023-10-24 (Tue, 24 Oct 2023)
Changed paths:
M clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
M clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
M clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
Log Message:
-----------
[clang][dataflow] Remove `declToLocConsistent()` assertion. (#69819)
As described [here](https://discourse.llvm.org/t/70086/6), there are
legitimate
non-bug scenarios where two `DeclToLoc` maps to be joined contain
different
storage locations for the same declaration. This patch also adds a test
containing an example of such a situation. (The test fails without the
other
changes in this patch.)
With the assertion removed, the existing logic in `intersectDenseMaps()`
will
remove the corresponding declaration from the joined DeclToLoc map.
We also remove `removeDecl()`'s precondition (that the declaration must
be
associated with a storage location) because this may no longer hold if
the
declaration was previously removed during a join, as described above.
More information about the All-commits
mailing list