summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src/cxa_guard.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite cxa guard implementation.Eric Fiselier2019-04-241-262/+14
| | | | | | | | | | | | | This patch does three main things: (1) It re-writes the cxa guard implementation to make it testable. (2) Adds support for recursive init detection on non-apple platforms. (3) It adds a futex based implementation. The futex based implementation locks and notifies on a per-object basis, unlike the current implementation which uses a global lock for all objects. Once this patch settles I'll turn it on by default when supported. llvm-svn: 359060
* [libc++abi] Create a macro for the 32 bit guard setting on ARM platformsLouis Dionne2019-04-101-10/+10
| | | | | | | | | | | | | | | | Summary: The goal is to use a descriptive name for this feature, instead of just using __arm__. Reviewers: EricWF Subscribers: javed.absar, kristof.beyls, christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D60520 llvm-svn: 358106
* Revert "Make reads and writes of the guard variable atomic."Eric Fiselier2019-04-081-33/+19
| | | | | | | | | | This reverts commit r357944 and r357949. These changes failed to account for the fact that the guard object is under aligned for atomic operations on 32 bit platforms (It's aligned to 4 bytes but we require 8). llvm-svn: 357958
* Fix incorrect change during refactoring.Eric Fiselier2019-04-081-1/+1
| | | | | | cxa_guard_abort should still broadcast on exit. llvm-svn: 357956
* Remove unneeded write in __cxa_guard_release.Eric Fiselier2019-04-081-1/+0
| | | | | | | The INIT_COMPLETE write now writes to the entire guard object instead of just one byte. llvm-svn: 357949
* Make reads and writes of the guard variable atomic.Eric Fiselier2019-04-081-19/+34
| | | | | | | | | | | | | | | | | | The read of the guard variable by the caller is atomic, and doesn't happen under a mutex. Our internal reads and writes were non-atomic, because they happened under a mutex. The writes should always be atomic since they can be observed outside of the lock. Making the reads atomic is not strictly necessary under the current global mutex approach, but will be under implementations that use a futex (which I plan to land shortly). However, they should add little additional cost. llvm-svn: 357944
* Further refactor cxa_guard.cppEric Fiselier2019-04-051-144/+176
| | | | | | | | | | | | | | | | | | This patch is a part of a series of patches to cleanup our implementation of __cxa_acquire et al. No functionality change was intended. This patch does two primary things. It introduces the GuardObject class to abstract the reading and writing to the guard object. In future, it will be used to ensure atomic accesses are used when needed. It also introduces the GuardValue class used to represent values of the guard object. It is an abstraction to access and write to the various different bits of a guard. llvm-svn: 357804
* Create RAII lock guard for global initialization lock.Eric Fiselier2019-04-041-81/+94
| | | | | | | | | | | | This patch is a part of a series of cleanups to cxa_guard.cpp. It should introduce no functionality change. This patch refactors the use of the global mutex and condvar into a RAII lock guard class. This improves correctness (since unlocks can't be forgotten). It also allows the unification of the non-threading and threading implementations. llvm-svn: 357669
* Always use is_initialized and set_initialized in cxa_guard.cppEric Fiselier2019-04-041-16/+8
| | | | | | | This patch is part of a series of cleanups to cxa_guard.cpp. It should have no functionality change. llvm-svn: 357668
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* [libc++abi] Delete config.hShoaib Meenai2017-03-301-1/+0
| | | | | | | | | | | | Summary: It's now completely empty, so we can remove it entirely. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31502 llvm-svn: 299129
* Turn on -Wunused-function and cleanup occurancesEric Fiselier2017-03-041-13/+12
| | | | llvm-svn: 296936
* Fix chromium build (libcxxabi)Asiri Rathnayake2017-01-261-1/+13
| | | | | | Pull the dependency on pthread_mach_thread_np() back into libcxxabi. llvm-svn: 293166
* [libcxxabi] Introduce an externally threaded libc++abi variant.Asiri Rathnayake2017-01-031-16/+16
| | | | | | | | | | r281179 Introduced an externally threaded variant of the libc++ library. This patch adds support for a similar library variant for libc++abi. Differential revision: https://reviews.llvm.org/D27575 Reviewers: EricWF llvm-svn: 290888
* [libcxxabi] Refactor pthread usage into a separate APIAsiri Rathnayake2016-10-131-19/+17
| | | | | | | | | | | | | | | | | | This patch refactors all pthread uses of libc++abi into a separate API. This is the first step towards supporting an externlly-threaded libc++abi library. I've followed the conventions already used in the libc++ library for the same purpose. Patch from: Saleem Abdulrasool and Asiri Rathnayake Reviewed by: compnerd, EricWF Differential revisions: https://reviews.llvm.org/D18482 (original) https://reviews.llvm.org/D24864 (final) llvm-svn: 284128
* [libcxxabi] cleanup the use of LIBCXXABI_HAS_NO_THREADS macro (NFC)Asiri Rathnayake2016-09-211-20/+20
| | | | | | | Align the naming / use of the macro LIBCXXABI_HAS_NO_THREADS to follow what we have in libcxx. NFC. llvm-svn: 282062
* libc++abi: fix some -Wunused-function warningsSaleem Abdulrasool2016-08-311-12/+16
| | | | | | | is_initialized is only used in the no threads case or if on non ARM Apple targets. Use the preprocessor to remove the function otherwise. NFC. llvm-svn: 280286
* ibc++abi: mark visibilitySaleem Abdulrasool2015-12-041-6/+8
| | | | | | | | | Mark functions and types with the appropriate visibility. This is particularly useful for environments which explicitly indicate origin of functions (Windows). This aids in generating libc++abi as a DSO which exposes only the public interfaces. llvm-svn: 254691
* c++abi: whitespace adjustmentSaleem Abdulrasool2015-12-041-12/+6
| | | | | | | Cleanup some code with clang-format to make the following change easier to identify material difference. NFC. llvm-svn: 254690
* Enable -Wundef.Dan Albert2015-02-051-1/+1
| | | | | | | | The problem that caused the need for http://reviews.llvm.org/D7419 was caused by testing the value of something that was undefined. This should prevent that in the future. llvm-svn: 228257
* s/LIBCXXABI_SINGLE_THREADED/LIBCXXABI_HAS_NO_THREADS/ for consistency with ↵Jonathan Roelofs2014-09-051-5/+5
| | | | | | | | | libcxx Also remove the audotedection part so that if you're crazy enough to want a single-threaded abi library, you'll say so explicitly in the build. llvm-svn: 217262
* Fix broken build from r208135Jonathan Roelofs2014-05-081-0/+1
| | | | llvm-svn: 208350
* On single threaded systems, turn mutexes into nopsJonathan Roelofs2014-05-061-2/+27
| | | | | | http://reviews.llvm.org/D3386 llvm-svn: 208135
* Missed an underscore on the last commit.Howard Hinnant2012-03-141-2/+2
| | | | llvm-svn: 152736
* Enable __arm__ on appleHoward Hinnant2012-03-141-6/+6
| | | | llvm-svn: 152735
* cxa_guard.cpp didn't quite make it on the last commit: Restricted headers ↵Howard Hinnant2012-01-251-3/+10
| | | | | | to cxa_guard.cpp and abort_messsage.h, and added a comment regarding reentrancy brought up by John McCall. Thanks John. llvm-svn: 148965
* move abort_message() to its own fileNick Kledzik2011-08-021-7/+1
| | | | llvm-svn: 136670
* Add support for the ARM EABI variant of the __cxa_guard methods, controlled byNick Lewycky2011-06-071-6/+62
| | | | | | the LIBCXXABI_ARMEABI macro. llvm-svn: 132723
* Introduce cxa_virtual.cpp and cxa_guard.cpp. Contributed by Nick Lewycky, ↵Howard Hinnant2011-05-241-0/+174
Howard Hinnant and John McCall llvm-svn: 132009
OpenPOWER on IntegriCloud