================
@@ -2538,8 +2538,9 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl 
&gd, unsigned builtinID,
     mlir::Value addr = cir::FrameAddrOp::create(
         builder, loc, allocaInt8PtrTy,
         builder.getConstAPInt(loc, builder.getUInt32Ty(), level));
-    return RValue::get(
-        builder.createCast(loc, cir::CastKind::bitcast, addr, voidPtrTy));
+    addr = builder.createBitcast(
+        addr, builder.getVoidPtrTy(getCIRAllocaAddressSpace()));
+    return RValue::get(performAddrSpaceCast(addr, convertType(e->getType())));
----------------
aobolensk wrote:

OGCG also calls llvm.frameaddress.p5 but returns the addrspace(5) pointer as a 
generic `void *`, but that's ok there because of the opaque pointers

https://github.com/llvm/llvm-project/pull/233724
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to