[PATCH] D138981: [demangler][LoongArch] Correct the mangled_size for long double

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 22:43:51 PST 2022


SixWeining created this revision.
SixWeining added reviewers: urnathan, rsmith, piggynl, MaskRay, xen0n, xry111, wangleiat.
Herald added subscribers: StephenFan, luismarques, s.egerton, PkmX, simoncook, arichardson.
Herald added a project: All.
SixWeining requested review of this revision.
Herald added subscribers: llvm-commits, libcxx-commits, pcwang-thead, aheejin.
Herald added projects: libc++abi, LLVM.
Herald added a reviewer: libc++abi.

The size of long double in LoongArch (both LA32 and LA64) is 16 bytes, thus
the mangled_size should be 32.

This is same as RISCV's change in D126480 <https://reviews.llvm.org/D126480>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138981

Files:
  libcxxabi/src/demangle/ItaniumDemangle.h
  llvm/include/llvm/Demangle/ItaniumDemangle.h


Index: llvm/include/llvm/Demangle/ItaniumDemangle.h
===================================================================
--- llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -5119,7 +5119,7 @@
 struct FloatData<long double>
 {
 #if defined(__mips__) && defined(__mips_n64) || defined(__aarch64__) || \
-    defined(__wasm__) || defined(__riscv)
+    defined(__wasm__) || defined(__riscv) || defined(__loongarch__)
     static const size_t mangled_size = 32;
 #elif defined(__arm__) || defined(__mips__) || defined(__hexagon__)
     static const size_t mangled_size = 16;
Index: libcxxabi/src/demangle/ItaniumDemangle.h
===================================================================
--- libcxxabi/src/demangle/ItaniumDemangle.h
+++ libcxxabi/src/demangle/ItaniumDemangle.h
@@ -5119,7 +5119,7 @@
 struct FloatData<long double>
 {
 #if defined(__mips__) && defined(__mips_n64) || defined(__aarch64__) || \
-    defined(__wasm__) || defined(__riscv)
+    defined(__wasm__) || defined(__riscv) || defined(__loongarch__)
     static const size_t mangled_size = 32;
 #elif defined(__arm__) || defined(__mips__) || defined(__hexagon__)
     static const size_t mangled_size = 16;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138981.478807.patch
Type: text/x-patch
Size: 1224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221130/807c4bbf/attachment.bin>


More information about the llvm-commits mailing list