[clang] [CIR] Upstream `AddressSpace` support for `PointerType` (PR #161028)

Fabian Mora via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 1 14:36:20 PDT 2025


================
@@ -297,6 +317,20 @@ bool RecordType::isLayoutIdentical(const RecordType &other) {
 // Data Layout information for types
 //===----------------------------------------------------------------------===//
 
+llvm::TypeSize
+PointerType::getTypeSizeInBits(const ::mlir::DataLayout &dataLayout,
+                               ::mlir::DataLayoutEntryListRef params) const {
+  // FIXME: improve this in face of address spaces
----------------
fabianmcg wrote:

For reference, here’s how ptr handles type size with the data layout.
https://github.com/llvm/llvm-project/blob/69a53b8d54a6876dd322923a148d47749b76c5fc/mlir/lib/Dialect/Ptr/IR/PtrTypes.cpp#L118

And here is an IR example:
https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/Ptr/layout.mlir


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


More information about the cfe-commits mailing list