summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-04-04Uses quote to include cxxabi.h to make sure the local one is includedMehdi Amini
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@299414 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31[libc++abi] Remove missed use of config.hShoaib Meenai
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@299143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30[libc++abi] Delete config.hShoaib Meenai
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@299129 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30[libc++abi] Remove unistd.h includeShoaib Meenai
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@299087 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-04Fully Reformat fallback_malloc.cppEric Fiselier
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296960 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-04[libcxxabi] Fix alignment of allocated exceptions in 32 bit buildsEric Fiselier
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296952 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-04Turn on -Wunused-function and cleanup occurancesEric Fiselier
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296936 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02[libc++abi] Add option to enable definitions for the new/delete overloads.Eric Fiselier
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296801 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02[libc++abi] Update new/delete definitions to match libc++Eric Fiselier
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296787 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01Cleanup new/delete definitionsEric Fiselier
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296715 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01[libcxxabi] Clean up macro usage.Ranjeet Singh
Convention in libcxxabi is to use !defined(FOO) not !FOO. Differential Revision: https://reviews.llvm.org/D30459 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296612 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01[libc++abi] Clean up visibilityShoaib Meenai
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296576 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01Fix non-reserved macro names LIBCXXABI_NORETURN and LIBCXXABI_ARM_EHABI.Eric Fiselier
This patch adds the required leading underscore to those macros. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296567 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24[libcxxabi] Fix condition typo in rL296136Ranjeet Singh
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296146 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24[libcxxabi] Disable calls to fprintf for baremetal targets.Ranjeet Singh
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-15Fix couple of test failures when using the LIBCXXABI_SILENT_TERMINATE mode.Asiri Rathnayake
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@295175 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09[libcxxabi][CMake] Support in-tree libunwind when building as part of runtimesPetr Hosek
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@294552 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31Add support for demangling C++11 thread_local variables. In clang, the ↵David Bozier
grammar for mangling for these names are "<special-name> ::= TW <object name>" for wrapper variables or "<special-name> ::= TH <object name>" for initialization variables. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@293638 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-27Fix ASAN failure in cxa_demangleMehdi Amini
Found with ASAN + libFuzzer by Kostya Serebryany <kcc@google.com> git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@293330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26Fix chromium build (libcxxabi)Asiri Rathnayake
Pull the dependency on pthread_mach_thread_np() back into libcxxabi. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@293166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24cxa_demangle: fix rvalue ref checkSaleem Abdulrasool
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! git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@292973 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24cxa_demangle: avoid butchering the last parameter typeSaleem Abdulrasool
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@292963 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18Revert r286788Jonathan Roelofs
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@292418 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13[libc++abi] Add a silent terminate handler to libcxxabi.James Y Knight
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@291946 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09[libcxxabi] Cleanup and adapt for r291275. NFC.Asiri Rathnayake
+ 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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@291440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04tweak definition to avoid GCC warningSaleem Abdulrasool
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@290937 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03[libcxxabi] Introduce an externally threaded libc++abi variant.Asiri Rathnayake
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@290888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03Fix new/delete exception specifications to match libc++ after r290845Eric Fiselier
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@290847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31clean up `-Wmisleading-indentation` warningSaleem Abdulrasool
Clean up the misleading indentation warning from GCC 6. NFC git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@290788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02Update implementation of ABI support for throwing noexcept function pointersRichard Smith
and catching as non-noexcept to match the final design per discusson on cxx-abi-dev. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@288457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18__cxa_demangle: use default member initializationSaleem Abdulrasool
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@287364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18Rename TU names to not conflict with libc++.Eric Fiselier
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@287327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14__cxa_demangle: allow demangling invocation blocksSaleem Abdulrasool
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@286793 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14__cxa_demangle: ensure that we have a mangled symbolSaleem Abdulrasool
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@286788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-13arm: Fix ttype encoding assertion failure.Logan Chien
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@286760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02[p0012] Implement ABI support for throwing a noexcept function pointer andRichard Smith
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@285867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25Get libc++abi building with LLVM_ENABLE_MODULESEric Fiselier
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@285107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15Fix typo in commentVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@284295 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14Don't compile cxa_thread_atexit.cpp with -DLIBCXX_ENABLE_THREADS=OFFVitaly Buka
Reviewers: rmaprath Subscribers: beanz, mgorny Differential Revision: https://reviews.llvm.org/D25636 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@284294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13[libcxxabi] Fix gcc build after r284128Asiri Rathnayake
NFC. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@284141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13[libcxxabi] Refactor pthread usage into a separate APIAsiri Rathnayake
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) git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@284128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12Provide a fallback __cxa_thread_atexit() implementation. Patch from Tavian ↵Eric Fiselier
Barnes git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@283988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09[libc++abi] Fix bug which cased the static libunwind to always be chosenEric Fiselier
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@283699 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07Recommit r282692: [libc++abi] Use fallback_malloc to allocate ↵Igor Kudrin
__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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@283531 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29Revert r282692: Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin
dynamic memory exhaustion. The test breaks build bots. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@282703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29[libc++abi] Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@282692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23annotate more function visibilitySaleem Abdulrasool
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@282300 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21[libcxxabi] cleanup the use of LIBCXXABI_HAS_NO_THREADS macro (NFC)Asiri Rathnayake
Align the naming / use of the macro LIBCXXABI_HAS_NO_THREADS to follow what we have in libcxx. NFC. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@282062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31libc++abi: fix some -Wunused-function warningsSaleem Abdulrasool
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@280286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31Wrap LIBCXXABI_USE_LLVM_UNWINDER with defined().Logan Chien
This commit fixes -Wundef by replacing: #if !LIBCXXABI_USE_LLVM_UNWINDER with: #if !defined(LIBCXXABI_USE_LLVM_UNWINDER) git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@280251 91177308-0d34-0410-b5e6-96231b3b80d8