rjmccall added inline comments.

Comment at: lib/CodeGen/CGCall.cpp:3446
+  return LV.asAggregateRValue();
No, I don't think this is right.  This method should always return an 
independent RValue; if the CallArg is storing an LValue, it should copy from it 
into a temporary.  That means it needs to take a CGF, and it also means you 
can't call it eagerly.

Comment at: lib/CodeGen/CGCall.cpp:3779
+      RV = I->getRValue();
+    }
For example, all of this is eagerly forcing an RValue, and it needs to be 
delayed so that you can take advantage of having an LValue in the right cases 

Comment at: lib/CodeGen/CGCall.cpp:3814
         EmitInitStoreOfNonAggregate(*this, RV, argLV);
I think most of this could be replaced with a copyInto(CGF&, Address) method on 
CallArg that just stores/copies the RValue into the destination.  But you might 
need to handle the aggregate-RValue case specially before calling the method, 
because I think what that's expressing is that we're trying to evaluate 
aggregate-RValue arguments directly into the right place in the inalloca 


cfe-commits mailing list

Reply via email to