================
@@ -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
----------------
jvoung wrote:
Should the TODO be updated? (not sgatev ?)
Might also be good to explain a bit more what's going on here, e.g., to explain
why the `makeNot` (the EQImpl returns a `char*` and when equal is ... nullptr?)
https://github.com/llvm/llvm-project/pull/169749
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits