[clang] [HLSL] Implement array temporary support (PR #79382)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 12 15:50:05 PDT 2024


================
@@ -4655,6 +4655,13 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
     return emitWritebackArg(*this, args, CRE);
   }
 
+  // If an argument is an array paramter expression being passed through. Emit
+  // the argument to a temporary and pass the temporary as the call arg.
+  if (auto AT = dyn_cast<ArrayParameterType>(type)) {
+    args.add(EmitAnyExprToTemp(E), type);
----------------
efriedma-quic wrote:

I don't think this code should be necessary?  E shouldn't be an lvalue or a record type, so we should just fall through to the same code at the end of the function, I think?

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


More information about the cfe-commits mailing list