================ @@ -744,6 +744,35 @@ RecordStorageLocation *getBaseObjectLocation(const MemberExpr &ME, std::vector<const FieldDecl *> getFieldsForInitListExpr(const InitListExpr *InitList); +/// Helper class for initialization of a record with an `InitListExpr`. +/// `InitListExpr::inits()` contains the initializers for both the base classes +/// and the fields of the record; this helper class separates these out into two +/// different lists. In addition, it deals with special cases associated with +/// unions. +class RecordInitListHelper { ---------------- ymand wrote:
Why an object vs something like: ``` struct RecordInits { SmallVector<std::pair<const CXXBaseSpecifier *, Expr *>> BaseInits; SmallVector<std::pair<const FieldDecl *, Expr *>> FieldInits; }; RecordInits RecordInitListHelper(const InitListExpr *InitList); ``` Is it because of the optional storage needed for the union? https://github.com/llvm/llvm-project/pull/86675 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits