[clang] [CIR][CIRGen] Cast stack allocas to the language-visible address space (PR #196868)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue May 19 18:19:52 PDT 2026


================
@@ -544,7 +544,9 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
 
   mlir::Value createPtrBitcast(mlir::Value src, mlir::Type newPointeeTy) {
     assert(mlir::isa<cir::PointerType>(src.getType()) && "expected ptr src");
-    return createBitcast(src, getPointerTo(newPointeeTy));
+    cir::PointerType srcPtrTy = mlir::cast<cir::PointerType>(src.getType());
----------------
andykaylor wrote:

Oh! For some reason I was thinking that newPointeeTy was always a pointer type. That is, I thought this was casting from one pointer type to a different pointer type. I guess the "pointee" part should have clued me in. Sorry for my confusion.

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


More information about the cfe-commits mailing list