================
@@ -495,6 +507,78 @@ void MoveChecker::checkPostCall(const CallEvent &Call,
assert(!C.isDifferent() && "Should not have made transitions on this path!");
}
+bool MoveChecker::evalCall(const CallEvent &Call, CheckerContext &C) const {
+
+ const auto *CE = dyn_cast_if_present<CallExpr>(Call.getOriginExpr());
+ if (!CE)
+ return false;
+
+ ProgramStateRef State = C.getState();
+
+ if (!StdMoveCall.matches(Call))
+ return false;
+
+ const auto *BeginCall =
----------------
Xazax-hun wrote:
Usually, we try to avoid matching the AST like this. It can make the analysis
fragile.
E.g.:
```
std::move(c.begin(), ... );
```
vs
```
auto b = c.begin();
std::move(c, ...);
```
I wonder if the information what iterator belongs to what container is already
stored in one of the iterator checkers. If that's the case, maybe we could
depend on a modeling checker that calculates this information and use that
state instead of relying on the AST.
Alternatively, once we understand `lifetimebound` annotation, that same info
can be used to infer what container does the iterator belong to.
https://github.com/llvm/llvm-project/pull/196602
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits