[clang] [HLSL] get inout/out ABI for array parameters working (PR #111047)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 7 13:09:46 PDT 2024


================
@@ -4690,8 +4690,9 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
     return emitWritebackArg(*this, args, CRE);
   }
 
-  assert(type->isReferenceType() == E->isGLValue() &&
-         "reference binding to unmaterialized r-value!");
+  assert(type->isArrayParameterType() ||
+         (type->isReferenceType() == E->isGLValue()) &&
+             "reference binding to unmaterialized r-value!");
----------------
llvm-beanz wrote:

I'm trying to think through how this occurs. You're somehow ending up with an expression that is an array parameter type, which is an l-value?

I assume that's only valid in the case of the out argument expression, maybe the better change is to move the assert under the next if block where we handle out argument expressions?

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


More information about the cfe-commits mailing list