[clang] [CIR] Upstream handling of integral-to-pointer casts (PR #161653)

Amr Hesham via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 3 02:46:43 PDT 2025


================
@@ -81,6 +86,19 @@ class CIRDataLayout {
   }
 
   llvm::TypeSize getTypeSizeInBits(mlir::Type ty) const;
+
+  llvm::TypeSize getPointerTypeSizeInBits(mlir::Type Ty) const {
+    assert(mlir::isa<cir::PointerType>(Ty) &&
+           "This should only be called with a pointer type");
+    return layout.getTypeSizeInBits(Ty);
+  }
+
+  mlir::Type getIntPtrType(mlir::Type Ty) const {
----------------
AmrDeveloper wrote:

```suggestion
  mlir::Type getIntPtrType(mlir::Type ty) const {
```

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


More information about the cfe-commits mailing list