================
@@ -5318,3 +5319,13 @@ OMPIteratorExpr *OMPIteratorExpr::CreateEmpty(const 
ASTContext &Context,
       alignof(OMPIteratorExpr));
   return new (Mem) OMPIteratorExpr(EmptyShell(), NumIterators);
 }
+
+HLSLOutArgExpr *HLSLOutArgExpr::Create(const ASTContext &C, QualType Ty,
+                                       Expr *Base, bool IsInOut, Expr *WB,
+                                       OpaqueValueExpr *OpV) {
+  return new (C) HLSLOutArgExpr(Ty, Base, WB, OpV, IsInOut);
----------------
llvm-beanz wrote:

Generally `C.Allocate` is used in contexts where the new operator won't know 
the full size you're allocating. In some AST nodes we allocate extra space 
after the node to store trailing pointers to sub-expressions. That can be 
valuable for reducing the size of the AST if a node can have a variable number 
of sub-expressions.

In this case we always have two sub-expressions, and we always have an 
`OpaqueValueExpr`. I could reduce the size of the AST node by not caching the 
`OpaqueValueExpr` and instead traversing down to it when we need it, but I'm 
unsure that memory savings is worthwhile.

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