[PATCH] D119004: [NFC][analyzer] Allow CallDescriptions to be matched with CallExprs

Bal√°zs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 9 04:36:20 PST 2022


steakhal added inline comments.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h:102-103
 
+  /// Returns true if the CallEvent is a call to a function that matches
+  /// the CallDescription.
+  ///
----------------
NoQ wrote:
> 
ping


================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h:111
 
-  /// \copydoc clang::ento::matchesAny(const CallEvent &, const CallDescription &)
+  /// \copydoc clang::ento::CallDescription::matchesAny(const CallEvent &, const CallDescription &)
   template <typename... Ts>
----------------
I think it's a free function. I know that copydoc did not work for this example.
Are you sure adding the `::CallDescription` fixes the doc comment?


================
Comment at: clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp:50
       ++Found;
+
     return Result;
----------------
.


================
Comment at: clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp:501
+//===----------------------------------------------------------------------===//
+// Testing through a checker interface.
+//
----------------
You could have define `ResultMap` ad a virtual base class, which would be implemented by two different classes. One of which would use the `asWritten` lookups, etc.
You could `make_unique` of the required one and inject it to the `Action`.

That way those tests would look just the same as the previous ones.


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

https://reviews.llvm.org/D119004



More information about the cfe-commits mailing list