erichkeane added a comment.

Ok then, I'll take a look to see what it would take to make the 
MaterializeTemporaryExpr be created with the complete type here instead.  
Thanks!



================
Comment at: clang/lib/CodeGen/CGExprConstant.cpp:2148
+        CommonElementType == nullptr && !NumInitElts) {
       const ArrayType *AT = CGM.getContext().getAsArrayType(DestType);
       CommonElementType = CGM.getTypes().ConvertType(AT->getElementType());
----------------
rsmith wrote:
> rjmccall wrote:
> > `AT` is now just `ArrayTy`, and I think you can just check `!Filler && 
> > !NumInitElts`.
> `Filler` is null if and only if `NumElements == NumInitElts`, and 
> `NumInitElts <= NumElements`, so this condition reduces to `if 
> (!NumElements)`. `EmitArrayConstant` responds to that case by creating a 
> `ConstantAggregateZero` of its destination type. So it seems to me that we 
> probably don't need this special case at all.
I'll submit a patch to remove this branch then, thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88236/new/

https://reviews.llvm.org/D88236

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to