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

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 1 15:14:27 PDT 2025


================
@@ -2052,8 +2052,8 @@ mlir::Value CIRGenFunction::emitAlloca(StringRef name, mlir::Type ty,
   // CIR uses its own alloca address space rather than follow the target data
   // layout like original CodeGen. The data layout awareness should be done in
   // the lowering pass instead.
-  assert(!cir::MissingFeatures::addressSpace());
-  cir::PointerType localVarPtrTy = builder.getPointerTo(ty);
+  cir::PointerType localVarPtrTy =
+      builder.getPointerTo(ty, getASTAllocaAddressSpace());
----------------
andykaylor wrote:

```suggestion
      builder.getPointerTo(ty, getCIRAllocaAddressSpace());
```

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


More information about the cfe-commits mailing list