This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Enable use of synthetic properties on all Value instances.
ClosedPublic

Authored by wyt on Jun 7 2022, 3:30 AM.

Details

Summary

This patch moves the implementation of synthetic properties from the StructValue class into the Value base class so that it can be used across all Value instances.

Diff Detail

Event Timeline

wyt created this revision.Jun 7 2022, 3:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 3:30 AM
wyt requested review of this revision.Jun 7 2022, 3:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 3:30 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
wyt edited the summary of this revision. (Show Details)Jun 7 2022, 3:35 AM
xazax.hun accepted this revision.Jun 7 2022, 5:01 AM
This revision is now accepted and ready to land.Jun 7 2022, 5:01 AM
ymandel accepted this revision.Jun 7 2022, 6:17 AM

Thanks!

sgatev accepted this revision.Jun 7 2022, 6:43 AM
sgatev added inline comments.
clang/include/clang/Analysis/FlowSensitive/Value.h
29

I'm not sure I understand what is meant by "separately allocated" and "stored by pointer". Could you please clarify?

gribozavr2 added inline comments.Jun 7 2022, 7:01 AM
clang/include/clang/Analysis/FlowSensitive/Value.h
29–30
wyt updated this revision to Diff 435121.Jun 8 2022, 6:10 AM

Remove cast to StructValues since get/setProperty can be used directly on Values now

wyt marked 2 inline comments as done.Jun 8 2022, 6:13 AM
wyt added inline comments.
clang/include/clang/Analysis/FlowSensitive/Value.h
29

(See suggested fix by Dmitri)
When we create a new Value instance, we let DataflowAnalysisCtx take ownership of the value and refer to it by pointer.

gribozavr2 accepted this revision.Jun 8 2022, 10:50 AM
gribozavr2 added inline comments.
clang/include/clang/Analysis/FlowSensitive/Value.h
28–30

Please add a blank line between the short description and the rest.