================ @@ -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 *> { ---------------- zygoloid wrote:
As a general principle we try to keep our AST nodes small. This change isn't going to make a big difference by itself, but abandoning that principle and making a bunch of changes like this would. I think it's worth putting in a small amount of effort here, but if it doesn't work out nicely then it's fine to remove the optimization. We can find other places to save space. https://github.com/llvm/llvm-project/pull/79382 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits