summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
Commit message (Collapse)AuthorAgeFilesLines
* Let cxa_demangle.cpp compile with gcc/libstdc++ 4.8 and clang-cl/MSVC2013's STL.Nico Weber2015-09-201-0/+24
| | | | | | | libstdc++ needs a few typedefs in malloc_alloc. MSVC's STL needs rebind(), construct(), destroy(). MSVC2013 also has no snprintf, but it exists in 2015. llvm-svn: 248129
* EH: fix register usage for SjLjSaleem Abdulrasool2015-09-201-5/+8
| | | | | | | | | | When using SjLj EH, do not use __builtin_eh_return_regno, map directly to the ID. This would work on some targets, particularly those where the non-SjLj EH personality used the same register mapping (0 -> 0, 1 -> 1). However, this is not guaranteed. Avoiding the use of the builtin enables the use of libc++ with SjLj EH on all targets. llvm-svn: 248108
* [libcxxabi] Add "install-libcxxabi" target.Eric Fiselier2015-08-191-2/+10
| | | | | | | | | | | | | | Summary: Currently you can't install libc++abi from within the LLVM tree without installing all of LLVM. This patch adds an install rule for libc++abi. Reviewers: danalbert, compnerd, rengolin, beanz Subscribers: martell, beanz, jroelofs, cfe-commits Differential Revision: http://reviews.llvm.org/D11682 llvm-svn: 245461
* [AArch64] Quick fix for cxa demanglerRenato Golin2015-08-191-1/+1
| | | | | | | | | This makes all libcxxabi tests pass on AArch64. Further changes and new tests to come. Patch by Keith Walker. llvm-svn: 245449
* [libcxxabi][mips] Correct float_data::mangled_size for all ABI's.Daniel Sanders2015-07-301-1/+3
| | | | | | | | | | | | | | Summary: Patch by Nitesh Jain and Jaydeep Patil with a small revision to use ABIs rather than Architecture Revisions (which currently imply particular ABIs). Fixes test_demangle.pass.cpp (PR24149). Subscribers: mclow.lists, jaydeep, nitesh.jain, hans, cfe-commits Differential Revision: http://reviews.llvm.org/D11483 llvm-svn: 243645
* Remove include directive for the unused libunwind_ext.h.Logan Chien2015-07-121-4/+0
| | | | llvm-svn: 241993
* fallback_malloc: silence conversion warning (NFC)Saleem Abdulrasool2015-06-031-4/+4
| | | | | | | | This silences some conversion warnings from GCC 4.9.2. Simply casting the RHS doesn't seem to be sufficient to silence the warning. Convert the operation equal operator usage to calculation and assignment. llvm-svn: 238945
* fallback_malloc: silence qual-cast warning (NFC)Saleem Abdulrasool2015-06-031-1/+1
| | | | | | | This silences a GCC 4.9.2 qual-cast warning in the fallback_malloc codepath. NFC. llvm-svn: 238944
* 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
* libcxx: Switch to use __gnu_unwind_frame() for libunwind.Logan Chien2015-05-291-32/+2
| | | | | | | | | As a step to fix libunwind unw_step(), a new function __gnu_unwind_frame() has been introduced to libunwind, and it is required to use this function so that some libunwind internal data structure can be updated properly. llvm-svn: 238561
* Make sure !empty() before calling String::front().Chaoren Lin2015-05-261-4/+7
| | | | | | | | | | Reviewers: howard.hinnant Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9954 llvm-svn: 238263
* Disallow conversions from function pointers to void*.Eric Fiselier2015-05-011-3/+7
| | | | | | | | | Function pointers and member function pointers cannot be converted to void*. libc++abi incorrectly allows this conversion for function pointers. Review URL: http://reviews.llvm.org/D8811 llvm-svn: 236299
* libc++abi: work around layering violationSaleem Abdulrasool2015-04-281-1/+1
| | | | | | | | This papers over a layering violation currently between libc++abi and libunwind. It reaches into the sources to get the declaration of an ABI defined function. This should allow the ARM buildbot to continue building libc++abi again. llvm-svn: 235965
* libc++abi: remove unused variableSaleem Abdulrasool2015-04-271-2/+1
| | | | | | | The externC variable was set but unused. This constantly flagged a warning from gcc. Replace it with a comment until such a time that we need it. llvm-svn: 235830
* libc++abi: clear up some -Wqual-cast warningsSaleem Abdulrasool2015-04-272-3/+2
| | | | | | Cleans up cast qualifier warnings identified by GCC 4.9.2. llvm-svn: 235829
* libc++abi: silence some warningsSaleem Abdulrasool2015-04-271-1/+1
| | | | | | | | | Cleans up the -Wundef warning caused by the use of the __LITTLE_ENDIAN__ macro. Instead use `__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__`. `__BYTE_ORDER__` is defined by GCC since 4.2 and by clang. This avoids the undef case where a macro may be undefined. This has previously caught real errors in libunwind. llvm-svn: 235828
* libc++abi: remove the duplicated unwind contentSaleem Abdulrasool2015-04-2422-10394/+0
| | | | | | | | | | The unwinder has been moved into its own project setup at http://svn.llvm.org/projects/libunwind/trunk. This simply removes the now duplicated content. This move was previously discussed on llvmdev at [1]. [1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/081507.html llvm-svn: 235759
* Declare __cxa_new_handler as extern "C", or it declares a new variableReid Kleckner2015-04-151-1/+1
| | | | | | | Reverts change from r219012 to fix ABI incompatibility. Let's not worry about the GCC warning here. llvm-svn: 235013
* [libcxxabi] Disallow Base to Derived conversions for catching pointers to ↵Eric Fiselier2015-04-061-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | members. Summary: I accidentally implemented the 4.11 [conv.mem] conversions for libc++abi in a recent patch. @majnemer pointed out that 5.13 [except.handle] only allows the pointer conversions in 4.10 and not those is 4.11. This patch no longer allows the following example code: ```c++ struct A {}; struct B : public A {}; int main() { try { throw (int A::*)0; } catch (int B::*) { // exception caught here. } } ``` Reviewers: mclow.lists, jroelofs, majnemer Reviewed By: majnemer Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D8845 llvm-svn: 234254
* [libcxxabi] Fix multi-level pointer conversions and pointer to member ↵Eric Fiselier2015-04-022-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | conversion detection. Summary: Currently there are bugs in out detection of multi-level pointer conversions and pointer to member conversions. This patch fixes the following issues. * Allow multi-level pointers with different nested qualifiers. * Allow multi-level mixed pointers to objects and pointers to members with different nested qualifiers. * Allow conversions from `int Base::*` to `int Derived::*` but only for non-nested pointers. There is still some work that needs to be done to clean this patch up but I want to get some input on it. Open questions: * Does `__pointer_to_member_type_info::can_catch(...)` need to adjust the pointer if a base to derived conversion is performed? Reviewers: danalbert, compnerd, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8758 llvm-svn: 233984
* Also use dl_iterate_phdr() on CloudABI.Ed Schouten2015-03-311-1/+1
| | | | | | | | | | The unwinder now works on CloudABI. All exception-related libc++ tests now pass. This change was actually part of D8169, which also adds support for FreeBSD. That, however, still requires some more polishing. llvm-svn: 233676
* Don't print debugging messages to stdout.Ed Schouten2015-03-191-18/+18
| | | | | | | | | | There is some debugging code in cxa_demangle.cpp that prints messages on stdout. In general this is not safe, as the program itself may use stdout to write its output. Change this code to write to stderr. Differential Revision: http://reviews.llvm.org/D8167 llvm-svn: 232716
* Remove unneeded const_cast in readPointerHelper. Pointed out by jroelofsEric Fiselier2015-03-101-1/+1
| | | | llvm-svn: 231852
* [libcxx] Fix PR21580 - Undefined behavior in readEncodedPointer()Eric Fiselier2015-03-101-12/+20
| | | | | | | | | | | | | | Summary: This patch fixes a bug in `readEncodedPointer()` where it would read from memory that was not suitably aligned. This patch fixes it by using memcpy. Reviewers: danalbert, echristo, compnerd, mclow.lists Reviewed By: compnerd, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8179 llvm-svn: 231839
* Unwind: define more interfaces more oftenSaleem Abdulrasool2015-03-091-40/+36
| | | | | | | | | These are also part of the Unwind interfaces. However, their implementation is different in EHABI vs frame tables based exception handling. Always provide a definition. This partially undoes a movement change from earlier to make the handling a bit simpler rather than grouping the two implementations together. llvm-svn: 231690
* Unwind: always define unwind APIsSaleem Abdulrasool2015-03-091-4/+0
| | | | | | | | These interfaces are not zero cost related, but rather generic unwind APIs used by consumers of the Unwind library. Always provide the definition as they are needed for both Zero Cost and Frame Table based implementations. llvm-svn: 231666
* Unwind: remove unnecessary checkSaleem Abdulrasool2015-03-071-1/+0
| | | | | | | | | Linux/GNU on AArch64 EH ABI Level III is implemented using exception frame tables as defined in LSB II.11.6. The exception frame tables use the DWARF Exception Header Encoding as described in LSB II.11.5.1. We already defined the appropriate definition _LIBUNWIND_SUPPORT_DWARF_UNWIND to enable this. llvm-svn: 231580
* Unwind: tweak register handling for AArch64Saleem Abdulrasool2015-03-072-22/+22
| | | | | | | | | | | AArch64 uses // as the comment character (although, Darwin uses ;). However, since we are using the C preprocessor on these files, // can be used as the comment character across the board. Tweak the platform guard to recognise __aarch64__ as well as __arm64__ for the platform identifier. llvm-svn: 231578
* Fix build with GCC:Nick Lewycky2015-03-053-1/+17
| | | | | | | | - GCC doesn't support #pragma mark, only Apple GCC and clang. Wrap the pragma mark's in #if 0 to make gcc ignore them but xcode still see them. - Wrap a bunch of "#pragma clang" lines in #ifdef __clang__. - Pacify gcc's -Wparenthesis in a case where it's quite reasonable. llvm-svn: 231344
* [libcxxabi] Build both static and shared versions of libc++abi by default.Eric Fiselier2015-03-031-24/+44
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch builds both static and shared versions of libc++abi by default. It adds/repurposes the following cmake options: * `LIBCXXABI_ENABLE_SHARED`: Enable/disable building the shared library. (Previously using `OFF` would build the static library instead) * `LIBCXXABI_ENABLE_STATIC`: Enable/disable building the static library. This patch also re-purposes the CMake target `cxxabi` to be a meta-target for `cxxabi_shared` and `cxxabi_static`. This could potentially break other builds that depend on `cxxabi` being a library target. We will need to apply a patch to libc++'s CMake before committing this change. Running the tests is still only supported when the shared version is built. Support for running the tests against the static library will come in another patch. Reviewers: jroelofs, mclow.lists, danalbert, compnerd Reviewed By: danalbert, compnerd Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8013 llvm-svn: 231075
* Unwind: make it build on Darwin againSaleem Abdulrasool2015-02-281-2/+5
| | | | | | | The support for the LSB eh_frame_hdr extension was overzealous in trying to include headers. Be more careful to permit building on Darwin. llvm-svn: 230837
* Add .eh_frame_hdr search to Linux unwinder.Dan Albert2015-02-274-10/+242
| | | | | | | | | | | This improves the performance of unwinding on DWARF based targets. The 32-bit x86 support for scanning the full eh_frame (CFI_Parser::findFDE) apparently does not work (at least not on Linux). Since the eh_frame_hdr code delegates to that, this still doesn't work for x86 Linux, but it has been tested on x86_64 Linux and aarch64 Android. llvm-svn: 230802
* Unwind: clean up some GCC warningsSaleem Abdulrasool2015-02-262-8/+9
| | | | | | | This cleans up a set of -Wsign-conversion, -Wint-conversion, and -Wformat warnings from GCC 4.9.2 on Linux. NFC. llvm-svn: 230606
* Add .fpu directives to ARM unwind save & restore functions.Jonathan Roelofs2015-02-242-36/+6
| | | | | | | | | | | | | | | TODO: The iwmmx register save & restore functions still need the same treatment. I didn't do that in this patch because the integrated assembler has a bug where it refuses to build them on -march=armv6-m, even with .march armv5t .arm in front of those functions. This should fix PR22384. http://reviews.llvm.org/D7258 llvm-svn: 230360
* Do not add -fno-exceptions without -funwind-tablesSergey Dmitrouk2015-02-161-2/+9
| | | | | | | | | | | | | | | Adding just -fno-exceptions breaks libunwind in quite mysterious way when it's there, but exception handling doesn't work because of dummy unwind tables. Also as using exceptions implies references to symbols defined in libcxx, abort build of libcxxabi as shared library if we have to keep exceptions (when compiler supports -fno-exceptions, but not -funwind-tables; one example would be a cross-compiler, in which case testing for -funwind-tables flag by CMake actually requires libunwind to be available before it's built). llvm-svn: 229427
* Moar post-commit review.Jonathan Roelofs2015-02-141-1/+1
| | | | | | Apparently typing is hard. llvm-svn: 229216
* Address post-commit review commentsJonathan Roelofs2015-02-141-0/+3
| | | | llvm-svn: 229207
* Make the unwinder build on thumbv6-m with the integrated assembler.Jonathan Roelofs2015-02-141-0/+4
| | | | | | http://reviews.llvm.org/D7630 llvm-svn: 229194
* unwind: always export unw_local_addr_spaceSaleem Abdulrasool2015-02-131-5/+4
| | | | | | | | | | It seems that the remote unwinder is entirely unused at this moment. unw_local_addr_space was referencing sThisAddressSpace which use to be a static in global namespace. It has since then become a member variable of LocalAddressSpace. Update this definition and always export it (needed to implement unw_get_proc_info_by_ip for ARM). llvm-svn: 229133
* unwind: use sizeof() instead of hardcoded sizesSaleem Abdulrasool2015-02-132-10/+15
| | | | | | | | The statically allocated strings have a fixed size which can be computed using the sizeof operator rather than duplicating the allocation size which can drift. NFC. llvm-svn: 229126
* Don't use bzero() and strcpy().Ed Schouten2015-02-133-16/+21
| | | | | | | | | | Instead of bzero(), we can simply use memset(). The strcpy() calls are unneeded, as we can simply keep track of a pointer to the constant strings we are copying. Reviewed by: Jonathan Roelofs llvm-svn: 229074
* unwind: use explicit memcpy for register savingSaleem Abdulrasool2015-02-121-6/+19
| | | | | | | | | | Convert the register saving code to use an explicit memcpy rather than the implicit memcpy from the assignment. This avoids warnings from -Wcast-qual on GCC and makes the code more explicit. Furthermore, use sizeof to calculate the offsets rather than adding magic numbers, improving legibility of the code. NFC. llvm-svn: 228904
* unwind: move exported APIs out of headerSaleem Abdulrasool2015-02-121-41/+72
| | | | | | | | | | | | | | | Ideally, we would do something like inline __declspec(dllexport) to ensure that the symbol was inlined within libunwind as well as emitted into the final DSO. This simply moves the definition out of the header to ensure that the *public* interfaces are defined and exported into the final DSO. This change also has "gratuitous" code movement so that the EHABI and generic implementations are co-located making it easier to find them. The movement from the header has one minor change introduced into the code: additional tracing to mirror the behaviour of the non-EHABI interfaces. llvm-svn: 228903
* unwind: tweak inclusion ordering to work around GCCSaleem Abdulrasool2015-02-112-0/+5
| | | | | | | | | | | | | This is a slightly convoluted workaround. GCC does not support the __has_feature extension of clang, and this results in some issues with static_asserts. config.h defines static_assert as a macro with a C-specific trickery. This then propagates into the C++ headers included after config.h, which are used with C++11 mode, enabling constexpr constructors. The macro'ed static_assert does not get treated as the static_assert builtin, and will cause an error due to a non-empty constexpr constructor. Tweaking the include order permits the use of libc++ headers to build libunwind with GCC on Linux. llvm-svn: 228809
* unwind: clean up some -Werror=return-type warningsSaleem Abdulrasool2015-02-111-17/+16
| | | | | | | | Mark that the functions always return or abort if the register class is unhandled. Avoid placing the abort in the switch to permit -Wswitch-cover to catch missing values. llvm-svn: 228808
* unwind: clean up more -Wformat warningsSaleem Abdulrasool2015-02-112-46/+56
| | | | | | This makes compilation on ARM -Wformat clean with GCC. NFC. llvm-svn: 228807
* unwind: clean up straggling -Wundef warningSaleem Abdulrasool2015-02-111-0/+4
| | | | | | | Conservatively define __ARM_ARCH to 4 in the case that it is undefined (e.g. with GCC). llvm-svn: 228806
* unwind: silence -Wconversion warningsSaleem Abdulrasool2015-02-112-6/+8
| | | | | | Clean up implicit uint8_t to uint32_t conversion warnings identified by GCC. llvm-svn: 228805
* unwind: improve compilation on Linux with gccSaleem Abdulrasool2015-02-101-23/+24
| | | | | | | | gcc still defaults to C89 which does not support BCPL style comments. This splits up the sources list in CMakeLists and selectively adds compile flags for using C99 which avoids a number of warnings in -Wpedantic mode. NFC. llvm-svn: 228665
* unwind: clean up some stray semicolonsSaleem Abdulrasool2015-02-102-2/+2
| | | | | | Clean up some stray semicolons found by GCC 4.9 -Wpedantic. NFC. llvm-svn: 228664
OpenPOWER on IntegriCloud