[PATCH] D121602: [clang][dataflow] Model the behavior of non-standard optional constructors
Stanislav Gatev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 15 00:56:41 PDT 2022
sgatev added inline comments.
================
Comment at: clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h:146
+ std::vector<std::function<void(
+ const Stmt *, const ast_matchers::MatchFinder::MatchResult &, State &)>>
+ Actions;
----------------
xazax.hun wrote:
> Nit: looks like we need to repeat the action type. Should we restore the using above?
It's not the same. The one above is a template - it accepts an arbitrary `Node` instead of a `Stmt`.
================
Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:118
+/// function will be 2.
+int countOptionalWrappers(const ASTContext &ASTCtx, QualType Type) {
+ if (!IsOptionalType(Type))
----------------
xazax.hun wrote:
> Nit: some of these functions are static and some not. Should we have one big anonymous namespace instead?
We already have an anonymous namespace so I'll make the functions inside non-static.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121602/new/
https://reviews.llvm.org/D121602
More information about the cfe-commits
mailing list