[clang] [clang-repl] Fix RuntimeInterfaceBuilder for 32-bit systems (PR #97071)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 28 13:17:22 PDT 2024


================
@@ -673,10 +673,12 @@ class InterfaceKindVisitor
   }
 
 private:
-  // Force cast these types to uint64 to reduce the number of overloads of
-  // `__clang_Interpreter_SetValueNoAlloc`.
+  // Force cast these types to the uint that fits the register size. That way we
+  // reduce the number of overloads of `__clang_Interpreter_SetValueNoAlloc`.
   void HandleIntegralOrEnumType(const Type *Ty) {
-    TypeSourceInfo *TSI = Ctx.getTrivialTypeSourceInfo(Ctx.UnsignedLongLongTy);
+    uint64_t PtrBits = Ctx.getTypeSize(Ctx.VoidPtrTy);
+    QualType UIntTy = Ctx.getBitIntType(true, PtrBits);
----------------
vgvassilev wrote:

```suggestion
    QualType UIntTy = Ctx.getBitIntType(/*Unsigned=*/true, PtrBits);
```

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


More information about the cfe-commits mailing list