[PATCH] D105017: [analyzer] LValueToRValueBitCasts should evaluate to an r-value
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 28 10:49:48 PDT 2021
NoQ added a comment.
Thanks, nice! More stuff to support.
================
Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp:307
if (CastE->getCastKind() == CK_LValueToRValue) {
for (ExplodedNodeSet::iterator I = dstPreStmt.begin(), E = dstPreStmt.end();
----------------
How difficult would it be to handle the cast properly by adding it to this branch, except eventually passing the right type to `getSVal(R, ...)` inside `evalLoad()`?
================
Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp:543
case CK_VectorSplat: {
state = handleLVectorSplat(state, LCtx, CastE, Bldr, Pred);
continue;
----------------
You didn't start it but that's, ugh, not a great name for the function to handle the new cast.
I wouldn't mind eliminating the function entirely and inlining the implementation as it actually makes the code easier to read, for once.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105017/new/
https://reviews.llvm.org/D105017
More information about the cfe-commits
mailing list