================
@@ -380,37 +323,52 @@ 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());
+ // Constructors are modeled in evalCall, so skip them before the lookup.
+ if (isa<CXXConstructorCall>(Call))
return;
- }
- if (std::optional<MutexDescriptor> UnlockDesc =
- checkDescriptorMatch(Call, C, /*IsLock=*/false)) {
- handleUnlock(*UnlockDesc, Call, C);
+
+ const ThreadingCallDescription *Desc = lookupThreadingCall(Call);
+ if (!Desc)
+ return;
+
+ switch (Desc->Role) {
+ case RoleKind::Lock:
+ handleLock(*Desc, Call, C, C.getState());
+ break;
+ case RoleKind::Unlock:
+ handleUnlock(*Desc, Call, C);
+ break;
----------------
steakhal wrote:
```suggestion
return;
case RoleKind::Unlock:
handleUnlock(*Desc, Call, C);
return;
```
https://github.com/llvm/llvm-project/pull/224230
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits