[PATCH] D101179: [libunwind] NFC: Use macros to accommodate differences in representation of PowerPC assemblers

Xing Xue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 28 06:53:58 PDT 2021


xingxue added a comment.

In D101179#2721113 <https://reviews.llvm.org/D101179#2721113>, @compnerd wrote:

> While I think that this is fine in general, I'm not sure why the shift operator needs to be replaced.  Could you shed some light on that?

Sorry, I should have mentioned in the description, the left shift operator in the `AIX` assembly language is `<` instead of `<<`.



================
Comment at: libunwind/src/assembly.h:220
+#if defined(__ppc__) || defined(__powerpc64__)
+  // clang-format off
+#define GPR(num) %r##num
----------------
MaskRay wrote:
> unneeded  // clang-format off ?
The `pre-merge check` failed because `clang-format` wants to make the following change.  However, the assembler will fail if a space is inserted in between `%` and the register character after it.  `// clang-format off` is used to turn off `clang-format` for this segment.

```
clang-format: please reformat the code

-#define GPR(num) %r##num
-#define FPR(num) %f##num
-#define VSR(num) %vs##num
-#define VR(num) %v##num
+#define GPR(num) % r##num
+#define FPR(num) % f##num
+#define VSR(num) % vs##num
+#define VR(num) % v##num
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101179



More information about the llvm-commits mailing list