[PATCH] D123858: [clang][dataflow] Ensure well-formed flow conditions.
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 19 11:18:26 PDT 2022
xazax.hun accepted this revision.
xazax.hun added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:110
+ // FIXME: The flow condition must be an r-value, so `SkipPast::None` should
+ // suffice.
----------------
I am still not convinced why would we ever need `SkipPast`, as the AST will always have the necessary LValueToRValue conversions when we need to look past references. But this is unrelated to this patch.
================
Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:119
+ if (Val == nullptr) {
+ auto *Loc = Env.getStorageLocation(Cond, SkipPast::None);
+ if (Loc == nullptr) {
----------------
I think this get or create pattern is getting more and more widespread. At some point we might want a helper.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123858/new/
https://reviews.llvm.org/D123858
More information about the cfe-commits
mailing list