summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/ManagedStatic.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert 220932.Jiangning Liu2014-11-051-11/+4
| | | | | | | | | Commit 220932 caused crash when building clang-tblgen on aarch64 debian target, so it's blocking all daily tests. The std::call_once implementation in pthread has bug for aarch64 debian. llvm-svn: 221331
* Removing the static initializer in ManagedStatic.cpp by using llvm_call_once ↵Chris Bieneman2014-10-301-4/+11
| | | | | | | | | | | | | | | | | | | to initialize the ManagedStatic mutex. Summary: This patch adds an llvm_call_once which is a wrapper around std::call_once on platforms where it is available and devoid of bugs. The patch also migrates the ManagedStatic mutex to be allocated using llvm_call_once. These changes are philosophically equivalent to the changes added in r219638, which were reverted due to a hang on Win32 which was the result of a bug in the Windows implementation of std::call_once. Reviewers: aaron.ballman, chapuni, chandlerc, rnk Reviewed By: rnk Subscribers: majnemer, llvm-commits Differential Revision: http://reviews.llvm.org/D5922 llvm-svn: 220932
* Revert r219638, (r219640 and r219676), "Removing the static destructor from ↵NAKAMURA Takumi2014-10-141-17/+6
| | | | | | | | ManagedStatic.cpp by controlling the allocation and de-allocation of the mutex." It caused hang-up on msc17 builder, probably deadlock. llvm-svn: 219687
* Removing the static destructor from ManagedStatic.cpp by controlling the ↵Chris Bieneman2014-10-131-6/+17
| | | | | | | | allocation and de-allocation of the mutex. This patch adds a new llvm_call_once function which is used by the ManagedStatic implementation to safely initialize a global to avoid static construction and destruction. llvm-svn: 219638
* Fix the MinGW builder. Apparently std::call_once andZachary Turner2014-06-211-17/+10
| | | | | | | | std::recursive_mutex are not available on MinGW and breaks the builder. Revert to using a function local static and sys::Mutex just to get the tree green until we figure out a better solution. llvm-svn: 211424
* Remove use of removed function, llvm_stop_multithreadingDavid Blaikie2014-06-191-2/+0
| | | | llvm-svn: 211291
* Kill the LLVM global lock.Zachary Turner2014-06-191-3/+20
| | | | | | | | | | | | | | This patch removes the LLVM global lock, and updates all existing users of the global lock to use their own mutex. None of the existing users of the global lock were protecting code that was mutually exclusive with any of the other users of the global lock, so its purpose was not being met. Reviewed by: rnk Differential Revision: http://reviews.llvm.org/D4142 llvm-svn: 211277
* Revert r211066, 211067, 211068, 211069, 211070.Zachary Turner2014-06-161-23/+5
| | | | | | | These were committed accidentally from the wrong branch before having a review sign-off. llvm-svn: 211072
* Kill the LLVM global lock.Zachary Turner2014-06-161-1/+22
| | | | llvm-svn: 211069
* Remove some code churn.Zachary Turner2014-06-161-1/+1
| | | | llvm-svn: 211068
* Remove some more code out into a separate CL.Zachary Turner2014-06-161-3/+1
| | | | llvm-svn: 211067
* Users of the llvm global mutex must now acquire it manually.Zachary Turner2014-06-161-3/+2
| | | | | | This allows the mutex to be acquired in a guarded, RAII fashion. llvm-svn: 211066
* Revert "Remove support for runtime multi-threading."Zachary Turner2014-06-101-2/+4
| | | | | | This reverts revision r210600. llvm-svn: 210603
* Remove support for runtime multi-threading.Zachary Turner2014-06-101-4/+2
| | | | | | | | | | | | | | | | | | | | | This patch removes the functions llvm_start_multithreaded() and llvm_stop_multithreaded(), and changes llvm_is_multithreaded() to return a constant value based on the value of the compile-time definition LLVM_ENABLE_THREADS. Previously, it was possible to have compile-time support for threads on, and runtime support for threads off, in which case certain mutexes were not allocated or ever acquired. Now, if the build is created with threads enabled, mutexes are always acquired. A test before/after patch of compiling a very large TU showed no noticeable performance impact of this change. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D4076 llvm-svn: 210600
* ManagedStatic is never built with a null constructor, remove support for it.David Blaikie2014-04-171-2/+3
| | | | llvm-svn: 206492
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-151-1/+1
| | | | | | instead of comparing to nullptr. llvm-svn: 206252
* [C++11] Replace some comparisons with 'nullptr' with simple boolean checks ↵Craig Topper2014-04-091-1/+1
| | | | | | to reduce verbosity. llvm-svn: 205829
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-071-7/+7
| | | | llvm-svn: 205697
* Revert "[C++11] Replace LLVM atomics with std::atomic."Benjamin Kramer2014-03-031-1/+2
| | | | | | | Breaks the MSVC build. DataStream.cpp(44): error C2552: 'llvm::Statistic::Value' : non-aggregates cannot be initialized with initializer list llvm-svn: 202731
* [C++11] Replace LLVM atomics with std::atomic.Benjamin Kramer2014-03-031-2/+1
| | | | | | | | | | | With C++11 we finally have a standardized way to specify atomic operations. Use them to replace the existing custom implemention. Sadly the translation is not entirely trivial as std::atomic allows more fine-grained control over the atomicity. I tried to preserve the old semantics as well as possible. Differential Revision: http://llvm-reviews.chandlerc.com/D2915 llvm-svn: 202730
* Add support for tsan annotations (thread sanitizer, a valgrind-based tool).Nick Lewycky2011-11-141-1/+7
| | | | | | | | | | | | These annotations are disabled entirely when either ENABLE_THREADS is off, or building a release build. When enabled, they add calls to functions with no statements to ManagedStatic's getters. Use these annotations to inform tsan that the race used inside ManagedStatic initialization is actually benign. Thanks to Kostya Serebryany for helping write this patch! llvm-svn: 144567
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120298
* Split the thread-related APIs out into their own file, and add a few moreOwen Anderson2009-06-161-20/+4
| | | | | | calls for convenience. llvm-svn: 73512
* Untabification.Bill Wendling2009-05-301-1/+1
| | | | llvm-svn: 72604
* Have llvm_start_multithreaded return a bool indicating whether multithreadedOwen Anderson2009-05-201-2/+3
| | | | | | initialization succeeded or not, rather than just asserting. llvm-svn: 72182
* Add llvm_start_multithreaded(), which starts up the LLVM internals in ↵Owen Anderson2009-05-201-8/+45
| | | | | | | | thread-safe mode. Provide double-check locking initialization of ManagedStatic's when running in thread-safe mode. llvm-svn: 72151
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Not all managedstatics need object pointers.Chris Lattner2007-02-201-1/+1
| | | | llvm-svn: 34444
* Define this in the correct n/sChris Lattner2006-09-291-1/+1
| | | | llvm-svn: 30671
* new helper class to provide more explicit management of static ctor/dtors.Chris Lattner2006-09-281-0/+53
llvm-svn: 30638
OpenPOWER on IntegriCloud