summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
Commit message (Collapse)AuthorAgeFilesLines
...
* [libc++abi] Disable libc++ extern templates project-wideShoaib Meenai2017-05-101-1/+0
| | | | | | | | | | | | | | libc++abi can't depend on libc++, so disable extern templates in libc++ headers project-wide. This was previously done in cxa_demangle.cpp, but I consider it more appropriate to do at the cmake level (since none of libc++abi's source files can use libc++ extern templates). I also think the _LIBCPP_NO_EXCEPTIONS in cxa_demangle.cpp is suspicious, but I'm doing one thing at a time. Differential Revision: https://reviews.llvm.org/D32329 llvm-svn: 302739
* Uses quote to include cxxabi.h to make sure the local one is includedMehdi Amini2017-04-042-2/+2
| | | | llvm-svn: 299414
* [libc++abi] Remove missed use of config.hShoaib Meenai2017-03-311-1/+0
| | | | llvm-svn: 299143
* [libc++abi] Delete config.hShoaib Meenai2017-03-308-24/+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
* [libc++abi] Remove unistd.h includeShoaib Meenai2017-03-301-2/+0
| | | | | | | | | | | This was originally there for the _POSIX_THREADS define, to detect the presence of pthreads. That went away with the externalized threading support, so the include can go away too. config.h is now completely empty. A follow-up commit will remove it entirely. llvm-svn: 299087
* Fully Reformat fallback_malloc.cppEric Fiselier2017-03-041-140/+146
| | | | | | | | | | | | This patch fully reformats fallback_malloc.cpp. Previously the test was a mess of different styles and indentations. This made it very hard to work in and read. Therefore I felt it was best to re-format the whole thing. Unfortuantly this means some history will be lost, but hopefully much of it will still be accessible after ignoring whitespace changes. llvm-svn: 296960
* [libcxxabi] Fix alignment of allocated exceptions in 32 bit buildsEric Fiselier2017-03-043-16/+46
| | | | | | | | | | | | | | | | | 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
* Turn on -Wunused-function and cleanup occurancesEric Fiselier2017-03-041-13/+12
| | | | llvm-svn: 296936
* [libc++abi] Add option to enable definitions for the new/delete overloads.Eric Fiselier2017-03-021-4/+3
| | | | | | | | | | | | | | | | | | | | Summary: Currently both libc++ and libc++abi provide definitions for operator new/delete. However I believe this is incorrect and that one or the other should offer them. This patch adds the CMake option `-DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS` which defaults to `OFF` unless otherwise specified. This means that by default only libc++ provides the new/delete definitions. Reviewers: mclow.lists, mehdi_amini, dexonsmith, beanz, jroelofs, danalbert, smeenai, rmaprath, mgorny Reviewed By: mehdi_amini Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30517 llvm-svn: 296801
* [libc++abi] Update new/delete definitions to match libc++Eric Fiselier2017-03-021-71/+157
| | | | | | | | | | | | | | | | | | | | | Summary: Currently both libc++ and libc++abi provide definitions for new/delete. However libc++abi's definitions haven't been updated to include aligned new/delete or sized deallocation. I don't see any reason why libc++abi shouldn't provide these newer overloads. This patch copies libc++'s implementation of `new/delete` into libc++abi so that it's now up to date. After applying this patch I plan to fix a longstanding bug where both libc++ and libc++abi provide definitions for new/delete. Reviewers: mclow.lists, mehdi_amini, dexonsmith, danalbert, smeenai, rmaprath, jroelofs Reviewed By: mehdi_amini Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30514 llvm-svn: 296787
* Cleanup new/delete definitionsEric Fiselier2017-03-013-67/+71
| | | | | | | | | | | | | | | | | | | | This patch cleans up how libc++abi handles the definitions for new/delete. It is in preperation for upcoming changes to fix how both libc++ and libc++abi handle new/delete. The primary changes in this patch are: * Move the definitions for bad_array_length and bad_new_array_length into stdlib_exception.cpp. This way stdlib_new_delete.cpp only contains new/delete. * Rename cxa_new_delete.cpp -> stdlib_new_delete.cpp for consistency with other files. * Add a FIXME regarding when stdlib_new_delete.cpp is actually compiled as part of the dylib. llvm-svn: 296715
* [libcxxabi] Clean up macro usage.Ranjeet Singh2017-03-016-34/+20
| | | | | | | | 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-0115-99/+41
| | | | | | | | | | | | | | | | | 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-015-25/+25
| | | | | | This patch adds the required leading underscore to those macros. llvm-svn: 296567
* [libcxxabi] Fix condition typo in rL296136Ranjeet Singh2017-02-241-1/+1
| | | | | | | | | Made a mistake in the condition typo because LIBCXXABI_BAREMETAL is always defined, I should have been checking the contents to see if it's enabled. Differential Revision: https://reviews.llvm.org/D30343 llvm-svn: 296146
* [libcxxabi] Disable calls to fprintf for baremetal targets.Ranjeet Singh2017-02-241-0/+2
| | | | | | | | | | We've been having issues with using libcxxabi and libunwind for baremetal targets because fprintf is dependent on io functions, this patch disables calls to fprintf when building for baremetal in release mode. Differential Revision: https://reviews.llvm.org/D30339 llvm-svn: 296136
* Fix couple of test failures when using the LIBCXXABI_SILENT_TERMINATE mode.Asiri Rathnayake2017-02-151-1/+1
| | | | | | | | | | | | | When libcxxabi is built in LIBCXXABI_SILENT_TERMINATE mode, libcxx test suite reports two failures: std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp std/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp This is because the default unexpected handler is set to std::abort instead of std::terminate which these tests expect. llvm-svn: 295175
* [libcxxabi][CMake] Support in-tree libunwind when building as part of runtimesPetr Hosek2017-02-091-2/+2
| | | | | | | | | | | When building as part of runtimes, there is no predefined order in which the runtimes are loaded, so the targets from other projects might not be available. We need to rely on HAVE_<name> variables instead in that case. Differential Revision: https://reviews.llvm.org/D29574 llvm-svn: 294552
* Add support for demangling C++11 thread_local variables. In clang, the ↵David Bozier2017-01-311-0/+24
| | | | | | grammar for mangling for these names are "<special-name> ::= TW <object name>" for wrapper variables or "<special-name> ::= TH <object name>" for initialization variables. llvm-svn: 293638
* Fix ASAN failure in cxa_demangleMehdi Amini2017-01-271-1/+2
| | | | | | Found with ASAN + libFuzzer by Kostya Serebryany <kcc@google.com> llvm-svn: 293330
* Fix chromium build (libcxxabi)Asiri Rathnayake2017-01-261-1/+13
| | | | | | Pull the dependency on pthread_mach_thread_np() back into libcxxabi. llvm-svn: 293166
* cxa_demangle: fix rvalue ref checkSaleem Abdulrasool2017-01-241-1/+2
| | | | | | | | | | | | When checking if the type is a r-value ref, we would not do a complete check. This would result in us treating a trailing parameter reference `&)` as a r-value ref, and improperly inject the cv qualifier on the type. We now correctly demangle the type `KFvRmE` as a constant function rather than a constant reference. Fixes PR31741! llvm-svn: 292973
* cxa_demangle: avoid butchering the last parameter typeSaleem Abdulrasool2017-01-241-2/+2
| | | | | | | | | | | Fix an off-by-one case which would destroy the final parameter in a CV-qualified function type with a reference. We still get the CV qualification incorrect, but at least we do not clobber the type name any longer. Partially fixes PR31741. llvm-svn: 292963
* Revert r286788Jonathan Roelofs2017-01-181-11/+1
| | | | | | | | | | | | | | | | The Itanium ABI [1] specifies that __cxa_demangle accept either: 1) symbol names, which start with "_Z" 2) type manglings, which do not start with "_Z" r286788 erroneously assumes that it should only handle symbols, so this patch reverts it and adds a counterexample to the testcase. 1: https://mentorembedded.github.io/cxx-abi/abi.html#demangler Reviewers: zygoloid, EricWF llvm-svn: 292418
* [libc++abi] Add a silent terminate handler to libcxxabi.James Y Knight2017-01-132-2/+17
| | | | | | | | | | | | | | | | | | | | The current std::terminate_handler pulls in some string code, some I/O code, and more. Since it is automatically setup as the default, this means that any trivial binary linking against libcxxabi will get this extra bloat. This patch allows disabling it as a build-time option, if you want to avoid the extra bloat. Patch by Tom Rybka! Reviewers: EricWF Subscribers: danalbert, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28497 llvm-svn: 291946
* [libcxxabi] Cleanup and adapt for r291275. NFC.Asiri Rathnayake2017-01-091-35/+0
| | | | | | | | | | | + Now that libcxxabi shares the same threading API as libcxx, a whole chunk of code in src/config.h is made redundant (I missed this earlier). + r291275 split off the externalized-thread-api libcxx configuration from the external-thread-library libcxx configuration. libcxxabi should follow the same approach. llvm-svn: 291440
* tweak definition to avoid GCC warningSaleem Abdulrasool2017-01-041-1/+3
| | | | | | | | Use an `extern "C" { }` block around the definition rather than doing the inline definition. This avoids a GCC warning about a declaration being extern and having a definition. NFC. llvm-svn: 290937
* [libcxxabi] Introduce an externally threaded libc++abi variant.Asiri Rathnayake2017-01-037-148/+44
| | | | | | | | | | 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
* Fix new/delete exception specifications to match libc++ after r290845Eric Fiselier2017-01-031-44/+13
| | | | llvm-svn: 290847
* clean up `-Wmisleading-indentation` warningSaleem Abdulrasool2016-12-311-2/+2
| | | | | | Clean up the misleading indentation warning from GCC 6. NFC llvm-svn: 290788
* Update implementation of ABI support for throwing noexcept function pointersRichard Smith2016-12-022-77/+24
| | | | | | | and catching as non-noexcept to match the final design per discusson on cxx-abi-dev. llvm-svn: 288457
* __cxa_demangle: use default member initializationSaleem Abdulrasool2016-11-181-14/+7
| | | | | | | | Sink the Db initialization into the structure rather than out-of-line at the declaration size. This just makes it easier to see what initialization is being performed. NFC. llvm-svn: 287364
* Rename TU names to not conflict with libc++.Eric Fiselier2016-11-184-4/+7
| | | | | | | | | | In order to easily merge libc++ and libc++abi static archives it's important that none of the source files share the same name. (See http://stackoverflow.com/questions/3821916/how-to-merge-two-ar-static-libraries-into-one) This patch renames source files which share a name with libc++ sources. llvm-svn: 287327
* __cxa_demangle: allow demangling invocation blocksSaleem Abdulrasool2016-11-141-4/+7
| | | | | | | | | | | | The block invocation function uses an extension where the prefix is ___Z as opposed to _Z. This should make the tests pass again. Disable a negative test which was testing a crasher. The symbol being demangled is not a valid mangled symbol and will return a nullptr. Adjust the type info decoding test to be a valid symbol name. llvm-svn: 286793
* __cxa_demangle: ensure that we have a mangled symbolSaleem Abdulrasool2016-11-141-1/+9
| | | | | | | | | | | | Ensure that we have a mangled symbol before attempting to demangle it. We would previously treat any input as a mangled symbol rather than checking that the symbol has the initial C++ Itanium v3 mangling prefix of `_Z`. This changes the behaviour from the previous case which would undecorate `f` to `float` rather than nullptr as it should. Unfortunately, we do not have any negative testing for the demangler. llvm-svn: 286788
* arm: Fix ttype encoding assertion failure.Logan Chien2016-11-131-2/+8
| | | | | | | | GCC 4.7 or newer emits 0x90 (indirect | pcrel) as the ttype encoding. This would hit an assertion in cxa_personality.cpp. This commit fixes the problem by relaxing the assertion. llvm-svn: 286760
* [p0012] Implement ABI support for throwing a noexcept function pointer andRichard Smith2016-11-022-1/+73
| | | | | | | | | | | | | | | | catching as non-noexcept This implements the following proposal from cxx-abi-dev: http://sourcerytools.com/pipermail/cxx-abi-dev/2016-October/002988.html ... which is necessary for complete support of http://wg21.link/p0012, specifically throwing noexcept function and member function pointers and catching them as non-noexcept pointers. Differential Review: https://reviews.llvm.org/D26178 llvm-svn: 285867
* Get libc++abi building with LLVM_ENABLE_MODULESEric Fiselier2016-10-251-0/+6
| | | | llvm-svn: 285107
* Fix typo in commentVitaly Buka2016-10-151-1/+1
| | | | llvm-svn: 284295
* Don't compile cxa_thread_atexit.cpp with -DLIBCXX_ENABLE_THREADS=OFFVitaly Buka2016-10-141-1/+1
| | | | | | | | | | Reviewers: rmaprath Subscribers: beanz, mgorny Differential Revision: https://reviews.llvm.org/D25636 llvm-svn: 284294
* [libcxxabi] Fix gcc build after r284128Asiri Rathnayake2016-10-131-0/+4
| | | | | | NFC. llvm-svn: 284141
* [libcxxabi] Refactor pthread usage into a separate APIAsiri Rathnayake2016-10-137-51/+185
| | | | | | | | | | | | | | | | | | 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
* Provide a fallback __cxa_thread_atexit() implementation. Patch from Tavian ↵Eric Fiselier2016-10-121-6/+119
| | | | | | Barnes llvm-svn: 283988
* [libc++abi] Fix bug which cased the static libunwind to always be chosenEric Fiselier2016-10-091-7/+7
| | | | llvm-svn: 283699
* Recommit r282692: [libc++abi] Use fallback_malloc to allocate ↵Igor Kudrin2016-10-075-43/+97
| | | | | | | | | | | | | | | | | __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-295-97/+43
| | | | | | | | 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-295-43/+97
| | | | | | | | | | | | | | 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
* annotate more function visibilitySaleem Abdulrasool2016-09-232-10/+10
| | | | | | | | These data and text symbols were missing annotations for building with hidden visibility. As we do not currently enable hidden visibility by default, this is a NFC for the buildbots. llvm-svn: 282300
* [libcxxabi] cleanup the use of LIBCXXABI_HAS_NO_THREADS macro (NFC)Asiri Rathnayake2016-09-215-35/+30
| | | | | | | 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
OpenPOWER on IntegriCloud