[PATCH] D117339: [clang][dataflow] Add transfer functions for bind temporary and static cast
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 14 15:29:00 PST 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/Transfer.cpp:90
void VisitDeclStmt(const DeclStmt *S) {
- // FIXME: Add support for group decls, e.g: `int a, b;`
- if (S->isSingleDecl()) {
- if (const auto *D = dyn_cast<VarDecl>(S->getSingleDecl())) {
- visitVarDecl(*D);
+ const auto &D = *cast<VarDecl>(S->getSingleDecl());
+ auto &Loc = Env.createStorageLocation(D);
----------------
sgatev wrote:
> xazax.hun wrote:
> > Wouldn't you dereference a null pointer for group decls?
> I couldn't figure what code to write that would create a group decl. Maybe because of https://github.com/llvm/llvm-project/blob/main/clang/lib/Analysis/CFG.cpp#L2842-L2856?
Oh, interesting! Let's add a comment about this.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117339/new/
https://reviews.llvm.org/D117339
More information about the cfe-commits
mailing list