[analyzer] MacOSXAPIChecker: Disallow dispatch_once_t in ivars and heap.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 31 Oct 2016 17:27:26 +0000 (17:27 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 31 Oct 2016 17:27:26 +0000 (17:27 +0000)
commitaacc03c918c835cb87225990551c3ed1d5271b66
treed75b9aece6400f2fdce3aa2151cf711032e5e54f
parent849a6a5e5a1259c49c1544cfb84b476da5eae5c9
[analyzer] MacOSXAPIChecker: Disallow dispatch_once_t in ivars and heap.

Unlike global/static variables, calloc etc. functions that allocate ObjC
objects behave differently in terms of memory barriers, and hacks that make
dispatch_once as fast as it possibly could be start failing.

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

llvm-svn: 285605
clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
clang/test/Analysis/dispatch-once.m [new file with mode: 0644]