[clang] [clang][CodeGen] Additional fixes for #114062 (PR #128166)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 21 04:23:59 PST 2025


================
@@ -5163,6 +5163,20 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
       }
     }
     if (IRFunctionArgs.hasSRetArg()) {
+      // A mismatch between the allocated return value's AS and the target's
+      // chosen IndirectAS can happen e.g. when passing the this pointer through
+      // a chain involving stores to / loads from the DefaultAS; we address this
+      // here, symmetrically with the handling we have for normal pointer args.
+      if (SRetPtr.getAddressSpace() != RetAI.getIndirectAddrSpace())
----------------
arsenm wrote:

Braces. The wrapping here is also pretty ugly, use some temporary variables? 

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


More information about the cfe-commits mailing list