summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src/cxa_exception.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NFC][libc++abi] Convert stray tabs to spacesLouis Dionne2019-10-021-9/+9
| | | | llvm-svn: 373524
* [libc++abi] Remove uses of C++ headers when possibleLouis Dionne2019-10-011-6/+5
| | | | | | | | | | This reduces the (circular) dependency of libc++abi on a C++ standard library. Outside of the demangler which uses fancier C++ features, the only C++ headers now required by libc++abi are pretty much <new> and <exception>, and that's because libc++abi defines some types that are declared in those headers. llvm-svn: 373381
* [NFC][libc++abi] Remove trailing whitespace from sourcesLouis Dionne2019-10-011-21/+21
| | | | llvm-svn: 373379
* libcxxabi: Rename .hpp files to .hNico Weber2019-08-121-2/+2
| | | | | | | | LLVM uses .h as its extension for header files. Differential Revision: https://reviews.llvm.org/D65981 llvm-svn: 368604
* [NFC] Correct outdated links to the Itanium C++ ABI documentationLouis Dionne2019-04-111-1/+1
| | | | | | | | Those are now hosted on GitHub. rdar://problem/36557462 llvm-svn: 358191
* 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
* Make libc++abi work better with gcc's ARM unwind library. Reviewed as ↵Marshall Clow2018-10-101-15/+30
| | | | | | https://reviews.llvm.org/D42242 llvm-svn: 344152
* Move _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS macro to build systemNico Weber2018-04-291-2/+0
| | | | | | | | | | | | | | | _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS is currently used to bring back std::unexpected, which is removed in C++17, but still needed for libc++abi for backward compatibility. This macro used to define in cxa_exception.cpp only, but actually needed for all sources that touches exceptions. So, a build-system-level macro is better fit to define this macro. https://reviews.llvm.org/D46056 Patch from Taiju Tsuiku <tzik@chromium.org>! llvm-svn: 331150
* [libc++abi] Replace __sync_* functions with __libcpp_atomic_* functions.Eli Friedman2018-04-161-2/+3
| | | | | | | | | | | This is basically part 2 of r313694. It's a little unfortunate that I had to copy-paste atomic_support.h, but I don't really see any alternative. The refstring.h changes are the same as the libcxx changes in r313694. llvm-svn: 330162
* [CFI] Disable CFI checks for __cxa_decrement_exception_refcountVlad Tsyrklevich2018-04-091-2/+2
| | | | | | | | | | | | | | | | | Summary: exception_header->exceptionDestructor is a void(*)(void*) function pointer; however, it can point to destructors like std:: exception::~exception that don't match that type signature. Reviewers: pcc, vitalybuka Reviewed By: vitalybuka Subscribers: kcc, christof, cfe-commits Differential Revision: https://reviews.llvm.org/D45455 llvm-svn: 329629
* Fix compilation in C++17 mode.Richard Smith2018-02-071-0/+2
| | | | | | | | | | | C++17 removes `std::unexpected_handler`, but libc++abi needs it to define `__cxa_exception`. When building against libc++, this is easily rectified by telling libc++ we're building the library. We already do this in the other places where we need these symbols. Differential Revision: https://reviews.llvm.org/D42987 llvm-svn: 324542
* Insert padding before the __cxa_exception header to ensure the thrownAkira Hatanaka2017-11-281-4/+36
| | | | | | | | | | | | | | | | | | | | object is sufficiently aligned. r303175 annotated field unwindHeader of __cxa_exception with attribute 'aligned' to ensure the thrown object following the __cxa_exception header was sufficiently aligned. This caused changes in the field offsets of __cxa_exception relative to the start of the thrown object, which was an ABI breaking change for some clients. Instead of annotating field unwindHeader, this commit inserts extra space before the header. This ensures the thrown object following the header is sufficiently aligned without changing the field offsets, thus avoiding any ABI breakages. rdar://problem/25364625 rdar://problem/35556163 llvm-svn: 319123
* Fix ASAN build with older compiler-rt versions.Eric Fiselier2017-09-141-3/+2
| | | | | | | | | | | compiler-rt recently added the __asan_handle_no_return() function that libc++abi needs to use, however older versions of compiler-rt don't declare this interface publicly and that breaks the libc++abi build. This patch attempts to fix the issues by declaring the asan function explicitly, so we don't depend on compiler-rt to provide the declaration. llvm-svn: 313308
* [libc++abi] Fix ASAN build with older compiler-rt versions.Eric Fiselier2017-09-141-1/+2
| | | | | | | | | | | | | | | | | | | Summary: compiler-rt recently added the `__asan_handle_no_return()` function that libc++abi needs to use, however older versions of compiler-rt don't provide this interface and that breaks the libc++abi build. This patch attempts to fix the issues by using a macro to detect if `asan_interface.h` is new enough to provide the function. See D37871 Reviewers: phosek, vitalybuka Reviewed By: phosek, vitalybuka Subscribers: dberris, cfe-commits Differential Revision: https://reviews.llvm.org/D37872 llvm-svn: 313304
* Reland "When built with ASan, __cxa_throw calls __asan_handle_no_return"Petr Hosek2017-09-131-0/+10
| | | | | | | | | | | | | | | The ASan runtime on many systems intercepts cxa_throw just so it can call asan_handle_no_return first. Some newer systems such as Fuchsia don't use interceptors on standard library functions at all, but instead use sanitizer-instrumented versions of the standard libraries. When libc++abi is built with ASan, cxa_throw can just call asan_handle_no_return itself so no interceptor is required. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D37229 llvm-svn: 313215
* Revert "[libcxxabi] When built with ASan, __cxa_throw calls ↵Petr Hosek2017-09-061-10/+0
| | | | | | | | | __asan_handle_no_return" This reverts commit r312606 because it's causing an error on libcxx-libcxxabi-x86_64-linux-ubuntu-asan bot. llvm-svn: 312609
* [libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_returnPetr Hosek2017-09-061-0/+10
| | | | | | | | | | | | | | | | | | The ASan runtime on many systems intercepts cxa_throw just so it can call asan_handle_no_return first. Some newer systems such as Fuchsia don't use interceptors on standard library functions at all, but instead use sanitizer-instrumented versions of the standard libraries. When libc++abi is built with ASan, cxa_throw can just call asan_handle_no_return itself so no interceptor is required. This is a re-land of r311045, which has become safe after r311869 changed compiler-rt to declare __asan_handle_no_return. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D37229 llvm-svn: 312606
* Revert "[libcxxabi] When built with ASan, __cxa_throw calls ↵Petr Hosek2017-08-161-10/+0
| | | | | | | | | __asan_handle_no_return" This reverts commit r311045 because it's causing an error on libcxx-libcxxabi-x86_64-linux-ubuntu-asan bot. llvm-svn: 311047
* [libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_returnPetr Hosek2017-08-161-0/+10
| | | | | | | | | | | | | | | The ASan runtime on many systems intercepts cxa_throw just so it can call asan_handle_no_return first. Some newer systems such as Fuchsia don't use interceptors on standard library functions at all, but instead use sanitizer-instrumented versions of the standard libraries. When libc++abi is built with ASan, cxa_throw can just call asan_handle_no_return itself so no interceptor is required. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D36599 llvm-svn: 311045
* [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
* [libcxxabi] Fix alignment of allocated exceptions in 32 bit buildsEric Fiselier2017-03-041-10/+14
| | | | | | | | | | | | | | | | | Summary: In 32 bit builds on a 64 bit system `std::malloc` does not return correctly aligned memory. This leads to undefined behavior. This patch switches to using `posix_memalign` to allocate correctly aligned memory instead. Reviewers: mclow.lists, danalbert, jroelofs, compnerd Reviewed By: compnerd Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25417 llvm-svn: 296952
* [libcxxabi] Clean up macro usage.Ranjeet Singh2017-03-011-4/+4
| | | | | | | | Convention in libcxxabi is to use !defined(FOO) not !FOO. Differential Revision: https://reviews.llvm.org/D30459 llvm-svn: 296612
* [libc++abi] Clean up visibilityShoaib Meenai2017-03-011-15/+9
| | | | | | | | | | | | | | | | | Use the libc++abi visibility macros instead of pragmas or using visibility attributes directly. Clean up redundant attributes on definitions (where the declarations already have visibility attributes applied, from either libc++ or libc++abi headers). Introduce _LIBCXXABI_WEAK as a drive-by cleanup, which matches the semantics of _LIBCPP_WEAK. No functional change. Tested by building on Linux before and after this change and verifying that the list of exported symbols is identical. Differential Revision: https://reviews.llvm.org/D26949 llvm-svn: 296576
* Fix non-reserved macro names LIBCXXABI_NORETURN and LIBCXXABI_ARM_EHABI.Eric Fiselier2017-03-011-7/+7
| | | | | | This patch adds the required leading underscore to those macros. llvm-svn: 296567
* [libcxxabi] Introduce an externally threaded libc++abi variant.Asiri Rathnayake2017-01-031-1/+0
| | | | | | | | | | 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-0/+1
| | | | | | | | | | | | | | | | | | 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
* Recommit r282692: [libc++abi] Use fallback_malloc to allocate ↵Igor Kudrin2016-10-071-22/+6
| | | | | | | | | | | | | | | | | __cxa_eh_globals in case of dynamic memory exhaustion. Throwing an exception for the first time may lead to call calloc to allocate memory for __cxa_eh_globals. If the memory pool is exhausted at that moment, it results in abnormal termination of the program. This patch addresses the issue by using fallback_malloc in that case. In this revision, some restrictions were added into the test to not run it in unsuitable environments. Differential Revision: https://reviews.llvm.org/D17815 llvm-svn: 283531
* Revert r282692: Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin2016-09-291-6/+22
| | | | | | | | dynamic memory exhaustion. The test breaks build bots. llvm-svn: 282703
* [libc++abi] Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin2016-09-291-22/+6
| | | | | | | | | | | | | | dynamic memory exhaustion. Throwing an exception for the first time may lead to call calloc to allocate memory for __cxa_eh_globals. If the memory pool is exhausted at that moment, it results in abnormal termination of the program. This patch addresses the issue by using fallback_malloc in that case. Differential Revision: https://reviews.llvm.org/D17815 llvm-svn: 282692
* [libcxxabi] cleanup the use of LIBCXXABI_HAS_NO_THREADS macro (NFC)Asiri Rathnayake2016-09-211-1/+1
| | | | | | | Align the naming / use of the macro LIBCXXABI_HAS_NO_THREADS to follow what we have in libcxx. NFC. llvm-svn: 282062
* Fix ARM __cxa_end_cleanup() and gc-sections.Logan Chien2015-12-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This commit adds SHF_ALLOC and SHF_EXECINSTR section flags to `.text.__cxa_end_cleanup` section. This fixes a link error when we are using integrated-as and `ld.gold` (with `-Wl,--gc-sections` and `-Wl,--fatal-warnings`.) Detailed Explanation: 1. There might be some problem with LLVM integrated-as. It is not emitting any section flags for text sections. (This will be fixed in an independent commit.) 2. `ld.gold` will skip the external symbols in the section without SHF_ALLOC. This is the reason why `.text.__cxa_end_cleanup_impl` section is discarded even though it is referenced by `__cxa_end_cleanup()`. This commit workaround the problem by specifying the section flags explicitly. Fix http://llvm.org/PR21292 llvm-svn: 256241
* ibc++abi: mark visibilitySaleem Abdulrasool2015-12-041-12/+14
| | | | | | | | | 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-26/+12
| | | | | | | Cleanup some code with clang-format to make the following change easier to identify material difference. NFC. llvm-svn: 254690
* c++abi: use __builtin_offsetof instead of offsetofSaleem Abdulrasool2015-11-181-8/+9
| | | | | | | | | Use `__builtin_offsetof` in place of `offsetof`. Certain environments provide a macro definition of `offsetof` which may end up causing issues. This was observed on Windows. Use `__builtin_offsetof` to ensure correct evaluation everywhere. NFC. llvm-svn: 253435
* Implement uncaught_exceptions() to get a count, rather than a bool. Update ↵Marshall Clow2015-06-021-3/+6
| | | | | | the libc++abi version. Reviewed as http://reviews.llvm.org/D10067 llvm-svn: 238827
* Formatting fixes.Dan Albert2015-02-051-5/+3
| | | | | | | We should clang-format the whole thing when we finally move the unwinder to its new home. llvm-svn: 228360
* Enable -Wundef.Dan Albert2015-02-051-3/+3
| | | | | | | | 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-1/+1
| | | | | | | | | 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
* Update libc++abi to use the ARM EHABI unwinder from its libunwind.Nico Weber2014-06-251-2/+11
| | | | llvm-svn: 211745
* Implement ARM EHABI exception handling.Logan Chien2014-05-101-0/+95
| | | | | | | This commit implements the ARM zero-cost exception handling support for libc++abi. llvm-svn: 208466
* On single threaded systems, turn mutexes into nopsJonathan Roelofs2014-05-061-2/+4
| | | | | | http://reviews.llvm.org/D3386 llvm-svn: 208135
* Fixes incorrect #ifs for SJ/LJ exceptionsDan Albert2014-04-231-3/+3
| | | | | | | The was working because, given __APPLE__, _LIBUNWIND_BUILD_SJLJ_APIS was set to __arm__, but other ARM targets not using SJ/LJ will fail to compile. llvm-svn: 206941
* [libcxxabi] Fix broken codesourcery.com links in commentsJonathan Roelofs2014-02-121-1/+1
| | | | | review: http://llvm-reviews.chandlerc.com/D2718 llvm-svn: 201208
* Demangler update: This now demangles many more (all?) C++11 symbols. ↵Howard Hinnant2013-06-171-1/+1
| | | | | | Demangler tests updated. llvm-svn: 184097
* Bruce Mitchener: Typo fixes.Howard Hinnant2013-02-151-2/+2
| | | | llvm-svn: 175275
* First attempt at arm support.Howard Hinnant2012-02-291-2/+2
| | | | llvm-svn: 151765
* Work on restricting symbol visibility.Howard Hinnant2012-02-021-0/+4
| | | | llvm-svn: 149633
* Teach exception_cleanup_func about dependent exceptions.Howard Hinnant2012-02-011-6/+3
| | | | llvm-svn: 149520
* Treat all exceptions except that the ones that this library throws as ↵Howard Hinnant2012-02-011-2/+2
| | | | | | foreign. Even other C++ exceptions. llvm-svn: 149518
* Removed debugging print statementsHoward Hinnant2012-01-301-9/+0
| | | | llvm-svn: 149271
OpenPOWER on IntegriCloud