[PATCH] D118038: [clang][dataflow] Enable merging distinct values in Environment::join
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 24 07:52:48 PST 2022
xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.
I think the canonical approach most of the time is to have a map lattice that maps from values to your lattice elements. Storing properties directly at the object sounds like an interesting approach. I'll be curious to see how it works out. Do we expect the framework to propagate these properties automatically across copy ctors/copy assignments, move operations etc?
================
Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:364
+ } else {
+ cast<StructValue>(&MergedVal)->setProperty("has_value", HasValueTop);
+ }
----------------
An alternative approach would be to just return false here and whenever the property lookup fails just assume the top value. Since this is just a simple test, feel free to leave this as is.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118038/new/
https://reviews.llvm.org/D118038
More information about the cfe-commits
mailing list