[clang] [analyzer] Simplify CallEvent castArgToParamTypeIfNeeded (PR #120981)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 12 00:59:28 PST 2025
================
@@ -435,27 +435,27 @@ static SVal processArgument(SVal Value, const Expr *ArgumentExpr,
/// runtime definition don't match in terms of argument and parameter count.
static SVal castArgToParamTypeIfNeeded(const CallEvent &Call, unsigned ArgIdx,
SVal ArgVal, SValBuilder &SVB) {
- const FunctionDecl *RTDecl =
- Call.getRuntimeDefinition().getDecl()->getAsFunction();
const auto *CallExprDecl = dyn_cast_or_null<FunctionDecl>(Call.getDecl());
-
- if (!RTDecl || !CallExprDecl)
+ if (!CallExprDecl)
return ArgVal;
+ const FunctionDecl *Definition = CallExprDecl;
+ Definition->hasBody(Definition);
----------------
schittir wrote:
@steakhal - Did you intend to add this call? It appears useless without the return value check.
Also, I don't see any tests associated with this change. Could you please point me to them? Thank you!
https://github.com/llvm/llvm-project/pull/120981
More information about the cfe-commits
mailing list