Skip to content

Commit f4c26d9

Browse files
committed
[analyzer] Add FuchsiaLockChecker and C11LockChecker
These are mostly trivial additions as both of them are reusing existing PThreadLockChecker logic. I only needed to add the list of functions to check and do some plumbing to make sure that we display the right checker name in the diagnostic. Differential Revision: https://reviews.llvm.org/D73376
1 parent 747242a commit f4c26d9

File tree

4 files changed

+467
-121
lines changed

4 files changed

+467
-121
lines changed

clang/include/clang/StaticAnalyzer/Checkers/Checkers.td

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,16 @@ def StackAddrAsyncEscapeChecker : Checker<"StackAddressAsyncEscape">,
227227
Dependencies<[StackAddrEscapeBase]>,
228228
Documentation<HasAlphaDocumentation>;
229229

230+
def PthreadLockBase : Checker<"PthreadLockBase">,
231+
HelpText<"Helper registering multiple checks.">,
232+
Documentation<NotDocumented>,
233+
Hidden;
234+
235+
def C11LockChecker : Checker<"C11Lock">,
236+
HelpText<"Simple lock -> unlock checker">,
237+
Dependencies<[PthreadLockBase]>,
238+
Documentation<HasAlphaDocumentation>;
239+
230240
} // end "alpha.core"
231241

232242
//===----------------------------------------------------------------------===//
@@ -431,6 +441,7 @@ def ChrootChecker : Checker<"Chroot">,
431441

432442
def PthreadLockChecker : Checker<"PthreadLock">,
433443
HelpText<"Simple lock -> unlock checker">,
444+
Dependencies<[PthreadLockBase]>,
434445
Documentation<HasAlphaDocumentation>;
435446

436447
def StreamChecker : Checker<"Stream">,
@@ -1442,5 +1453,10 @@ def FuchsiaHandleChecker : Checker<"HandleChecker">,
14421453
HelpText<"A Checker that detect leaks related to Fuchsia handles">,
14431454
Documentation<HasDocumentation>;
14441455

1456+
def FuchsiaLockChecker : Checker<"Lock">,
1457+
HelpText<"Check for the correct usage of locking APIs.">,
1458+
Dependencies<[PthreadLockBase]>,
1459+
Documentation<HasDocumentation>;
1460+
14451461
} // end fuchsia
14461462

0 commit comments

Comments
 (0)