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

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 22 15:32:54 PST 2024


================
@@ -1350,7 +1350,7 @@ bool ItaniumCXXABI::classifyReturnType(CGFunctionInfo &FI) const {
   // If C++ prohibits us from making a copy, return by address.
   if (!RD->canPassInRegisters()) {
     auto Align = CGM.getContext().getTypeAlignInChars(FI.getReturnType());
-    FI.getReturnInfo() = ABIArgInfo::getIndirect(Align, /*ByVal=*/false);
+    FI.getReturnInfo() = ABIArgInfo::getIndirect(Align, 0, /*ByVal=*/false);
----------------
arsenm wrote:

Comment parameter name. Maybe it's possible to do better than just hardcoded 0? 

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


More information about the cfe-commits mailing list