[PATCH] D80016: [analyzer] StdLibraryFunctionsChecker: Add support to lookup types

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 15 09:12:14 PDT 2020


martong created this revision.
martong added reviewers: xazax.hun, NoQ, Szelethus, balazske.
Herald added subscribers: cfe-commits, ASDenysPetrov, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, whisperity.
Herald added a project: clang.

In this patch I am trying to get rid of the `Irrelevant` types from the
signatures of the functions from the standard C library. For that I've
introduced `lookupType()` to be able to lookup arbitrary types in the global
scope. This makes it possible to define the signatures precisely.

Note 1) `fread`'s signature is now fixed to have the proper `FILE *restrict`
type when C99 is the language.
Note 2) There are still existing `Irrelevant` types, but they are all from
POSIX. I am planning to address those together with the missing POSIX functions
(in D79433 <https://reviews.llvm.org/D79433>).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80016

Files:
  clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
  clang/test/Analysis/std-c-library-functions-arg-constraints.c
  clang/test/Analysis/std-c-library-functions-lookup.c
  clang/test/Analysis/std-c-library-functions-lookup.cpp
  clang/test/Analysis/std-c-library-functions.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80016.264257.patch
Type: text/x-patch
Size: 10240 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200515/f35999f9/attachment.bin>


More information about the cfe-commits mailing list