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)
commit7146b0032fa4f713da5e199e4b96cfa84a630119
tree20c1321ca8f440fba0700fc4e32a5636315a73cc
parentd5a39553ff3eafaab675e581d973f700a4d7a6b5
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

llvm-svn: 343681
clang/lib/Analysis/ThreadSafety.cpp
clang/test/SemaCXX/warn-thread-safety-analysis.cpp