================
@@ -4148,6 +4152,30 @@ static void emitWriteback(CodeGenFunction &CGF,
   assert(!isProvablyNull(srcAddr.getBasePointer()) &&
          "shouldn't have writeback for provably null argument");
 
+  if (CGF.getLangOpts().HLSL) {
+    if (!isa<OpaqueValueExpr>(writeback.CastExpr)) {
+      RValue TmpVal = CGF.EmitAnyExprToTemp(writeback.CastExpr);
+      if (TmpVal.isScalar())
+        CGF.EmitStoreThroughLValue(TmpVal, srcLV);
+      else {
+        llvm::Value *Val = 
CGF.Builder.CreateLoad(TmpVal.getAggregateAddress());
----------------
rjmccall wrote:

Well, that's awful, but it's supportable.  The easiest way to get out of the 
business of having to handle all these different evaluation kinds is to just 
change the AST to the representation you'll need to use to support non-POD 
types, because then the load/assignment will just be the normal code-gen for 
emitting assignments.

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