From df07a35912d78781ed6a62a7c032bfef5085a4f5 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 24 Jul 2018 00:29:58 +0000 Subject: [WebAssembly] Change size_t to `unsigned long`. Changing it to unsigned long (which is 32-bit on wasm32) makes it the same type as wasm64 (where unsigned long is 64-bit), which would eliminate the most common cause for mangled names being different between wasm32 and wasm64. For example, export lists containing symbol names could now often be the same between wasm32 and wasm64. Differential Revision: https://reviews.llvm.org/D40526 llvm-svn: 337783 --- clang/lib/Basic/Targets/WebAssembly.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'clang/lib/Basic') diff --git a/clang/lib/Basic/Targets/WebAssembly.h b/clang/lib/Basic/Targets/WebAssembly.h index b0e466b8d8c..c04c5cb6fb3 100644 --- a/clang/lib/Basic/Targets/WebAssembly.h +++ b/clang/lib/Basic/Targets/WebAssembly.h @@ -47,9 +47,11 @@ public: LongDoubleWidth = LongDoubleAlign = 128; LongDoubleFormat = &llvm::APFloat::IEEEquad(); MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; - SizeType = UnsignedInt; - PtrDiffType = SignedInt; - IntPtrType = SignedInt; + // size_t being unsigned long for both wasm32 and wasm64 makes mangled names + // more consistent between the two. + SizeType = UnsignedLong; + PtrDiffType = SignedLong; + IntPtrType = SignedLong; } protected: -- cgit v1.2.3