[PATCH] D77846: [analyzer][CallAndMessage][NFC] Split up checkPreCall

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 9 18:31:15 PDT 2020


Szelethus created this revision.
Szelethus added reviewers: NoQ, xazax.hun, balazske, martong, baloghadamsoftware, rnkovacs, dcoughlin.
Szelethus added a project: clang.
Herald added subscribers: cfe-commits, ASDenysPetrov, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity.
Szelethus added a parent revision: D77845: [analyzer][CallAndMessage][NFC] Change old callbacks to rely on CallEvent.

The patch aims to use `CallEvent`s interface in a more principled manner, and also to highlight what this checker really does. It in fact checks for 5 different kinds of errors (from checkPreCall, that is):

- Invalid function pointer related errors
- Call of methods from an invalid C++ this object
- Function calls with incorrect amount of parameters
- Invalid arguments for `operator delete`
- Pass of uninitialized values to pass-by-value parameters

In a previous patch I complained that this checker is responsible for emitting a lot of different diagnostics all under `core.CallAndMessage`'s name, and this patch shows where we could start to assign different diagnostics to different entities.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77846

Files:
  clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77846.256463.patch
Type: text/x-patch
Size: 11754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200410/5d66f885/attachment-0001.bin>


More information about the cfe-commits mailing list