[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 12:16:38 PST 2020


xazax.hun created this revision.
xazax.hun added reviewers: NoQ, haowei.
xazax.hun added a project: clang.
Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, jfb, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware.

Basically, the semantics of C11 and Fuchsia locks are very close to PThreads. Most of the work was boilerplate to make sure the correct check name appears in the diagnostics. If you have any idea how to reduce this boilerplate I'd like to know :)

I had to add a dummy check that can always be enabled. Otherwise, `CheckerManager::getChecker` would trigger an assertion fail due to attempting to get a checker that was potentially not enabled.

I plan to add more tests but wanted to share early to get some feedback about the approach.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73376

Files:
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
  clang/test/Analysis/c11lock.c
  clang/test/Analysis/fuchsia_lock.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73376.240264.patch
Type: text/x-patch
Size: 28821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200124/4392b3d6/attachment-0001.bin>


More information about the cfe-commits mailing list