summaryrefslogtreecommitdiff
path: root/clang/unittests
diff options
context:
space:
mode:
authorMartin Braenne <mboehme@google.com>2023-05-12 11:59:21 +0000
committerMartin Braenne <mboehme@google.com>2023-05-15 04:33:29 +0000
commit48bc71505e03694caac6afb2431ff1157a2382a8 (patch)
treef5980e02f7cad79ef631df124ab81819901ee5ef /clang/unittests
parent47f5c54f997a59bb2c65abe6b8b811f6e7553456 (diff)
downloadllvm-48bc71505e03694caac6afb2431ff1157a2382a8.tar.gz
[clang][dataflow] Eliminate `SkipPast::ReferenceThenPointer`.
As a replacement, we provide the accessors `getImplicitObjectLocation()` and `getBaseObjectLocation()`, which are higher-level constructs that cover the use cases in which `SkipPast::ReferenceThenPointer` was typically used. Unfortunately, it isn't possible to use these accessors in UncheckedOptionalAccessModel.cpp; I've added a FIXME to the code explaining the details. I initially attempted to resolve the issue as part of this patch, but it turned out to be non-trivial to fix. Instead, I have therefore added a lower-level replacement for `SkipPast::ReferenceThenPointer` that is used only within this file. The wider context of this change is that `SkipPast` will be going away entirely. See also the RFC at https://discourse.llvm.org/t/70086. Reviewed By: ymandel, gribozavr2 Differential Revision: https://reviews.llvm.org/D149838
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
index a8b0c6bd6a08..83b9f33493d0 100644
--- a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
@@ -372,8 +372,7 @@ public:
auto *Object = E->getImplicitObjectArgument();
assert(Object != nullptr);
- auto *ObjectLoc =
- Env.getStorageLocation(*Object, SkipPast::ReferenceThenPointer);
+ auto *ObjectLoc = getImplicitObjectLocation(*E, Env);
assert(ObjectLoc != nullptr);
auto &ConstructorVal = *Env.createValue(Object->getType());
@@ -532,8 +531,7 @@ public:
auto *Object = E->getArg(0);
assert(Object != nullptr);
- auto *ObjectLoc =
- Env.getStorageLocation(*Object, SkipPast::ReferenceThenPointer);
+ auto *ObjectLoc = Env.getStorageLocation(*Object, SkipPast::Reference);
assert(ObjectLoc != nullptr);
auto &ConstructorVal = *Env.createValue(Object->getType());