[libunwind] Convert x86, x86_64, arm64 register restore functions to C calling conven...
authorMartin Storsjö <martin@martin.st>
Sun, 16 Aug 2020 12:12:55 +0000 (15:12 +0300)
committerMartin Storsjö <martin@martin.st>
Wed, 26 Aug 2020 11:32:32 +0000 (14:32 +0300)
commite524daa7e8719f4b43e6ebcf25fd4e7d74c5d1c4
tree4739de63b4d77da6c2b33c6432705ca5362e711b
parent642cb7865f35ad7dbac78d716fcddaff561e8639
[libunwind] Convert x86, x86_64, arm64 register restore functions to C calling convention and name mangling

Currently, the assembly functions for restoring register state have
been direct implementations of the Registers_*::jumpto() method
(contrary to the functions for saving register state, which are
implementations of the extern C function __unw_getcontext). This has
included having the assembly function name match the C++ mangling of
that method name (and having the function match the C++ member
function calling convention). To simplify the interface of the assembly
implementations, make the functions have C calling conventions and
name mangling.

This fixes building the library in with a MSVC C++ ABI with clang-cl,
which uses a significantly different method name mangling scheme.
(The library might not be of much use as C++ exception unwinder in such
an environment, but the libunwind.h interface for stepwise unwinding
still is usable, as is the _Unwind_Backtrace function.)

Differential Revision: https://reviews.llvm.org/D86041
libunwind/src/Registers.hpp
libunwind/src/UnwindRegistersRestore.S