[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 3 09:33:54 PST 2024


================
@@ -1672,10 +1672,11 @@ CodeGenTypes::GetFunctionType(const CGFunctionInfo &FI) {
 
   // Add type for sret argument.
   if (IRFunctionArgs.hasSRetArg()) {
-    QualType Ret = FI.getReturnType();
-    unsigned AddressSpace = CGM.getTypes().getTargetAddressSpace(Ret);
+    auto AddressSpace = CGM.getTarget().getIndirectArgAddressSpace();
----------------
rjmccall wrote:

That's what I was thinking, yeah.  There should be plenty of space for that without inflating `ABIInfo`, right?

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


More information about the cfe-commits mailing list