summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
Commit message (Collapse)AuthorAgeFilesLines
...
* [demangler] Use _LIBCPP_UNREACHABLE()Erik Pilkington2017-08-011-2/+2
| | | | llvm-svn: 309649
* [demangler] Fix some bugs in r309340 found by oss-fuzzErik Pilkington2017-07-301-7/+20
| | | | llvm-svn: 309520
* [demangler] Fix some overzealous -Wreturn-type errorsErik Pilkington2017-07-281-0/+2
| | | | llvm-svn: 309349
* [demangler] Attempt to fix linux bots, include <cstdio>Erik Pilkington2017-07-281-0/+1
| | | | llvm-svn: 309342
* [demangler] Use an AST to represent demangled namesErik Pilkington2017-07-281-923/+1980
| | | | | | | | | | | | The demangler now demangles by producing an AST, then traverses that AST to produce a demangled name. This is done for performance reasons, now the demangler doesn't manuiplate std::strings, which hurt performance and caused string operations to be inlined into the parser, leading to large code size and stack usage. Differential revision: https://reviews.llvm.org/D35159 llvm-svn: 309340
* [demangler] Respect try_to_parse_template_argsErik Pilkington2017-07-131-10/+13
| | | | | | Fixes an exponential parse found by oss-fuzz. llvm-svn: 307941
* Remove dependancy on __refstring header; use local copy instead.Eric Fiselier2017-07-122-1/+132
| | | | | | | | | | | | | | This patch removes the dependancy on libc++'s __refstring header, which was only a header in the first place so that libc++abi could build library code using it, and not because libc++ needed it in the headers. This patch allows libc++ to stop shipping <__refstring> publicaly at the cost of duplicating it across projects. Ideally libc++abi would always require the libc++ sources when building, but that's a separate discussion I plan to start on the mailing lists shortly. llvm-svn: 307748
* [libcxxabi][CMake] Add install path variable to allow overriding the destinationPetr Hosek2017-07-111-2/+2
| | | | | | | | | This is going to be used by the runtime build in the multi-target setup to allow using different install prefix for each target. Differential Revision: https://reviews.llvm.org/D33761 llvm-svn: 307611
* [Demangler] NFC: Don't make the parse_* functions templatesErik Pilkington2017-07-081-180/+117
| | | | | | Differential revision: https://reviews.llvm.org/D35158 llvm-svn: 307482
* [Demangler] NFC: Move Db struct to beginning of fileErik Pilkington2017-07-081-207/+206
| | | | | | Differential revision: https://reviews.llvm.org/D35158 llvm-svn: 307481
* Use _LIBCPP_FALLTHROUGH() to avoid warnings about [[gnu::fallthrough]] being ↵Eric Fiselier2017-06-151-1/+1
| | | | | | unsupported llvm-svn: 305500
* build: use cmake to pass -std=c++11Saleem Abdulrasool2017-06-111-0/+18
| | | | | | | | | | Rather than manually checking for support for the spelling of the C++ standard, indicate to CMake that we require that the compiler support C++11 and that we compile without the GNU extensions. This simplifies the flags handling in libc++abi itself by relying on CMake to translate the flag and add it as appropriate. llvm-svn: 305175
* build: use POSITION_INDEPENDENT_CODE CMake propertySaleem Abdulrasool2017-06-111-15/+23
| | | | | | | | | | | | Use the POSITION_INDEPENDENT_CODE target property to indicate that we should be building with -fPIC or the equivalent flag based on the toolchain that we are using. This makes the check more portable and simplifies the flags management. Because we don't want this setting to propagate in the case of an in-tree build, set the property on the targets we construct explicitly rather than setting CMAKE_POSITION_INDEPENDENT_CODE to ON globally. llvm-svn: 305174
* cxa_demangle: fix -Wimplicit-fallthrough for GCC:7Saleem Abdulrasool2017-06-111-1/+1
| | | | | | | Use the C++11 (formalised in C++17) tag to indicate a fallthrough in the switch case. Silences a -Wimplicit-fallthrough warning with gcc:7 llvm-svn: 305173
* private_typeinfo: add missing field initializersSaleem Abdulrasool2017-06-111-3/+3
| | | | | | | Cleanup the -Wmissing-field-initializers warnings from gcc:7 builds. NFC. llvm-svn: 305172
* [libcxxabi] Rework CMakeLists.txt into modulesMartell Malone2017-06-011-17/+14
| | | | | | | | | | Refactor cmake to remove dependence on LLVM's cmake modules. This improves handling of cmake checks when cross compiling and brings libcxxabi in line with libcxx and other project modules. Differential revision: https://reviews.llvm.org/D33635 llvm-svn: 304374
* [demangler] Fix a exponential string copying bugErik Pilkington2017-05-281-0/+4
| | | | | | | | | | | The problem was that if base_name() was called from a context without an actual base name, it could gulp up the entire string, which can result in recursive duplications. The fix is to be more strict as to what qualifies as a base name. Differential revision: https://reviews.llvm.org/D33637 llvm-svn: 304113
* [Demangler] Remove a failing assert introduced in r303718Erik Pilkington2017-05-241-3/+1
| | | | llvm-svn: 303806
* __cxa_demangle: Fix constructor cv qualifier handlingTamas Berghammer2017-05-241-0/+2
| | | | | | | | | | | | | | | | | Summary: Previously if we parsed a constructor then we set parsed_ctor_dtor_cv to true and never reseted it. This causes issue when a template argument references a constructor (e.g. type of lambda defined inside a constructor) as we will have the parsed_ctor_dtor_cv flag set what will cause issues when parsing later arguments. Reviewers: EricWF, compnerd Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33385 llvm-svn: 303737
* [demangler] Fix a crash in the demangler during parsing of a lamdbaErik Pilkington2017-05-241-23/+31
| | | | | | | | | The problem is that multiple types could have been parsed from parse_type(), which the lamdba parameter parsing didn't handle. Differential revision: https://reviews.llvm.org/D33368 llvm-svn: 303718
* [libcxxabi] Align unwindHeader on a double-word boundary.Akira Hatanaka2017-05-161-0/+20
| | | | | | | | | | | | | | | | | | | | | | | r276215 made a change to annotate _Unwind_Exception with attribute "aligned" so that an exception object following field __cxa_exception is sufficiently aligned. This fix hasn't been incorporated to unwind.h on Darwin since it is an ABI breaking change. Instead of annotating struct _Unwind_Exception with the attribute, this commit annotates field unwindHeader of __cxa_exception. This ensures the exception object is sufficiently aligned without breaking the ABI. This recommits r302978 and r302981, which were reverted in r303016 because a libcxx test was failing on an AArch64 bot. I also modified the libcxxabi test case to check the alignment of the pointer returned by __cxa_allocate_exception rather than compiling the test with -O1 and checking whether it segfaults. rdar://problem/25364625 Differential Revision: https://reviews.llvm.org/D33030 llvm-svn: 303175
* Revert r302978 and r302981.Akira Hatanaka2017-05-141-20/+0
| | | | | | | | | Revert the two commits to understand why the following aarch64 bot is failing. http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-aarch64-linux llvm-svn: 303016
* [libcxxabi] Do not align field unwindHeader when building for ARM EHABI.Akira Hatanaka2017-05-131-3/+15
| | | | | | | | | For ARM EHABI, _Unwind_Exception is an alias of _Unwind_Control_Block, which is not aligned, so we shouldn't align unwindHeader either. rdar://problem/25364625 llvm-svn: 302981
* [libcxxabi] Align unwindHeader on a double-word boundary.Akira Hatanaka2017-05-131-2/+10
| | | | | | | | | | | | | | | | | | | r276215 made a change to annotate _Unwind_Exception with attribute "aligned" so that an exception object following field __cxa_exception is sufficiently aligned. This fix hasn't been incorporated to unwind.h on Darwin since it is an ABI breaking change. Instead of annotating struct _Unwind_Exception with the attribute, this commit annotates field unwindHeader of __cxa_exception. This ensures the exception object is sufficiently aligned without breaking the ABI. This recommits r302763 with fixes to RUN lines in the test case. rdar://problem/25364625 Differential Revision: https://reviews.llvm.org/D33030 llvm-svn: 302978
* Revert "[libcxxabi] Align unwindHeader on a double-word boundary."Akira Hatanaka2017-05-111-10/+2
| | | | | | | | This reverts commit r302763. The commit caused bot failures. llvm-svn: 302764
* [libcxxabi] Align unwindHeader on a double-word boundary.Akira Hatanaka2017-05-111-2/+10
| | | | | | | | | | | | | | | | | r276215 made a change to annotate _Unwind_Exception with attribute "aligned" so that an exception object following field __cxa_exception is sufficiently aligned. This fix hasn't been incorporated to unwind.h on Darwin since it is an ABI breaking change. Instead of annotating struct _Unwind_Exception with the attribute, this commit annotates field unwindHeader of __cxa_exception. This ensures the exception object is sufficiently aligned without breaking the ABI. rdar://problem/25364625 Differential Revision: https://reviews.llvm.org/D33030 llvm-svn: 302763
* Revert "Rename c++abi.a on Windows to libc++abi to avoid name conflicts"Eric Fiselier2017-05-111-5/+1
| | | | | | This reverts commit r302759 llvm-svn: 302762
* Fix Libc++abi linking under MinGW64Eric Fiselier2017-05-111-0/+4
| | | | llvm-svn: 302760
* Rename c++abi.a on Windows to libc++abi to avoid name conflictsEric Fiselier2017-05-111-1/+5
| | | | llvm-svn: 302759
* Don't use posix_memalign under MinGWEric Fiselier2017-05-111-2/+2
| | | | llvm-svn: 302755
* [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
OpenPOWER on IntegriCloud