]> granicus.if.org Git - clang/commit
Thread safety analysis: Unwrap __builtin_expect in getTrylockCallExpr
authorAaron Puchert <aaronpuchert@alice-dsl.net>
Wed, 3 Oct 2018 11:58:19 +0000 (11:58 +0000)
committerAaron Puchert <aaronpuchert@alice-dsl.net>
Wed, 3 Oct 2018 11:58:19 +0000 (11:58 +0000)
commitc78bc70b3e06edc5c7804eabfbc394a72d36b588
tree36be90264c7a0954e769b78ec1cac82113d0f571
parent7d98247a0bf0a8719afadda6260a0cdbee00345a
Thread safety analysis: Unwrap __builtin_expect in getTrylockCallExpr

Summary:
When people are really sure they'll get the lock they sometimes use
__builtin_expect. It's also used by some assertion implementations.
Asserting that try-lock succeeded is basically the same as asserting
that the lock is not held by anyone else (and acquiring it).

Reviewers: aaron.ballman, delesley

Reviewed By: aaron.ballman

Subscribers: kristina, cfe-commits

Differential Revision: https://reviews.llvm.org/D52398

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343681 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ThreadSafety.cpp
test/SemaCXX/warn-thread-safety-analysis.cpp