Logan Chien
338d6de5fa
Fix ARM __cxa_end_cleanup() and gc-sections.
...
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
2015-12-22 14:38:30 +00:00
Saleem Abdulrasool
12315edf03
ibc++abi: mark visibility
...
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
2015-12-04 02:14:58 +00:00
Saleem Abdulrasool
242d67b687
c++abi: whitespace adjustment
...
Cleanup some code with clang-format to make the following change easier to
identify material difference. NFC.
llvm-svn: 254690
2015-12-04 02:14:41 +00:00
Saleem Abdulrasool
e113b5e9af
c++abi: use __builtin_offsetof instead of offsetof
...
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
2015-11-18 05:33:38 +00:00
Marshall Clow
604de5c256
Implement uncaught_exceptions() to get a count, rather than a bool. Update the libc++abi version. Reviewed as http://reviews.llvm.org/D10067
...
llvm-svn: 238827
2015-06-02 13:03:17 +00:00
Dan Albert
b98c20cf7c
Formatting fixes.
...
We should clang-format the whole thing when we finally move the
unwinder to its new home.
llvm-svn: 228360
2015-02-05 23:48:06 +00:00
Dan Albert
3bd13ca4e1
Enable -Wundef.
...
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
2015-02-05 01:33:15 +00:00
Jonathan Roelofs
3b7f085db1
s/LIBCXXABI_SINGLE_THREADED/LIBCXXABI_HAS_NO_THREADS/ for consistency with 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
2014-09-05 17:46:40 +00:00
Nico Weber
ae5438701e
Update libc++abi to use the ARM EHABI unwinder from its libunwind.
...
llvm-svn: 211745
2014-06-25 23:52:07 +00:00
Logan Chien
dc65ab4cef
Implement ARM EHABI exception handling.
...
This commit implements the ARM zero-cost exception handling
support for libc++abi.
llvm-svn: 208466
2014-05-10 00:42:10 +00:00
Jonathan Roelofs
40e9842854
On single threaded systems, turn mutexes into nops
...
http://reviews.llvm.org/D3386
llvm-svn: 208135
2014-05-06 21:30:56 +00:00
Dan Albert
0056c8eb01
Fixes incorrect #ifs for SJ/LJ exceptions
...
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
2014-04-23 04:45:42 +00:00
Jonathan Roelofs
c5f7e6fe67
[libcxxabi] Fix broken codesourcery.com links in comments
...
review: http://llvm-reviews.chandlerc.com/D2718
llvm-svn: 201208
2014-02-12 04:49:09 +00:00
Howard Hinnant
862c4a06ee
Demangler update: This now demangles many more (all?) C++11 symbols. Demangler tests updated.
...
llvm-svn: 184097
2013-06-17 18:10:34 +00:00
Howard Hinnant
be2eced483
Bruce Mitchener: Typo fixes.
...
llvm-svn: 175275
2013-02-15 15:48:49 +00:00
Howard Hinnant
20d6c14c88
First attempt at arm support.
...
llvm-svn: 151765
2012-02-29 22:14:19 +00:00
Howard Hinnant
eaa65afc7b
Work on restricting symbol visibility.
...
llvm-svn: 149633
2012-02-02 20:47:28 +00:00
Howard Hinnant
d0bfbb336f
Teach exception_cleanup_func about dependent exceptions.
...
llvm-svn: 149520
2012-02-01 18:44:21 +00:00
Howard Hinnant
8aa78517ab
Treat all exceptions except that the ones that this library throws as foreign. Even other C++ exceptions.
...
llvm-svn: 149518
2012-02-01 18:15:15 +00:00
Howard Hinnant
2c50972c32
Removed debugging print statements
...
llvm-svn: 149271
2012-01-30 20:13:37 +00:00
Howard Hinnant
47cb854818
Add a descriptive name for a constant. Also I'm at least temporarily waging war on throw specs, both old and new style. Except where we have already publicly exposed the throw spec, I'm getting rid of them. They may come back later. But they seem somewhat prone to cyclic dependencies here. The throw spec implies compiler generated code that this library has to jump to during stack unwinding. I'd like to minimize the possiblity that the code used to properly make that jump is itself creating such jumps.
...
llvm-svn: 149251
2012-01-30 16:07:00 +00:00
Howard Hinnant
9aa4684fbb
Minor updates to a couple of comments.
...
llvm-svn: 149158
2012-01-28 00:34:46 +00:00
Howard Hinnant
abc770690a
By changing all of the throw() specs to noexcept I've been able to compile and link all of the source files into a dylib. Prior to this substitution the changed functions were calling __cxa_call_unexpected which isn't implemented yet. However in none of these cases do we actaully want __cxa_call_unexpected to be called. Primative buildit script added.
...
llvm-svn: 148880
2012-01-24 23:42:30 +00:00
Howard Hinnant
73ab1864ef
Marshall Clow reminded me that fallback_malloc.cpp was broken out for testing purposes. We've agreed to simply rename fallback_malloc.cpp to fallback_malloc.ipp. Thanks Marshall.
...
llvm-svn: 148863
2012-01-24 21:41:27 +00:00
Howard Hinnant
378a59f15c
Got fooled by fallback_malloc.cpp source file: it is really a private header. I've manually included it into the only place it is used: cxa_exception.cpp.
...
llvm-svn: 148854
2012-01-24 21:02:21 +00:00
Howard Hinnant
6830b2a493
Move kOurExceptionClass and kOurDependentExceptionClass from source to header so that they can be used in multiple sources. This is a private header, these constants are not publicly exposed.
...
llvm-svn: 148827
2012-01-24 18:15:20 +00:00
Howard Hinnant
e33b2f5c97
Changed my mind about __cxa_uncaught_exception and added it.
...
llvm-svn: 148754
2012-01-24 00:01:31 +00:00
Howard Hinnant
afcf7ac5f6
I kept getting confused among the __cxa_exception*, the _Unwind_Exception* and the void* to the thrown object. So I've gone through these two files and attempted to institute a consistent variable naming scheme, and in a few instances, turned void* into a concrete* to have the type system help me out. No change in functionality for this commit is intended.
...
llvm-svn: 148663
2012-01-22 19:14:27 +00:00
Howard Hinnant
7530f19d03
Add a few TODO's and FIXME's. Making notes as I go along, but not slowing down to fix these yet. Just don't want anything to fall through the cracks.
...
llvm-svn: 147760
2012-01-08 23:40:41 +00:00
Marshall Clow
d2bab35080
Improved comment to explain why we can use __cxa_get_globals_fast here
...
llvm-svn: 147554
2012-01-04 22:18:10 +00:00
Howard Hinnant
66d9327b80
Just getting started on the personality routine. This is just a skeleton. Still learning how to fill it in...
...
llvm-svn: 147547
2012-01-04 20:49:43 +00:00
Marshall Clow
f368486f4c
Better comment
...
llvm-svn: 147532
2012-01-04 14:56:09 +00:00
Marshall Clow
f83663a9cd
Don't allocate TLS storage when checking to see if an exception has been thrown - really
...
llvm-svn: 147497
2012-01-03 23:26:09 +00:00
Marshall Clow
3e417e7a5c
Don't allocate TLS storage when checking to see if an exception has been thrown
...
llvm-svn: 147492
2012-01-03 23:10:20 +00:00
Howard Hinnant
f5bde09cc1
credits adjustment
...
llvm-svn: 147148
2011-12-22 16:00:06 +00:00
Marshall Clow
1de4fc0dfa
Updated __cxa_current_exception_type to call __cxa_get_globals_fast - will not allocate globals
...
llvm-svn: 147147
2011-12-22 15:45:05 +00:00
Howard Hinnant
22f28b2d52
Forgot to increment uncaughtExceptions in __cxa_rethrow_primary_exception
...
llvm-svn: 147108
2011-12-21 23:48:05 +00:00
Howard Hinnant
e04f51662c
Added __cxa_increment_exception_refcount, __cxa_decrement_exception_refcount, __cxa_current_primary_exception, __cxa_rethrow_primary_exception
...
llvm-svn: 147106
2011-12-21 23:32:11 +00:00
Howard Hinnant
58926c9a9b
Made some minor tweaks to __cxa_rethrow
...
llvm-svn: 146396
2011-12-12 19:11:42 +00:00
Howard Hinnant
7fcad54836
Added dependent exception support to __cxa_current_exception_type
...
llvm-svn: 146381
2011-12-12 18:16:10 +00:00
Howard Hinnant
6ccae15ef0
Modified __cxa_end_catch to handle dependent exceptions.
...
llvm-svn: 146172
2011-12-08 19:35:18 +00:00
Howard Hinnant
5ec9183afc
Reviewing cxa_exception.cpp and marking as implemented as I go. Not marking as implemented on arm when I'm not sure about that platform.
...
llvm-svn: 146072
2011-12-07 21:16:40 +00:00
Howard Hinnant
dfb34fcb1a
Substituted std::get_terminate() for direct access to the handler function pointer (which is now a static in cxa_handlers.cpp). This has the advantage of going through the atomic API and so is less likely to cause a data race. Ditto for unexpected.
...
llvm-svn: 145951
2011-12-06 19:02:03 +00:00
Marshall Clow
9b454bc912
reformatted to match Clang style; thanks to John McCall for the nudge
...
llvm-svn: 137623
2011-08-15 18:06:47 +00:00
Marshall Clow
8769449b61
First cut at exception handling; missing dependent exceptions. Next step: tests
...
llvm-svn: 137118
2011-08-09 15:09:41 +00:00
Marshall Clow
7c9f1fa9cf
Remove include reference to non-existant file cxa_exception_storage.hpp
...
llvm-svn: 137046
2011-08-08 15:12:08 +00:00
Howard Hinnant
c6b4318b9a
Update status: http://libcxxabi.llvm.org/spec.html . Looking good! :-)
...
llvm-svn: 135590
2011-07-20 16:32:57 +00:00
Marshall Clow
e2dcb75b2e
Memory manangement routines for exception objects
...
llvm-svn: 135587
2011-07-20 15:04:39 +00:00