[PATCH] D80690: [RISCV] Support libunwind for riscv32
Mitchell Horne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 22 05:52:43 PDT 2020
mhorne added inline comments.
================
Comment at: libunwind/src/Registers.hpp:3727
+// This is just for supresing undeclared error of fp_t
+ typedef double fp_t;
+#endif
----------------
Only the preprocessor directives need indentation, not the typedef.
================
Comment at: libunwind/src/Registers.hpp:3803
-inline uint64_t Registers_riscv::getRegister(int regNum) const {
+inline size_t Registers_riscv::getRegister(int regNum) const {
if (regNum == UNW_REG_IP)
----------------
I don't think `size_t` is an appropriate type for this, although it would likely work in all cases. I think what you want is either an `unsigned long` or something like the following:
```
#if __riscv_xlen == 64
typedef uint64_t reg_t;
#elif __riscv_xlen == 32
typedef uint32_t reg_t;
#endif
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80690/new/
https://reviews.llvm.org/D80690
More information about the llvm-commits
mailing list