summaryrefslogtreecommitdiffstats
path: root/libunwind
Commit message (Collapse)AuthorAgeFilesLines
* [PATCH] [libunwind][ehabi] Use early returns where possible.Asiri Rathnayake2016-07-081-15/+46
| | | | | | Just a minor code cleanup. NFC. llvm-svn: 274840
* [libunwind][ARM] Improve unwinder stack usage - Make WMMX support optionalAsiri Rathnayake2016-07-076-44/+91
| | | | | | | | | | | | | These registers are only available on a limited set of ARM targets (those based on XScale). Other targets should not have to pay the cost of these. This patch shaves off about ~300 bytes of stack usage and ~1KB of code-size. Differential revision: http://reviews.llvm.org/D21991 Reviewers: bcraig, compnerd Change-Id: I2d7a1911a193bd70b123e78747e1a7d1482463c7 llvm-svn: 274744
* [libunwind] Improve unwinder stack usage - IIIAsiri Rathnayake2016-06-141-35/+35
| | | | | | | | Implement the same optimization committed under r271004 on non-EHABI, non-SJLJ unwinder as well. Change-Id: I7f80ed91a75d1e778b50ba87cf8fb68658a083c7 llvm-svn: 272680
* [libunwind] Remove unused code.Asiri Rathnayake2016-06-031-32/+0
| | | | | | | | | | The whole file is guarded with #if _LIBUNWIND_ARM_EHABI, and then in the middle we have these two blocks, which render them pretty unused. An artefact of a refactoring it seems. NFC. llvm-svn: 271737
* Attempt to fix libunwind buildEric Fiselier2016-06-021-2/+2
| | | | llvm-svn: 271466
* Add status/warning message for 32 bit buildsEric Fiselier2016-06-021-0/+10
| | | | llvm-svn: 271462
* [libunwind] Allow target flags to affect CMake configuration testsEric Fiselier2016-06-022-22/+37
| | | | | | | | | | | | | | | | | | | | | Summary: This patch changes the libunwind CMake so that it adds certain target flags like '-m32' or '--gcc-toolchain' before including config-ix.cmake. Since these flags can affect things like check_library_exists([...]) they needed to be added before the tests are performed. Additionally this patch adds LIBUNWIND_BUILD_32_BITS which defaults to LLVM_BUILD_32_BITS. This patch fixes: https://llvm.org/bugs/show_bug.cgi?id=27950 https://llvm.org/bugs/show_bug.cgi?id=27959 Reviewers: jroelofs, danalbert, bcraig, rmaprath, compnerd Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20889 llvm-svn: 271458
* [libunwind] Improve unwinder stack usage - IIAsiri Rathnayake2016-05-271-24/+24
| | | | | | | | | | | | | | | | | | | | | | unwind_phase1 and unwind_phase2 allocate their own copies of unw_cursor_t buffers on the stack. This can blow-up stack usage of the unwinder depending on how these two functions get inlined into _Unwind_RaiseException. Clang seems to inline unwind_phase1 into _Unwind_RaiseException but not unwind_phase2, thus creating two unw_cursor_t buffers on the stack. One way to work-around this problem is to mark both unwind_phase1 and unwind_phase2 as noinline. This patch takes the less compiler-dependent approach and explicitly allocate a unw_cursor_t buffer and pass that into unwind_phase1 and unwind_phase2 functions. A follow-up patch will replicate this behavior for the non-EHABI and non-SJLJ implementations. Reviewers: jroelofs, bcraig. Differential revision: http://reviews.llvm.org/D20320 llvm-svn: 271004
* [libunwind] Disable cross-unwinding by default.Asiri Rathnayake2016-05-271-1/+1
| | | | | | | | | | | | | | Cross unwinding requires larger sizes for unw_context_t and unw_cursor_t buffers (large enough to hold the VRS of any architecture). This is not desirable for the most common situation where libunwind is used for native unwinding only. This patch makes native unwinding the default build configuration. This will start testing the tigher (compile-time) bounds of unw_context_t and unw_cursor_t buffers for each architecture. Change-Id: Ic61c476a75603ca4812959c233cfe56f83dc0b00 llvm-svn: 270972
* Use size_t to store the results of sizeof calculations.Asiri Rathnayake2016-05-261-1/+1
| | | | | | NFC. llvm-svn: 270927
* Fix gcc libunwind build.Asiri Rathnayake2016-05-263-8/+8
| | | | | | | | | | | | | | | | | | r270692 seems to have broken gcc builds of libunwind. This is because statements like: static_assert(check_fit<Registers_or1k, unw_context_t>::does_fit, "or1k registers do not fit into unw_context_t"); Do not work when static_assert is a macro taking two parameters, the extra comma separating the template parameters confuses the pre-processor. The fix is to change those statements to: static_assert((check_fit<Registers_or1k, unw_context_t>::does_fit), "or1k registers do not fit into unw_context_t"); Also fixed a gcc warning about a trivial un-intended narrowing. Differential revision: http://reviews.llvm.org/D20119 llvm-svn: 270925
* Introduce a native-only unwinder build.Asiri Rathnayake2016-05-258-31/+139
| | | | | | | | | | | | | | | | Currently libunwind is built to support cross-unwinding [1] by default, which requires the buffers unw_context_t and unw_cursor_t to be large enough to hold the vritual register set (VRS) of any supported architecture. This is not desirable for some platforms where the stack usage of the unwinder needs to be kept to a minimum (e.g. bare-metal targets). The current patch introduces a native-only (-DLIBUNWIND_ENABLE_CROSS_UNWINDING=OFF) unwinder variant that adopts strict sizes for the buffers unw_context_t and unw_cursor_t depending on the target architecture. [1] http://www.nongnu.org/libunwind/man/libunwind(3).html#section_4 Change-Id: I380fff9a56c16a0fc520e3b1d8454a34b4a48373 llvm-svn: 270692
* unwind: remove last instance of -Wexpansion-to-definedSaleem Abdulrasool2016-04-261-4/+6
| | | | | | | | | This unifies the definition of _LIBUNWIND_BUILD_SJLJ_APIS. It also further generalises the definition to allow building these APIs on non-Apple targets when `-fsjlj-excceptions` is used. The header is now clean of macros which expand to defined checks. llvm-svn: 267509
* unwind: remove unnecessary headerSaleem Abdulrasool2016-04-241-3/+0
| | | | | | | Availablity.h is not used within config.h. The locations which use the availability infrastructure already include the necessary header(s). NFC. llvm-svn: 267365
* unwind: unify _LIBUNWIND_ABORTSaleem Abdulrasool2016-04-241-18/+8
| | | | | | | | | | | Rather than use the `__assert_rtn` on libSystem based targets and a local `assert_rtn` function on others, expand the function definition into a macro which will perform the writing to stderr and then abort. This unifies the definition and behaviour across targets. Ensure that we flush stderr prior to aborting. llvm-svn: 267364
* unwind: unify some more macrosSaleem Abdulrasool2016-04-221-7/+6
| | | | | | | | The macros were defined identically across both cases. Unify the definitions to have a single definition for _LIBUWNIND_{HIDDEN,EXPORT} and _LIBUNWIND_LOG. NFC. llvm-svn: 267169
* unwind: remove another instance of -Wexpansion-to-definedSaleem Abdulrasool2016-04-201-1/+5
| | | | | | | Remove the use of undefined behaviour in the c preprocessor by always defining the value according to the state that was being checked. NFC. llvm-svn: 266927
* unwind: unify the definition of _LIBUNWIND_SUPPORT_FRAME_APISSaleem Abdulrasool2016-04-201-4/+2
| | | | | | | Unify the definition of the _LIBUNWIND_SUPPORT_FRAME_APIS macro. This is in preparation to remove another instance of -Wexpansion-to-defined. NFC. llvm-svn: 266926
* unwind: remove a second instance of -Wexpansion-to-definedSaleem Abdulrasool2016-04-201-5/+8
| | | | | | | Remove the use of undefined behaviour in the c preprocessor by always defining the value according to the state that was being checked. NFC. llvm-svn: 266916
* unwind: remove an instance of -Wexpansion-to-definedSaleem Abdulrasool2016-04-201-4/+9
| | | | | | | | | | | | This follows the pattern in the Apple clause duplicating a tuple of definitions. However, it will define them to a value rather than a defined check to remove the `-Wexpansion-to-defined` warning (which may be treated as an error). This also opens the door to unifying the two code paths into one. NFC. llvm-svn: 266915
* unwind: unify _LIBUNWIND_SUPPORT_DWARF_UNWINDSaleem Abdulrasool2016-04-201-8/+5
| | | | | | | | Join the two paths for this macro. At the end of the day, the difference was that MIPS and ARM on Apple have different behaviour. This is a setup change to remove an instance of -Wexpansion-to-defined. NFC. llvm-svn: 266913
* [AArch64] Fix libunwind build when using GNU assemblerRenato Golin2016-02-112-6/+6
| | | | | | | | | | | | | | | | | Use x29 and x30 for fp and lr respectively. This does not change the code generation with integrated asm but using x30 and x29 helps compile the code with gnu as. Currently gas fails to assemble this code with errors as below. Error: operand X should be an integer register. Newer versions of binutils should be fixed, but enough exists in the wild to make this change harmless and worthy. Patch by Khem Raj. llvm-svn: 260595
* Introduce NetBSD supportKamil Rytarowski2016-02-061-2/+3
| | | | | | Current FreeBSD and NetBSD code is compatible. llvm-svn: 260001
* Adapt LLVM_CMAKE_PATH for recent cmake path changesKamil Rytarowski2016-02-061-2/+1
| | | | | | Current LLVM installs CMake files under lib/cmake/llvm. llvm-svn: 259994
* Replace cmake check for printf with a check for fopen.Evgeniy Stepanov2015-12-101-1/+1
| | | | | | | Printf is a builtin, and the check fails with -Werror because of a clang warning about an incompatible redeclaration. llvm-svn: 255188
* Make it possible to use libunwind without heap.Peter Zotov2015-11-092-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows to use libunwind on bare-metal systems that do not include malloc/free by conditionally turning off nonessential functionality that requires these functions. The disabled functionality includes: * the .cfi_remember_state and .cfi_restore_state instructions; * the DWARF FDE cache. The .cfi_{remember,restore}_state instructions don't seem to be used by contemporary compilers. None of the LLVM backends emit it. The DWARF FDE cache is bypassed if _LIBUNWIND_NO_HEAP is defined. Specifically, entries are never added to it, so the search begins and ends at the statically allocated, empty initial cache. Such heap-less libunwind on a bare metal system is successfully used in the ARTIQ project[1], and it is my hope that it will be useful elsewhere. [1]: http://m-labs.hk/artiq Differential Revision: http://reviews.llvm.org/D11897 llvm-svn: 252452
* Add FreeBSD _Unwind_Ptr typedefEd Maste2015-10-161-1/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D13820 llvm-svn: 250541
* unwind: Allow the building of libunwind for MIPS.Vasileios Kalintiris2015-09-263-1/+13
| | | | | | | | | | | | | | | | | | | | | | Summary: Currently, libunwind doesn't support MIPS. However, with this patch we do allow the library to build, and we warn the user about the lack of support for MIPS. Also, the dummy unw_getcontext() implementation for MIPS just traps on function entry in order to avoid any confusion with silent/weird failures at runtime. This allows us to test an LLVM-based toolchain without the dependency on a GCC toolchain. Of course, C++ exception handling and other things that depend on stack unwinding will not work until we add a proper implementation of the stub functions. Reviewers: compnerd, logan Subscribers: dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D13160 llvm-svn: 248673
* unwind: cleanup -Wunused-parameterSaleem Abdulrasool2015-09-011-6/+7
| | | | | | Cleanup a number of `-Wunused-parameter` warnings. NFC. llvm-svn: 246528
* [libunwind] Add support for OpenRISC 1000.Peter Zotov2015-08-316-0/+315
| | | | | | | | | This patch makes no assumptions on ABI past the ABI defined in the OpenRISC 1000 spec except that the DWARF register numbers will be 0-31 for registers r0-r31, which is true for both gcc and clang at the moment. llvm-svn: 246413
* [libunwind] Remove unused includes.Peter Zotov2015-08-273-6/+0
| | | | llvm-svn: 246143
* unwind: fix invalid memory accessSaleem Abdulrasool2015-08-211-1/+1
| | | | | | | | Fix out-of-bounds array access when setting arm float registers. Patch by Leandro GraciĆ” Gil! llvm-svn: 245665
* Enable zero-cost exceptions on non-Apple arm64 platformsEd Maste2015-08-132-2/+5
| | | | | | | | | | Use the canonical __aarch64__ predefined macro for 64-bit ARM. Apple- specific cases are left as __arm64__. Also add an #error for unsupported architectures to catch this sort of case in the future. Differential Revision: http://reviews.llvm.org/D12005 llvm-svn: 244893
* Correct sense of unwind return address register range assertionEd Maste2015-08-131-1/+1
| | | | | | | I encountered this on FreeBSD/arm64, and then found the same issue was reported by Daniil Troshkov. llvm-svn: 244892
* Revert test commit.Tanya Lattner2015-08-061-1/+1
| | | | llvm-svn: 244297
* Test commitTanya Lattner2015-08-061-1/+1
| | | | llvm-svn: 244296
* [ARM/Unwind] Fix wrong usage of write-back on register saveRenato Golin2015-08-061-1/+1
| | | | | | | | | | | | | The register save routine in libunwind was using write-back addressing mode to r0 for thumb, when that was not only different from the ARM version and more importantly the register restore, but also saving the wrong address. Patch by Manuel Freiberger. Fixes PR24331. llvm-svn: 244237
* Update to new lists.llvm.orgTanya Lattner2015-08-051-1/+1
| | | | llvm-svn: 244005
* [libunwind] Flip order of extern "C" and attribute(visibility)Renato Golin2015-07-241-1/+1
| | | | | | | GCC doesn't seems to like having the attribute before extern, but Clang accepts it either way. This patch makes it compile on both. llvm-svn: 243147
* unwind: Fix libc++abi and libgcc build.Logan Chien2015-07-242-35/+50
| | | | | | | | | | | | To build libc++abi without libunwind, we should make sure that all function calls to _Unwind_{Get,Set}{GR,IP}() are inlined as function calls to _Unwind_VRS_{Get,Set}(). Otherwise, libc++abi.so will fail to link since libgcc does not provide these symbol at all. This commit fixes the problem by providing both the inlined version and exported version. llvm-svn: 243073
* Update version to 3.8.0svnHans Wennborg2015-07-221-1/+1
| | | | llvm-svn: 242942
* libunwind: Introduce __libunwind_config.h.Logan Chien2015-07-1911-35/+55
| | | | | | | Introduce __libunwind_config.h to avoid cross repository circular dependency with libcxxabi. llvm-svn: 242642
* Fix unw_getcontext() return value on AArch64.Logan Chien2015-06-252-1/+9
| | | | | | | | unw_getcontext() should return UNW_ESUCCESS on success. Therefore, the assembly for AArch64 is incorrect because "ldr x0, #0" is a PC-relative load instead of an immediate value load. llvm-svn: 240648
* Avoid C99 for-declaration statement in C files. (NFC)Logan Chien2015-06-251-2/+2
| | | | | | | To compile libunwind with gcc/g++ 4.9, it is required to avoid the for-declaration statement from C99. llvm-svn: 240609
* Code cleanup: Reindent statements.Logan Chien2015-05-301-3/+3
| | | | llvm-svn: 238656
* libunwind: Fix unw_step() for ARM EHABI.Logan Chien2015-05-295-73/+174
| | | | | | | | | | | | | | | | | | | This commit fixes the unw_step() for ARM EHABI. However, this commit also changes the implementation details for ARM EHABI. The first change is that the personality function should call __gnu_unwind_frame() for default (or de facto) frame unwinding based on the ARM-defined unwind opcode. The function __gnu_unwind_frame() will in turn calls unw_step() which actually unwinds the frame. The second change is that the implementation _Unwind_Backtrace() should no longer calls unw_step() to unwind the frame; since according to ARM EHABI, the personality function should unwind the frame for us. Special thanks to Anton for helpful suggestion on the initial version of this patch. llvm-svn: 238560
* Code cleanup: Remove duplicated line.Logan Chien2015-05-171-1/+0
| | | | llvm-svn: 237542
* unwind: permit building against libstdc++Saleem Abdulrasool2015-05-111-0/+1
| | | | | | | | Include algorithm early as otherwise you get a number of particularly unhelpful messages about failed static assertions. This fixes compilation on Linux with gcc. llvm-svn: 237002
* Add ARC configAnton Korobeynikov2015-05-091-0/+4
| | | | llvm-svn: 236935
* unwind: add a .clang-formatSaleem Abdulrasool2015-05-071-0/+2
| | | | | | | | This just copies the default clang-format from the LLVM project. Many developers use clang-format to ensure that the code is appropriately formatted, and this commit should also test the git-svn bridge. llvm-svn: 236767
OpenPOWER on IntegriCloud