aboutsummaryrefslogtreecommitdiff
path: root/libunwind/include
AgeCommit message (Collapse)AuthorFilesLines
2025-12-16[libc++] Enable -Wmissing-prototypes (#116261)Nikolas Klauser1-1/+4
2025-12-11[runtimes] Modernize installation targets (#171677)Louis Dionne1-4/+2
This patch moves away from using cmake_install scripts to install the various targets when building runtimes, since those have been deprecated by CMake. Instead, we use `cmake --install` which is the prefered method. This patch also localizes how we set dependencies on the various installation targets, allowing the removal of a few global variables that were used as lists. Finally, it makes the way we set up installation targets for libc++, libc++abi and libunwind consistent again.
2025-11-11libunwind: Implement the unw_strerror function for better nongnu libunwind ↵Gleb Popov1-0/+1
compatibility (#160887) As it was explained to me in https://discourse.llvm.org/t/libunwinds-raison-detre/88283/2 the LLVM version of libunwind is mostly compatible with nongnu one. This change improves the compatibility a bit further.
2025-10-22[PAC][libunwind] Fix gcc build of libunwind and compiler-rt (#164535)Oliver Hunt1-5/+7
This adds guards on the ptrauth feature checks so that they are only performed if __has_feature is actually available.
2025-10-20[runtimes][PAC] Harden unwinding when possible (#143230)Oliver Hunt2-11/+122
This hardens the unwinding logic and datastructures on systems that support pointer authentication. The approach taken to hardening is to harden the schemas of as many high value fields in the myriad structs as possible, and then also explicitly qualify local variables referencing privileged or security critical values. This does introduce ABI linkage between libcxx, libcxxabi, and libunwind but those are in principle separate from the OS itself so we've kept the schema definitions in the library specific headers rather than ptrauth.h
2025-08-21[libunwind] Add support for the AArch64 "Vector Granule" (VG) register (#153565)Benjamin Maxwell2-2/+3
The vector granule (AArch64 DWARF register 46) is a pseudo-register that contains the available size in bits of SVE vector registers in the current call frame, divided by 64. The vector granule can be used in DWARF expressions to describe SVE/SME stack frame layouts (e.g., the location of SVE callee-saves). The first time VG is evaluated (if not already set), it is initialized to the result of evaluating a "CNTD" instruction (this assumes SVE is available). To support SME, the value of VG can change per call frame; this is currently handled like any other callee-save and is intended to support the unwind information implemented in #152283. This limits how VG is used in the CFI information of functions with "streaming-mode changes" (mode changes that change the SVE vector length), to make the unwinder's job easier.
2024-12-15[libunwind] Fix compilation for the x32 ABI. (#116608)Alex Rønne Petersen1-0/+3
This would previously fail the static assertions in `UnwindCursor.hpp` due to `UnwindCursor`'s size not matching `unw_cursor_t`'s size. As is done for MIPS N32, this just declares the appropriate size in `__libunwind_config.h`.
2024-08-22[libunwind] Stop installing the mach-o module map (#105616)Ian Anderson2-5/+0
libunwind shouldn't know that compact_unwind_encoding.h is part of a MachO module that it doesn't own. Delete the mach-o module map, and let whatever is in charge of the mach-o directory be the one to say how its module is organized and where compact_unwind_encoding.h fits in.
2024-05-21[libunwind][WebAssembly] Make libunwind compilable (#92192)Heejin Ahn1-0/+4
This tries to make Wasm compilable in LLVM tree with CMake for non-Emscripten platform. This - Adds `-D__USING_WASM_EXCEPTIONS__` when you compile with `-fwasm-exceptions` (like other EH options) in Clang - Exclude `UnwindLevel1.c`, `UnwindRegistersSave.S`, and `UnwindRegistersRestore.S` when compiling with Wasm - Changed some `__USING_WASM_EXCEPTIONS__` to `__wasm__`; they should be applied when compiling with Wasm w/o exceptions. - Define some unused macros to make it compile Fixes #72771.
2023-11-15[libunwind] Fix an inconsistent indentation (NFC) (#72314)Heejin Ahn1-1/+1
2023-09-06[libunwind] Haiku: Initial supportTrung Nguyen1-0/+3
Adds build support for Haiku. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D157866
2023-08-31[runtimes] Fix some duplicate word typosLouis Dionne1-1/+1
Those fixes were taken from https://reviews.llvm.org/D137338.
2023-08-31[libunwind][NFC] Fix whitespace in commentsLouis Dionne1-40/+40
2023-08-19MIPS: unwind, don't save/restore hi/lo for R6YunQiang Su1-0/+3
HI/LO registers have been removed in MIPSr6. Save and restore them only for pre-R6. We keep the memory space for the registers so that we can use the same register indexes for r6 and pre-r6. Fixes: #60682 Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D156283
2023-04-11[libunwind] Increase the external value of _LIBUNWIND_CURSOR_SIZE for SEH/x86_64Martin Storsjö1-1/+1
For x86_64 Windows targets (that use SEH), _LIBUNWIND_CURSOR_SIZE is 204; this fixes corruption in test cases that include libunwind.h without manually defining _LIBUNWIND_IS_NATIVE_ONLY. If the libunwind.h header is included without defining _LIBUNWIND_IS_NATIVE_ONLY (like in the libunwind test cases), the sizes are set to accommodate the maximum possible cursors and contexts. (Alternatively, __libunwind_config.h should be changed to default to native unwinding unless cross unwinding has been requested. Cross unwinding isn't implemented as far as I know anyway.) Differential Revision: https://reviews.llvm.org/D147634
2023-04-05[libunwind] Fix a case of inconsistent indentation. NFC.Martin Storsjö1-1/+1
2023-03-20[libunwind][Modules] Add unwind_arm_ehabi.h and unwind_itanium.h to the ↵Ian Anderson2-2/+5
unwind module) Add unwind_arm_ehabi.h and unwind_itanium.h to the unwind module and use angle includes to include them. Reviewed By: ldionne, #libunwind Differential Revision: https://reviews.llvm.org/D144323
2022-12-06[libunwind][RISCV] Support reading of VLENB CSR registerSergey Kachkov1-0/+10
Support reading of VLENB (vector byte length) control register, that can be required for correct unwinding of RVV objects on stack. Differential Revision: https://reviews.llvm.org/D136264
2022-11-15[libunwind][LoongArch] Add 64-bit LoongArch supportzhanglimin2-0/+80
Defines enums for the LoongArch registers. Adds the register class implementation for LoongArch. Adds save and restore context functionality. This only supports 64 bits integer and float-point register implementation. Fix https://github.com/llvm/llvm-project/issues/55398 Reviewed By: SixWeining Differential Revision: https://reviews.llvm.org/D137010
2022-10-26[libunwind] Add module maps for libunwindIan Anderson3-0/+16
Add module maps for the libunwind headers. unwind_arm_ehabi.h and unwind_itanium.h aren't covered because they don't get installed on all platforms. Reviewed By: #libunwind, MaskRay Differential Revision: https://reviews.llvm.org/D135345
2022-08-20[libunwind] Fixed a number of typosGabriel Ravier2-4/+4
I went over the output of the following mess of a command: `(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)` and proceeded to spend a few days looking at it to find probable typos and fixed a few hundred of them in all of the llvm project (note, the ones I found are not anywhere near all of them, but it seems like a good start). Reviewed By: #libunwind, MaskRay Differential Revision: https://reviews.llvm.org/D130948
2022-06-06[libunwind] Fix SEH unwinding on ARMMartin Storsjö2-2/+2
Check `__SEH__` when checking if ARM EHABI should be implied, similarly to 4a3722a2c3dff1fe885cc38bf43d3c095c9851e7 / D126866. Fix a warning by using the right format specifier (PRIxPTR instead of PRIx64), and add a double->float cast in a codepath that hasn't been built so far. This is enough to make SEH unwinding of itanium ABI exceptions on ARM mostly work - one specific issue is fixed in a separate follow-up patch. Differential Revision: https://reviews.llvm.org/D126867
2022-05-02[libunwind] Add SystemZ supportUlrich Weigand2-0/+49
Add support for the SystemZ (s390x) architecture to libunwind. Support should be feature-complete with the exception of unwinding from signal handlers (to be added later). Reviewed by: MaskRay Differential Revision: https://reviews.llvm.org/D124248
2022-04-13[libunwind][AIX] implementation of the unwinder for AIXXing Xue2-1/+4
Summary: This patch contains the implementation of the unwinder for IBM AIX. AIX does not support the eh_frame section. Instead, the traceback table located at the end of each function provides the information for stack unwinding and EH. In this patch macro _LIBUNWIND_SUPPORT_TBTAB_UNWIND is used to guard code for AIX traceback table based unwinding. Function getInfoFromTBTable() and stepWithTBTable() are added to get the EH information from the traceback table and to step up the stack respectively. There are two kinds of LSDA information for EH on AIX, the state table and the range table. The state table is used by the previous version of the IBM XL compiler, i.e., xlC and xlclang++. The DWARF based range table is used by AIX clang++. The traceback table has flags to differentiate these cases. For the range table, relative addresses are calculated using a base of DW_EH_PE_datarel, which is the TOC base of the module where the function of the current frame belongs. Two personality routines are employed to handle these two different LSDAs, __xlcxx_personality_v0() for the state table and __xlcxx_personality_v1() for the range table. Since the traceback table does not have the information of the personality for the state table approach, its personality __xlcxx_personality_v0() is dynamically resolved as the handler for the state table. For the range table, the locations of the LSDA and its associated personality routine are found in the traceback table. Assembly code for 32- and 64-bit PowerPC in UnwindRegistersRestore.S and UnwindRegistersSave.S are modified so that it can be consumed by the GNU flavor assembler and the AIX assembler. The restoration of vector registers does not check VRSAVE on AIX because VRSAVE is not used in the AIX ABI. Reviewed by: MaskRay, compnerd, cebowleratibm, sfertile, libunwind Differential Revision: https://reviews.llvm.org/D100132
2022-03-30[libunwind] Add a _LIBUNWIND_VERSION macroLouis Dionne1-0/+2
This allows us to detect whether we're being compiled with LLVM's libunwind more easily, without CMake having to set explicit variables. As discussed in https://llvm.org/D119538. Differential Revision: https://reviews.llvm.org/D121015
2022-02-05[libunwind] [sparc] Add SPARCv9 supportKoakuma1-0/+8
Adds libunwind support for SPARCv9 (aka sparc64). This is a rebase of @kettenis' patch D32450, which I created (with his permission) because the original review has become inactive. The changes are of a cosmetic nature to make it fit better with the new code style, and to reuse the existing SPARCv8 code, whenever possible. Please let me know if I posted this on the wrong place. Also, the summary of the original review is reproduced below: > This adds unwinder support for 64-bit SPARC (aka SPARCv9). The implementation was done on OpenBSD/sparc64, so it takes StackGhost into account: > > https://www.usenix.org/legacy/publications/library/proceedings/sec01/full_papers/frantzen/frantzen_html/index.html > > Since StackGhost xor's return addresses with a random cookie before storing them on the stack, the unwinder has to do some extra work to recover those. This is done by introducing a new kRegisterInCFADecrypt "location" type that is used to implement the DW_CFA_GNU_window_save opcode. That implementation is SPARC-specific, but should work for 32-bit SPARC as well. DW_CFA_GNU_window_save is only ever generated on SPARC as far as I know. Co-authored-by: Mark Kettenis Reviewed By: #libunwind, thesamesam, MaskRay, Arfrever Differential Revision: https://reviews.llvm.org/D116857
2022-01-27[unwind] fix build with GCC on PPC32Sam James1-1/+1
Originally reported downstream in Gentoo: https://bugs.gentoo.org/832140 ``` /var/tmp/portage/sys-libs/llvm-libunwind-13.0.0/work/libunwind/src/libunwind.cpp:77:3: error: #error Architecture not supported 77 | # error Architecture not supported | ^~~~~ [...] /var/tmp/portage/sys-libs/llvm-libunwind-13.0.0/work/libunwind/src/libunwind.cpp: In function ‘int __unw_init_local(unw_cursor_t*, unw_context_t*)’: /var/tmp/portage/sys-libs/llvm-libunwind-13.0.0/work/libunwind/src/libunwind.cpp:80:57: error: ‘REGISTER_KIND’ was not declared in this scope 80 | new (reinterpret_cast<UnwindCursor<LocalAddressSpace, REGISTER_KIND> *>(cursor)) | ^~~~~~~~~~~~~ [...] ``` PPC is actually a supported architecture, but GCC (tested with 11.2.0) on powerpc32 seems to only define: `__PPC__, _ARCH_PPC, __PPC, __powerpc` and //not// `__ppc__`. This instead uses `__powerpc__` which should be around on PPC32 and PPC64 (but we check it after PPC64, so it's fine). Signed-off-by: Sam James <sam@gentoo.org> Differential Revision: https://reviews.llvm.org/D118320
2022-01-10[libunwind][cmake] Create `LIBUNWIND_INSTALL_INCLUDE_DIR` CACHE PATHJohn Ericson1-1/+1
This is created on analogy with the other CACHE PATHs in this package, and other `*_INSTALL_INCLUDE_DIR` in other packages. The branching is adjusted to deduplicate some existing code, and likewise avoid having to define this new variable more than once. This will be used for D99484. Reviewed By: #libunwind, compnerd Differential Revision: https://reviews.llvm.org/D116873
2021-12-16[libunwind] Provide a way to conveniently install libunwind headersPoYao Chang1-0/+31
This adds a CMake option (defaults to OFF to not be intrusive) to activate 2 new targets `install-unwind-headers` and `install-unwind-headers-stripped`. So, for example: cmake -S runtimes -B build -G Ninja \ -DLLVM_ENABLE_RUNTIMES='libunwind' \ -DLIBUNWIND_INSTALL_HEADERS=ON And then, `ninja -C build install-unwind` would install headers in addition to good ol' dylibs and archives, i.e., targets `install-unwind*` `DEPENDS` on `install-unwind-headers*`. On the other hand, `ninja -C build install-unwind-headers` gives you headers only. Differential Revision: https://reviews.llvm.org/D115535
2021-12-08[ARM][libunwind] add PACBTI-M support for libunwindTies Stuij2-4/+6
This patch implements the following: - Emit PACBTI-M build attributes in libunwind asm files - Authenticate LR in DWARF32 using PACBTI Use Armv8.1-M.Main PACBTI extension to authenticate the return address (stored in the LR register) before moving it to the PC (IP) register. The AUTG instruction is used with the candidate return address, the CFA, and the authentication code that is retrieved from the saved pseudo-register RA_AUTH_CODE. - Authenticate LR in EHABI using PACBTI Authenticate the contents of the LR register using Armv8.1-M.Main PACBTI extension. A new frame unwinding instruction is introduced (0xb4). This instruction pops out of the stack the return address authentication code, which is then used in conjunction with the SP and the next-to-be instruction pointer to perform authentication. This authentication code is popped into a new register, UNW_ARM_PSEUDO_PAC, which is a pseudo-register. This patch is part of a series that adds support for the PACBTI-M extension of the Armv8.1-M architecture, as detailed here: https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension The PACBTI-M specification can be found in the Armv8-M Architecture Reference Manual: https://developer.arm.com/documentation/ddi0553/latest The following people contributed to this patch: - Momchil Velikov - Victor Campos - Ties Stuij Reviewed By: #libunwind, danielkiss, mstorsjo Differential Revision: https://reviews.llvm.org/D112430
2021-11-17[runtimes][NFC] Remove filenames at the top of the license noticeLouis Dionne6-6/+6
We've stopped doing it in libc++ for a while now because these names would end up rotting as we move things around and copy/paste stuff. This cleans up all the existing files so as to stop the spreading as people copy-paste headers around.
2021-09-02[Unwind] Harmonise exception class for EHABI spec.Daniel Kiss3-3/+5
EHABI defines the exception class as char[8] instead of uint64_t [1]. For ABI compatibility the ABI the definition needs to be updated. [1] https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst#82language-independent-unwinding-types-and-functions Reviewed By: manojgupta, MaskRay, #libunwind Differential Revision: https://reviews.llvm.org/D109047
2021-08-20[libunwind] Add UNW_AARCH64_* beside UNW_ARM64_*Fangrui Song1-70/+143
The original libunwind project defines UNW_AARCH64_* instead of UNW_ARM64_*. Rename the enum members to match. This allows some applications with simple `unw_init_local` usage to migrate to llvm-project libunwind. Note: the canonical names of `UNW_ARM_D{0..31}` are now `UNW_AARCH64_V{0..31}`, to match the original libunwind. UNW_ARM64_* are kept for now for compatibility. Some may be unneeded and can be cleaned up in the future. Reviewed By: #libunwind, compnerd Differential Revision: https://reviews.llvm.org/D107996
2021-08-11[Arm][Unwind][libc++abi] Add _Unwind_ForcedUnwind to EHABI.Daniel Kiss3-14/+9
_Unwind_ForcedUnwind is not mandated by the EHABI but for compatibilty reasons adding so the interface to higher layers would be the same. Dropping EHABI specific _Unwind_Stop_Fn definition since it is not defined by EHABI. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D89570
2021-08-11[Unwind] Split unwind.hDaniel Kiss3-198/+258
Moving Itanium and ArmEHABI specific implementations to dedicated files. This is a NFC patch. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D106461
2021-03-02[libunwind] This adds support in libunwind for rv32 hard floatKamlesh Kumar1-5/+12
and soft-float for both rv32 and rv64. Differential Revision: https://reviews.llvm.org/D80690
2021-02-17[libunwind] Add support for PC reg column in arm64Marco Vanotti1-23/+24
This change adds support for the dwarf PC register column in arm64, allowing CFI directives to make use of it. As of the last revision of the DWARF for ARM 64-bit architecture[0], the pc register has been added as a valir register, with number 32. This allows libunwinder to restore both pc and lr, which is useful for stack switches and signal contexts. [0]: https://github.com/ARM-software/abi-aa/blob/f52e1ad3f81254497a83578dc102f6aac89e52d0/aadwarf64/aadwarf64.rst Reviewed By: phosek, #libunwind Differential Revision: https://reviews.llvm.org/D96901
2021-01-17[VE] Support VE in libunwindKazushi (Jam) Marukawa2-0/+159
Modify libunwind to support SjLj exception handling routines for VE. In order to do that, we need to implement not only SjLj exception handling routines but also a Registers_ve class. This implementation of Registers_ve is incomplete. We will work on it later when we need backtrace in libunwind. Reviewed By: #libunwind, compnerd Differential Revision: https://reviews.llvm.org/D94591
2021-01-13[libunwind] Unwind through aarch64/Linux sigreturn frameRyan Prichard1-0/+3
An AArch64 sigreturn trampoline frame can't currently be described in a DWARF .eh_frame section, because the AArch64 DWARF spec currently doesn't define a constant for the PC register. (PC and LR may need to be restored to different values.) Instead, use the same technique as libgcc or github.com/libunwind and detect the sigreturn frame by looking for the sigreturn instructions: mov x8, #0x8b svc #0x0 If a sigreturn frame is detected, libunwind restores all the GPRs by assuming that sp points at an rt_sigframe Linux kernel struct. This behavior is a fallback mode that is only used if there is no ordinary unwind info for sigreturn. If libunwind can't find unwind info for a PC, it assumes that the PC is readable, and would crash if it isn't. This could happen if: - The PC points at a function compiled without unwind info, and which is part of an execute-only mapping (e.g. using -Wl,--execute-only). - The PC is invalid and happens to point to unreadable or unmapped memory. In the tests, ignore a failed dladdr call so that the tests can run on user-mode qemu for AArch64, which uses a stack-allocated trampoline instead of a vDSO. Reviewed By: danielkiss, compnerd, #libunwind Differential Revision: https://reviews.llvm.org/D90898
2020-08-22[libunwind] Ensure enough alignment for unw_cursor_t for SEH build ↵Martin Storsjö1-1/+7
configurations When built in SEH mode, UnwindCursor contains a CONTEXT struct, which is aligned to 16 bytes in most configurations, causing the whole UnwindCursor object to have 16 byte alignment. This fixes backtraces using _Unwind_Backtrace on x86_64 mingw, where an unw_cursor_t allocated on the stack was misaligned before. This is an ABI break for this struct for this configuration, but very few callers call libunwind directly (and even fewer directly allocate an unw_cursor_t anyway). Differential Revision: https://reviews.llvm.org/D86102
2020-04-10[libunwind] add hexagon supportBrian Cain2-0/+46
2020-02-10unwind: rename `__personality_routine` to `_Unwind_Personality_Fn`Saleem Abdulrasool1-13/+8
This patch renames `__personality_routine` to `_Unwind_Personality_Fn` in `unwind.h`. Both `unwind.h` from clang and GCC headers use this name instead of `__personality_routine`. With this patch one is also able to build libc++abi with libunwind support on Windows. Patch by Markus Böck!
2019-12-16[libunwind][RISCV] Add 64-bit RISC-V supportSam Elliott2-0/+82
Summary: Add unwinding support for 64-bit RISC-V. This is from the FreeBSD implementation with the following minor changes: - Renamed and renumbered DWARF registers to match the RISC-V ABI [1] - Use the ABI mneumonics in getRegisterName() instead of the exact register names - Include checks for __riscv_xlen == 64 to facilitate adding the 32-bit ABI in the future. [1] https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md Patch by Mitchell Horne (mhorne) Reviewers: lenary, luismarques, compnerd, phosek Reviewed By: lenary, luismarques Subscribers: arichardson, sameer.abuasal, abidh, asb, aprantl, krytarowski, simoncook, kito-cheng, christof, shiva0217, rogfer01, rkruppe, PkmX, psnobl, benna, lenary, s.egerton, luismarques, emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D68362
2019-04-11[NFC] Correct outdated links to the Itanium C++ ABI documentationLouis Dionne1-1/+1
Those are now hosted on GitHub. rdar://problem/36557462 llvm-svn: 358191
2019-02-02[libunwind] Remove the remote unwinding supportPetr Hosek1-26/+0
This is unfinished, unused and incomplete. This could be brought back in the future if there's a desire to build a more complete implementation, but at the moment it's just bitrotting. Differential Revision: https://reviews.llvm.org/D57252 llvm-svn: 352965
2019-01-29Don't define unw_fpreg_t to uint64_t for __ARM_DWARF_EH__Martin Storsjo1-1/+1
The existing typedef of unw_fpreg_t to uint64_t might work and be correct for the ARM_EHABI case, but for dwarf, some cases in e.g. DwarfInstructions.hpp convert between double and unw_fpreg_t. When converting implicitly between double and unw_fpreg_t (uint64_t), the values get interpreted as integers and converted to float and vice versa, while the correct thing would be to keep the same bit pattern. Avoid the whole issue by using the same definition of unw_fpreg_t as all other architectures, when using dwarf unwinding on ARM. Change assembler functions to take a void pointer instead of unw_fpreg_t pointer, to avoid having a different mangled symbol name depending on the actual value of this typedef. Differential Revision: https://reviews.llvm.org/D57001 llvm-svn: 352461
2019-01-19Update more file headers across all of the LLVM projects in the monorepoChandler Carruth4-16/+12
to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
2019-01-14[Sparc] Add Sparc V8 supportDaniel Cederman2-0/+43
Summary: Adds the register class implementation for Sparc. Adds support for DW_CFA_GNU_window_save. Adds save and restore context functionality. Adds getArch() function to each Registers_ class to be able to separate between DW_CFA_AARCH64_negate_ra_state and DW_CFA_GNU_window_save which are both represented by the same constant. On Sparc the return address is the address of the call instruction, so an offset needs to be added when returning to skip the call instruction and its delay slot. If the function returns a struct it is also necessary to skip one extra instruction on Sparc V8. Reviewers: jyknight, mclow.lists, mstorsjo, compnerd Reviewed By: jyknight, compnerd Subscribers: jgorbe, mgorny, christof, llvm-commits, fedor.sergeev, JDevlieghere, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D55763 llvm-svn: 351044
2019-01-10Revert "[Sparc] Add Sparc V8 support"Jorge Gorbe Moya2-43/+0
This reverts commit r350705. llvm-svn: 350787
2019-01-09[Sparc] Add Sparc V8 supportDaniel Cederman2-0/+43
Summary: Adds the register class implementation for Sparc. Adds support for DW_CFA_GNU_window_save. Adds save and restore context functionality. On Sparc the return address is the address of the call instruction, so an offset needs to be added when returning to skip the call instruction and its delay slot. If the function returns a struct it is also necessary to skip one extra instruction. Reviewers: jyknight, mclow.lists, mstorsjo, compnerd Reviewed By: compnerd Subscribers: fedor.sergeev, JDevlieghere, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D55763 llvm-svn: 350705