[PATCH] D62556: [analyzer] NFC: CallDescription: Implement describing C library functions.

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


NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a_sidorin, rnkovacs, mikhail.ramalho, Szelethus, baloghadamsoftware, Charusso.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, a.sidorin, szepet.
Herald added a project: clang.
NoQ added a parent revision: D62441: [analyzer] NFC: Introduce a convenient CallDescriptionMap class..

When matching C standard library functions in the checker, it's easy to forget that they are often implemented as macros that are expanded to compiler builtins. Such builtins would have a different name, so matching the callee identifier would fail, or may sometimes have more arguments than expected (so matching the exact number of arguments would fail, but this is fine as long as we have all the arguments that we need in their respective places.

This patch adds a set of flags to the `CallDescription` class so that to handle various special matching rules, and adds the first flag into this set, which enables a more fuzzy matching for functions that may be implemented as builtins.


Repository:
  rC Clang

https://reviews.llvm.org/D62556

Files:
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
  clang/lib/StaticAnalyzer/Core/CallEvent.cpp
  clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62556.201785.patch
Type: text/x-patch
Size: 4534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190528/7913cca5/attachment.bin>


More information about the cfe-commits mailing list