[clang] [NFC][analyzer] Replace BlockInCriticalSection MutexDescriptor with C… (PR #224230)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 04:46:00 PDT 2026


================
@@ -380,37 +309,41 @@ void BlockInCriticalSectionChecker::checkPostCall(const CallEvent &Call,
     return;
   }
 
-  if (std::optional<MutexDescriptor> LockDesc =
-          checkDescriptorMatch(Call, C, /*IsLock=*/true)) {
-    if (!std::holds_alternative<RAIIMutexDescriptor>(*LockDesc))
-      handleLock(*LockDesc, Call, C, C.getState());
+  const ThreadingCallDescription *Desc = lookupThreadingCall(Call);
+  if (!Desc)
     return;
-  }
-  if (std::optional<MutexDescriptor> UnlockDesc =
-          checkDescriptorMatch(Call, C, /*IsLock=*/false)) {
-    handleUnlock(*UnlockDesc, Call, C);
+
+  // RAII constructors are modeled in evalCall so they are not inlined.
+  if (isa<CXXConstructorCall>(Call))
+    return;
----------------
steakhal wrote:

This is odd. I'd expect that the same arguments would hold for dtors as well. Why aren't those handled here?

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


More information about the cfe-commits mailing list