[clang] [clang][analyzer] Add note tags to alpha.unix.BlockInCriticalSection (PR #80029)

Balázs Kéri via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 8 00:01:49 PST 2024


================
@@ -57,6 +61,12 @@ class BlockInCriticalSectionChecker : public Checker<check::PostCall> {
                                 const CallEvent &call,
                                 CheckerContext &C) const;
 
+  CritSectionMarker getCriticalSectionMarker(const CallEvent &Call,
+                                             CheckerContext &C) const;
+  const NoteTag *
+  createCriticalSectionNote(const CritSectionMarker &CriticalSectionBegin,
+                            CheckerContext &C) const;
----------------
balazske wrote:

Possible improvements (but not necessary to move the checker out of alpha):
Handle `recursive_mutex`, `lock_guard`, `unique_lock`, `scoped_lock` objects. (It is recommended to use lock wrappers instead of plain `lock` and `unlock` functions.)

https://github.com/llvm/llvm-project/pull/80029


More information about the cfe-commits mailing list