Model nullopt, inplace, value, and conversion constructors.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h | ||
---|---|---|
42 | This shouldn't be needed, since we now pass the MatchFinder::MatchResult in Action, which includes the ASTContext. |
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp | ||
---|---|---|
55 | Did you consider hasAnyName? Or would that not work in this context? | |
75 | What is a non-standard constructor? This might be a well-known term I'm not aware of. If that is not the case I'd prefer a comment or a more descriptive name. | |
270 | Do we need this + to force conversion to function pointer? Is it possible to fix CaseOf so it works with lambdas or is that not desirable? |
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp | ||
---|---|---|
108 | This could get expensive. Maybe add a FIXME to optimize this by avoiding getQualifiedNameAsString? | |
271 | I realize this is consistent with the previous version, but just noticed this issue. By using assignOptionalValue for emplace (and reset), does that break the following case? optional<int> opt; if (p) opt.emplace(3); someCode(); if (p) use(*opt); |
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp | ||
---|---|---|
271 | This isn't supported yet. Still, I don't think assignOptionalValue breaks it because this seems more related to the way information from different branches is joined than the way values are initialized. I'll add this case (and others) in a following patch that adds support for joining. |
clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h | ||
---|---|---|
146 | Nit: looks like we need to repeat the action type. Should we restore the using above? |
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp | ||
---|---|---|
118 | Nit: some of these functions are static and some not. Should we have one big anonymous namespace instead? |
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp | ||
---|---|---|
271 | Sounds good. I think we can discuss further in the next patch as needed. |
Address reviewers' comments.
clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h | ||
---|---|---|
146 | It's not the same. The one above is a template - it accepts an arbitrary Node instead of a Stmt. | |
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp | ||
118 | We already have an anonymous namespace so I'll make the functions inside non-static. |
This shouldn't be needed, since we now pass the MatchFinder::MatchResult in Action, which includes the ASTContext.