[clang] [HLSL] Implement array temporary support (PR #79382)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 12 16:07:53 PDT 2024


================
@@ -3173,41 +3174,46 @@ class ArrayType : public Type, public llvm::FoldingSetNode {
     return T->getTypeClass() == ConstantArray ||
            T->getTypeClass() == VariableArray ||
            T->getTypeClass() == IncompleteArray ||
-           T->getTypeClass() == DependentSizedArray;
+           T->getTypeClass() == DependentSizedArray ||
+           T->getTypeClass() == ArrayParameter;
   }
 };
 
 /// Represents the canonical version of C arrays with a specified constant size.
 /// For example, the canonical type for 'int A[4 + 4*100]' is a
 /// ConstantArrayType where the element type is 'int' and the size is 404.
-class ConstantArrayType final
-    : public ArrayType,
-      private llvm::TrailingObjects<ConstantArrayType, const Expr *> {
----------------
efriedma-quic wrote:

It looks like the TrailingObjects optimization here was added in 772e266fb?  Not sure what the context was; CC @zygoloid 

https://github.com/llvm/llvm-project/pull/79382


More information about the cfe-commits mailing list