[PATCH] D62440: [analyzer] NFC: Change evalCall() to provide a CallEvent.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 28 16:33:56 PDT 2019


NoQ marked an inline comment as done.
NoQ added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:372
                                           CheckerContext &C) const {
-  const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(CE->getCalleeDecl());
+  const auto *FD = dyn_cast_or_null<FunctionDecl>(Call.getDecl());
   if (!FD)
----------------
a_sidorin wrote:
> Should we create helpers similar to getDecl() and getOriginExpr (getFunctionDecl/getCallExpr)?
Generally it sounds like a good idea, but in the context of this patch it's only useful when i don't want to refactor the code to avoid needing such getters in the first place. Once the `CallDescription` interface is good enough, all such getters will turn into hard casts without null checks. But these two checkers implement their own custom call description facility, so they need this sort of dancing.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62440/new/

https://reviews.llvm.org/D62440





More information about the cfe-commits mailing list