[PATCH] D125931: [clang][dataflow] Add support for correlated branches to optional model
Stanislav Gatev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 14 02:43:04 PDT 2022
sgatev added inline comments.
================
Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:174
+/// property of the optional value `OptionalVal`.
+void setHasValue(StructValue &OptionalVal, BoolValue &HasValueVal) {
+ OptionalVal.setProperty("has_value", HasValueVal);
----------------
ymandel wrote:
> I believe you can relax this to `Value` because `setProperty` is no longer specific to `StructValue`.
I did that intentionally because I still think it makes sense to assert that an optional is modeled as a `StructValue`. I haven't thought about where and how it'd be best to assert that though so I'll happily remove the casts for now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125931/new/
https://reviews.llvm.org/D125931
More information about the cfe-commits
mailing list