================
@@ -602,6 +627,67 @@ static void transferStatusConstructor(const
CXXConstructExpr *Expr,
if (State.Env.getValue(locForOk(StatusLoc)) == nullptr)
initializeStatus(StatusLoc, State.Env);
}
+static void
+transferLoggingGetReferenceableValueCall(const CallExpr *Expr,
+ const MatchFinder::MatchResult &,
+ LatticeTransferState &State) {
+ assert(Expr->getNumArgs() == 1);
+ if (Expr->getArg(0)->isPRValue())
+ return;
+ auto *ArgLoc = State.Env.getStorageLocation(*Expr->getArg(0));
+ if (ArgLoc == nullptr)
+ return;
+
+ State.Env.setStorageLocation(*Expr, *ArgLoc);
+}
+
+static void transferLoggingCheckEqImpl(const CallExpr *Expr,
+ const MatchFinder::MatchResult &,
+ LatticeTransferState &State) {
+ assert(Expr->getNumArgs() > 2);
+
+ auto *EqVal = evaluateEquality(Expr->getArg(0), Expr->getArg(1), State.Env);
+ if (EqVal == nullptr)
+ return;
+
+ // TODO(sgatev): Model pointer nullability more accurately instead of
----------------
fmayer wrote:
done. explained better and did some minor restructuring to make it easier to
explain (moved the cast transfer function out of line)
https://github.com/llvm/llvm-project/pull/169749
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits