This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Eliminate `SkipPast::ReferenceThenPointer`.
ClosedPublic

Authored by mboehme on May 4 2023, 3:13 AM.

Details

Summary

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.

Diff Detail

Event Timeline

mboehme created this revision.May 4 2023, 3:13 AM
Herald added a project: Restricted Project. · View Herald Transcript
mboehme requested review of this revision.May 4 2023, 3:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 3:13 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
gribozavr2 accepted this revision.May 4 2023, 4:55 PM
This revision is now accepted and ready to land.May 4 2023, 4:55 PM
mboehme updated this revision to Diff 521269.May 11 2023, 5:26 AM

Rebase to head

ymandel accepted this revision.May 11 2023, 6:28 AM
ymandel added inline comments.
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
840

nit: no need for else since if branch always returns

mboehme updated this revision to Diff 521607.May 12 2023, 4:59 AM

Eliminate unnecessary else.

mboehme marked an inline comment as done.May 12 2023, 5:00 AM
mboehme added inline comments.
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
840

Good point -- done. (Also below.)

This revision was automatically updated to reflect the committed changes.
mboehme marked an inline comment as done.