[libcxx-commits] [PATCH] D116857: [libunwind] [sparc] Add SPARCv9 support

Fangrui Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 31 15:12:48 PST 2022


MaskRay added a comment.

In D116857#3281535 <https://reviews.llvm.org/D116857#3281535>, @Arfrever wrote:

> In D116857#3281390 <https://reviews.llvm.org/D116857#3281390>, @thesamesam wrote:
>
>> Apparently I have both `_LIBUNWIND_TARGET_SPARC` and `_LIBUNWIND_TARGET_SPARC64` set?
>
> This happens when libunwind is configured with `-DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON` passed to cmake.
> Then https://github.com/llvm/llvm-project/blob/8faf2a0638d3e8d9411d55c3e5dfb7b452f35ca2/libunwind/CMakeLists.txt#L325-L328 does NOT enable `_LIBUNWIND_IS_NATIVE_ONLY`.
> Then `#else // !_LIBUNWIND_IS_NATIVE_ONLY` block in `libunwind/include/__libunwind_config.h` is enabled and it contains (with changes from this patchset):
>
>   # define _LIBUNWIND_TARGET_SPARC 1
>   # define _LIBUNWIND_TARGET_SPARC64 1

Would it be clearer to have `_LIBUNWIND_TARGET_SPARC32` and `_LIBUNWIND_TARGET_SPARC64` to indicate 32-bit and 64-bit variants?



================
Comment at: libunwind/src/DwarfInstructions.hpp:276
+#if defined(_LIBUNWIND_TARGET_SPARC64)
+      if (R::getArch() == REGISTERS_SPARC64) {
+        // Skip call site instruction and delay slot
----------------
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements you can move the comment before `if` and remove braces.


================
Comment at: libunwind/src/DwarfParser.hpp:74
     kRegisterInCFA,
+    kRegisterInCFADecrypt,
     kRegisterOffsetFromCFA,
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116857/new/

https://reviews.llvm.org/D116857



More information about the libcxx-commits mailing list