This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Move logic for `createStorageLocation` from `DataflowEnvironment` to `DataflowAnalysisContext`.
ClosedPublic

Authored by wyt on Jun 22 2022, 10:07 AM.

Details

Summary

createStorageLocation in DataflowEnvironment is now a trivial wrapper around the logic in DataflowAnalysisContext.
Additionally, getObjectFields and getFieldsFromClassHierarchy (required for the implementation of createStorageLocation) are also moved to DataflowAnalysisContext.

Diff Detail

Event Timeline

wyt created this revision.Jun 22 2022, 10:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2022, 10:07 AM
wyt requested review of this revision.Jun 22 2022, 10:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2022, 10:07 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
sgatev added inline comments.Jun 22 2022, 10:31 AM
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
91–92

Let's implement this for the new members you are adding and keep the existing members in DataflowEnvironment as they are. I suggest calling the new ones getStableStorageLocation.

94–95
102–104
107–109
clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
41–43

I think it makes sense to keep this comment in the wrapper in DataflowEnvironment. Same for the one below.

wyt updated this revision to Diff 439720.Jun 24 2022, 5:57 AM
wyt marked 5 inline comments as done.

Address comments.

sgatev accepted this revision.Jun 24 2022, 6:02 AM
sgatev added inline comments.
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
91
98
101
This revision is now accepted and ready to land.Jun 24 2022, 6:02 AM
wyt updated this revision to Diff 439730.Jun 24 2022, 6:46 AM
wyt marked 3 inline comments as done.

Fix comment.

sgatev accepted this revision.Jun 24 2022, 6:50 AM
gribozavr2 accepted this revision.Jun 24 2022, 7:06 PM
gribozavr2 added inline comments.
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
47
wyt updated this revision to Diff 440123.Jun 27 2022, 1:35 AM
wyt marked an inline comment as done.

Fix comment.

gribozavr2 accepted this revision.Jun 27 2022, 2:17 AM
This revision was automatically updated to reflect the committed changes.