summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* unwind: clean up -Wundef warningsSaleem Abdulrasool2015-02-102-14/+14
| | | | | | | | The unified register management interfaces had multiple naked macros for conditional logic. This cleans them up to use the defined() form, avoiding -Wundef warnings. NFC. llvm-svn: 228663
* unwind: fix -Wformat warnings from gccSaleem Abdulrasool2015-02-103-95/+98
| | | | | | | Clean up the format specifiers for pedantic compilation with gcc 4.9 on Linux. NFC. llvm-svn: 228662
* Unwind: hoist placement delete into base classSaleem Abdulrasool2015-02-061-2/+4
| | | | | | | | | | Move the placement delete into the base class. This permits the proper emission of the virtual destructor in UnwindCursor by using the class specific placement delete instead of the normal single element ::operator delete. With this patch, we can finally build libunwind as a DSO without a runtime dependency on libc++/libc++abi. llvm-svn: 228436
* Unwind: replace pure virtual functions with abortsSaleem Abdulrasool2015-02-061-17/+33
| | | | | | | | | | | | Convert all pure virtual functions in the UnwindCursor with implementations that abort. This is effectively manually replicating the current behaviour, whilst removing the compiler generated calls to __cxa_pure_virtual, which will abort at runtime with a message indicating that a pure virtual call was made. The whitespace changes are the result of executing clang-format over the changed region. llvm-svn: 228423
* unwind: use -fno-rtti -fno-exceptions -funwind-tablesSaleem Abdulrasool2015-02-061-1/+7
| | | | | | | | | RTTI and exceptions are not needed for the unwinder, the use of C++ there is for very specific cases, and does not require dynamic_cast nor does it use exceptions. This avoids unnecessary references to type information being emitted. llvm-svn: 228408
* Fix build for apple machines.Matthias Braun2015-02-061-2/+2
| | | | | | | HAVE_CRASHREPORTERCLIENT_H was potentially undefined and -Wundef is enabled now. llvm-svn: 228368
* Fix build.Dan Albert2015-02-061-2/+0
| | | | | | Had a bad rebase that merged the #if in two places. Whoops. llvm-svn: 228366
* Revert "indicate tag type in C"Saleem Abdulrasool2015-02-052-9/+9
| | | | | | | | | | This reverts commit 4963ea3107a2fdfae21f7806896905f20b21ff0d. This change was wrong. The parameter type is sugared via a typedef. The errors generated may have been due to a different root cause, and should be fixed through the recent series of changes. llvm-svn: 228365
* [libcxxabi] Fix -Werror build for 32-bit non-ARM.Dan Albert2015-02-054-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The inclusion of Unwind-EHABI.h was insufficiently guarded (LIBCXXABI_ARM_EHABI was beign checked without ever being defined). Move the check into the header file itself, add the check to the source file, and clean up the existing checks. LIBCXXABI_ARM_EHABI didn't have a canonical defintion; it was duplicated across cxxabi.h, libunwind.h, and unwind.h. Move the definition into __cxxabi_config.h and clean up the old cruft (note: we will have to ship this header). There are also a few drive-by formatting/whitespace cleanups. Reviewers: jroelofs, thakis, compnerd Reviewed By: compnerd Subscribers: compnerd, aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D7419 llvm-svn: 228363
* Formatting fixes.Dan Albert2015-02-053-36/+34
| | | | | | | We should clang-format the whole thing when we finally move the unwinder to its new home. llvm-svn: 228360
* Fix compilation of unwind on Darwin-x86_64Saleem Abdulrasool2015-02-051-0/+4
| | | | | | | | EHABI related typedef sugar is gated via LIBCXXABI_ARM_EHABI which did not protect the EHABI header. This would cause declarations to be emitted on non-EHABI targets, resulting in errors. This permits compilation on Darwin. llvm-svn: 228359
* Silence some -Wundef warningsSaleem Abdulrasool2015-02-052-4/+4
| | | | | | | | | | | | config.h:53:7: warning 'FOR_DYLD' is not defined, evaluates to 0 [-Wundef] Unwind_AppleExtras.cpp:44:5: warning '__arm__' is not defined, evaluates to 0 [-Wundef] Unwind_AppleExtras.cpp:60:7: warning '__arm64__' is not defined, evaluates to 0 [-Wundef] Unwind_AppleExtras.cpp:186:6: warning 'FOR_DYLD' is not defined, evaluates to 0 [-Wundef] Use defined(macro) which should be equivalent in these cases, silencing -Wundef warnings. NFC. llvm-svn: 228358
* Silence warning about loss of precisionSaleem Abdulrasool2015-02-051-1/+1
| | | | | | | | | | Explicitly cast to uintptr_t before casting to a 32-bit value. Because this code path is meant to be used in a 32-bit address space, this truncation should be safe. Unwind-EHABI.h:25:12: error: cast from pointer to smaller type 'uint32_t' (aka 'unsigned int') loses information llvm-svn: 228357
* indicate tag type in CSaleem Abdulrasool2015-02-052-9/+9
| | | | | | | Mark the tag type (struct) for the _Unwind_Exception in C code. This silences a warning from clang about missing struct specifier. llvm-svn: 228356
* Some more -Wundef issues.Dan Albert2015-02-052-7/+7
| | | | | | This should be all of them for Linux. Might be some for the others. llvm-svn: 228267
* Enable -Wundef.Dan Albert2015-02-0511-52/+59
| | | | | | | | 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
* Force unwind frame with user-defined personality.Logan Chien2015-01-224-69/+109
| | | | | | | | | | | | | | | | | | If libcxxabi is compiled as a shared library, and the executable references the user-defined personality routines (e.g. __gxx_personality_v0), then the pointer comparison in Unwind-EHABI.cpp won't work. This is due to the fact that the PREL31 will point to the PLT stubs for the personality routines (in the executable), while the __gxx_personality_v0 symbol reference is yet another (different) PLT stub (in the libunwind.) This will cause _Unwind_Backtrace() stops to unwind the frame whenever it reaches __gxx_personality_v0(). This CL fix the problem by calling the user-defined personality routines with an undocumented API for force unwinding. llvm-svn: 226822
* Fix _Unwind_Backtrace for libc++abi built with libgcc.Logan Chien2015-01-221-0/+12
| | | | | | | Implement an undocumented _US_FORCE_UNWIND flag for force unwinding. llvm-svn: 226820
* Allow libc++abi to be built without unwinder.Logan Chien2015-01-221-34/+41
| | | | | | | | | | | This CL adds a new compilation flags LIBCXXABI_USE_LLVM_UNWINDER to specify whether the LLVM unwinder is enabled. Besides, all unwinder-specific code are guarded with this definition. Now, libc++abi will be able to use the unwinding routine from libgcc when LIBCXXABI_USE_LLVM_UNWINDER is disabled. llvm-svn: 226819
* Remove _Unwind_{Get,Set}{GR,IP} from ARM EHABI build.Logan Chien2015-01-221-22/+0
| | | | | | | | | | | | | This commit partially reverts r219629. This functions are not a part of ARM EHABI specification, and AFAIK, the de facto implementation does not export these functions. Without this change, any programs compiled with this unwind.h will be incompatible with other implementations due to linkage error. llvm-svn: 226818
* Fix abort_message.cpp for the NDK.Dan Albert2015-01-161-3/+15
| | | | | | | | | The NDK doesn't have access to `android/set_abort_message.h`, so use an extern declaration instead for API 21. For older releases, just use `__assert2`, which will report to logcat and/or the tombstone for some older releases. llvm-svn: 226310
* Fix some formatting I messed up in r225187.Dan Albert2015-01-051-1/+1
| | | | llvm-svn: 225194
* Make the Unwinder -Werror clean.Dan Albert2015-01-055-95/+110
| | | | | | | Mostly just format string fixes. Tested clean on arm, x86, and x86_64 Linux. llvm-svn: 225187
* Typo.Joerg Sonnenberger2015-01-041-1/+1
| | | | llvm-svn: 225136
* [cmake/multilib] Teach libc++abi's CMake build to support multilibChandler Carruth2014-12-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | libdir suffixes like 'lib64' or 'lib32'. This support is currently very rhudimentary. We define a variable LIBCXXABI_LIBDIR_SUFFIX. In a standalone build of libc++abi this can be directly set as a cached variable to control the multilib suffix used. When building libc++abi within a larger LLVM build, it is hard wired to whatever LLVM libdir suffix has been selected. If this doesn't work for someone, just let me know. I'm happy to change it. Unfortunately, libc++abi's lit setup made this somewhat problematic to change. It was setting variables up in a way that caused the resulting build to not work with lit at all. To fix that, I've moved some variables around in the CMake build to more closely match where and how they are defined in the libc++ CMake build. This includes specifically defining a library root variable in the CMake build where the libdir suffix can be applied, and then using that rather than re-computing it from the object directory in the lit config. This is essentially new functionality for libc++abi so I don't expect it to have any impact for folks until they start setting these variables. However, I know libc++abi is built in a diverse set of environments so just let me know if this causes you any problems. llvm-svn: 224927
* Silence warnings in libunwind.Logan Chien2014-12-212-6/+9
| | | | | | | | | | | | | | * Remove the embedded directive undefined behavior by moving the the #ifdef out of the macro arguments. [-Wembedded-directive] * Remove the local variable shadowing warning by renaming frameInfo in UnwindLevel1-gcc-ext.c. [-Wshadow] * Explicitly cast the function pointer to void pointer to avoid the comparison between function pointer and void pointer. [-Wpedantic] llvm-svn: 224690
* [libcxxabi] Add __cxa_thread_atexit for TLS support on Linux.Dan Albert2014-12-182-0/+36
| | | | | | | | | | | | | | | | | | | | | Summary: Fixes PR21738. The implementation for this is handled by __cxa_thread_atexit_impl, which is supplied by libc. More information: https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables Reviewers: mclow.lists, EricWF, jroelofs Reviewed By: jroelofs Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D6708 llvm-svn: 224477
* [libcxxabi] Refactor building and testing libc++abi without threadsEric Fiselier2014-11-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds CMake support for building and testing libc++abi without threads. 1. Add `LIBCXXABI_ENABLE_THREADS` option to CMake. 2. Propagate `LIBCXXABI_ENABLE_THREADS` to lit via lit.site.cfg.in 3. Configure tests for `LIBCXXABI_ENABLE_THREADS=OFF Currently the test suite does not work when libc++abi is built without threads because that information does not propagate to the test suite. Reviewers: danalbert, mclow.lists, jroelofs Reviewed By: jroelofs Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6393 llvm-svn: 222702
* [libcxxabi] Delay adjustment of pointer to prevent referencing invalid memory.Eric Fiselier2014-11-241-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch delays the dereference adjustment until we are sure the thrown type is a pointer type. It is possible the thrown type is not a pointer and is smaller than `sizeof(void*)`. If the thrown type is is smaller than `sizeof(void*)` the deference adjustment will result in a heap buffer overflow. I audited all the call sites of `can_catch(...)` and there are no places where `adjustedPtr` is used if `can_catch(...)` returns false. For this reason the patch should not introduce any functionality change. This patch fixes the following tests when using ASAN: * unwind_01.cpp * unwind_02.cpp * unwind_04.cpp Reviewers: danalbert, jroelofs, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6353 llvm-svn: 222674
* [libcxxabi] Refactor CMakeLists.txt's handling of compile and link flags to ↵Eric Fiselier2014-11-182-18/+18
| | | | | | | | | | | | | | | | | | suppress warnings. Summary: This patch mirrors the recent change to libc++ found here http://reviews.llvm.org/D6277. This fixes PR20395 (http://llvm.org/bugs/show_bug.cgi?id=20395). Reviewers: jroelofs, mclow.lists, danalbert Reviewed By: danalbert Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6286 llvm-svn: 222252
* Make sure only NEON enabled devices save/restore D16+ registersRenato Golin2014-11-072-2/+2
| | | | llvm-svn: 221532
* Correctly export _Unwind_[GS]et(GR|IP) for EHABI.Dan Albert2014-10-133-2/+24
| | | | | | | | | | | | | | | | | | These need to have normal linkage instead of being static inline as many libraries expect to be able to declare these and have the linker find them rather than needing to include the header. http://mentorembedded.github.io/cxx-abi/abi-eh.html Also clean up some warnings while I'm here. Reviewers: jroelofs, kledzik Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5754 llvm-svn: 219629
* Use __atomic_exchange_n instead of Clang's __sync_swapReid Kleckner2014-10-032-8/+10
| | | | | | | | | | | Also remove an extra extern "C" from a global variable redeclaration. This allows building libcxxabi with GCC on my system. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D5604 llvm-svn: 219012
* Support Cortex-m0Jonathan Roelofs2014-10-023-21/+70
| | | | | | | | | As the title says... also, fix all the ARM asm return sequences so that they work on processors without the BX instruction. http://reviews.llvm.org/D5314 llvm-svn: 218869
* Adding ABI support for __cxa_throw_bad_array_new_length.Aaron Ballman2014-09-111-0/+5
| | | | llvm-svn: 217604
* ARM Unwind syntaxRenato Golin2014-09-112-6/+30
| | | | | | | | | | | This patch fixes the bad argument that GAS accepted but the IAS didn't, ie. {#0x20}, moving it to {0x20} which both accept. It also makes the ARMv7+ save/restore correct by using VFP instructions rather than old co-processor ones. Fixes PR20529. llvm-svn: 217585
* Implement post-review comments for r216730Jonathan Roelofs2014-09-091-2/+16
| | | | | | Feedback was 'this could use better comments'. llvm-svn: 217459
* Remove an unused typedef from __class_type_info::search_below_dstAlexander Potapenko2014-09-081-1/+0
| | | | | | to fix the -Wunused-local-typedef warning. llvm-svn: 217367
* Use correct __ARM_ARCH macroRenato Golin2014-09-072-2/+2
| | | | llvm-svn: 217341
* s/LIBCXXABI_SINGLE_THREADED/LIBCXXABI_HAS_NO_THREADS/ for consistency with ↵Jonathan Roelofs2014-09-055-15/+13
| | | | | | | | | 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
* Allow LIBCXXABI_SINGLE_THREADED to be defined by build scriptsJonathan Roelofs2014-09-021-1/+2
| | | | llvm-svn: 216952
* Make _Unwind_Backtrace() work on ARM.Dan Albert2014-08-294-27/+91
| | | | | | | | | | | | | | | | | | | | | | Summary: Since the personality functions do the actual unwinding on ARM, and will also stop unwinding when they encounter a handler, we invoke _Unwind_VRS_Interpret() directly form _Unwind_Backtrace(). To simplify, the logic for decoding an EHT is moved out of unwindOneFrame() and into its own function, decode_eht_entry(). Unlike unwindOneFrame(), which could only handle ARM's compact personality function entries (section 6.3) decode_eht_entry() can handle the generic entries (section 6.2). Reviewers: jroelofs Reviewed By: jroelofs Subscribers: piman, aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D5112 llvm-svn: 216730
* Add baremetal ARM support to libcxxabi/libunwindJonathan Roelofs2014-08-213-2/+40
| | | | | | http://reviews.llvm.org/D4993 llvm-svn: 216202
* Improve logging of aborts for Android.Dan Albert2014-08-191-2/+21
| | | | | | | | In Android, stderr only goes to the console, and as such will only ever be seen by adb shell users. Since very few developers will ever actually see that, also send the abort message to logcat and the tombstone. llvm-svn: 215983
OpenPOWER on IntegriCloud