================
@@ -5432,6 +5434,57 @@ LValue CodeGenFunction::EmitOpaqueValueLValue(const 
OpaqueValueExpr *e) {
   return getOrCreateOpaqueLValueMapping(e);
 }
 
+LValue CodeGenFunction::BindHLSLOutArgExpr(const HLSLOutArgExpr *E,
+                                           Address OutTemp) {
+  LValue Result = MakeAddrLValue(OutTemp, E->getType());
+  OpaqueValueMappingData::bind(*this, E->getCastedTemporary(), Result);
+  return Result;
+}
+
+void CodeGenFunction::EmitHLSLOutArgExpr(const HLSLOutArgExpr *E,
+                                         CallArgList &Args, QualType Ty) {
+
+  // Emitting the casted temporary through an opaque value.
+  LValue BaseLV = EmitLValue(E->getArgLValue());
+  OpaqueValueMappingData::bind(*this, E->getOpaqueArgLValue(), BaseLV);
+
+  LValue TempLV;
+
+  if (E->isInOut()) {
----------------
rjmccall wrote:

We can simplify this further, I think — let's just make a temporary and then 
emit the initialization into it.  There's a function in CGExprAgg called 
`EmitInitializationToLValue` that you can steal for the second half of that; 
you'll just need to cut the dependency on `Dest.isZeroed()` by passing it in as 
a flag.

https://github.com/llvm/llvm-project/pull/101083
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to