[Lldb-commits] [lldb] [lldb][RISCV] Make char an unsigned type for RISC-V by default (PR #182260)

via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 19 04:51:15 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Georgiy Samoylov (sga-sc)

<details>
<summary>Changes</summary>

According to RISC-V ELF psABI, Section 4.3 (C/C++ Type Representations) "char is unsigned".

This patch makes plain `char` unsigned by default on RISC-V. Also this fixes TestConstStaticIntegralMember.py on RISC-V

---
Full diff: https://github.com/llvm/llvm-project/pull/182260.diff


1 Files Affected:

- (modified) lldb/source/Utility/ArchSpec.cpp (+2) 


``````````diff
diff --git a/lldb/source/Utility/ArchSpec.cpp b/lldb/source/Utility/ArchSpec.cpp
index dfe4351f0c45b..7a6fed11677fc 100644
--- a/lldb/source/Utility/ArchSpec.cpp
+++ b/lldb/source/Utility/ArchSpec.cpp
@@ -721,6 +721,8 @@ bool ArchSpec::CharIsSignedByDefault() const {
   case llvm::Triple::ppc64:
     return m_triple.isOSDarwin();
 
+  case llvm::Triple::riscv64:
+  case llvm::Triple::riscv32:
   case llvm::Triple::ppc64le:
   case llvm::Triple::systemz:
   case llvm::Triple::xcore:

``````````

</details>


https://github.com/llvm/llvm-project/pull/182260


More information about the lldb-commits mailing list