[clang] [CIR][X86] Implement lowering for `_AddressOfReturnAddress` builtin (PR #171974)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 15 01:03:17 PST 2025


================
@@ -1706,7 +1706,12 @@ CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID, const CallExpr *expr) {
                                     cir::SyncScopeKind::SingleThread));
     return mlir::Value{};
   }
-  case X86::BI_AddressOfReturnAddress:
+  case X86::BI_AddressOfReturnAddress: {
+    mlir::Location loc = getLoc(expr->getExprLoc());
+    mlir::Value addr = emitIntrinsicCallOp(
+        builder, loc, "addressofreturnaddress", allocaInt8PtrTy);
----------------
xlauko wrote:

Yes these should use `AllocaAddrSpace` as `AllocaInt8PtrTy` in CG.

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


More information about the cfe-commits mailing list