Changeset ed96731


Ignore:
Timestamp:
Nov 18, 2024, 3:43:38 PM (4 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
29075d1
Parents:
0dffe91
Message:

With{Stmts,Decls}ToAdd? how has an -X version like WithSymbolTableX. Although these -X versions might be useful can could possibly be removed in the future. (This is a therapy commit.)

Location:
src
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/AST/Pass.hpp

    r0dffe91 red96731  
    327327/// The Pass template handles what *before* and *after* means automatically
    328328template< template<class...> class container_t = std::list >
    329 struct WithStmtsToAdd {
     329struct WithStmtsToAddX {
    330330        container_t< ptr<Stmt> > stmtsToAddBefore;
    331331        container_t< ptr<Stmt> > stmtsToAddAfter;
    332332};
     333
     334struct WithStmtsToAdd : public WithStmtsToAddX<> {};
    333335
    334336/// Used if visitor requires added declarations before or after the current node.
    335337/// The Pass template handles what *before* and *after* means automatically
    336338template< template<class...> class container_t = std::list >
    337 struct WithDeclsToAdd {
     339struct WithDeclsToAddX {
    338340        container_t< ptr<Decl> > declsToAddBefore;
    339341        container_t< ptr<Decl> > declsToAddAfter;
    340342};
     343
     344struct WithDeclsToAdd : public WithDeclsToAddX<> {};
    341345
    342346/// Use if visitation should stop at certain levels
  • TabularUnified src/Concurrency/Actors.cpp

    r0dffe91 red96731  
    194194// collects data needed for next pass that does the circular defn resolution
    195195//     for message send operators (via table above)
    196 struct GenFuncsCreateTables : public ast::WithDeclsToAdd<> {
     196struct GenFuncsCreateTables : public ast::WithDeclsToAdd {
    197197        unordered_set<const StructDecl *> & actorStructDecls;
    198198        unordered_set<const StructDecl *>  & messageStructDecls;
     
    451451// separate pass is needed since this pass resolves circular defn issues
    452452// generates the forward declarations of the send operator for actor routines
    453 struct FwdDeclOperator : public ast::WithDeclsToAdd<> {
     453struct FwdDeclOperator : public ast::WithDeclsToAdd {
    454454        unordered_set<const StructDecl *> & actorStructDecls;
    455455        unordered_set<const StructDecl *>  & messageStructDecls;
  • TabularUnified src/Concurrency/Corun.cpp

    r0dffe91 red96731  
    2525namespace Concurrency {
    2626
    27 struct CorunKeyword : public WithDeclsToAdd<>, public WithStmtsToAdd<> {
     27struct CorunKeyword : public WithDeclsToAdd, public WithStmtsToAdd {
    2828        UniqueName CorunFnNamer = "__CFA_corun_lambda_"s;
    2929        UniqueName CoforFnNamer = "__CFA_cofor_lambda_"s;
  • TabularUnified src/Concurrency/Keywords.cpp

    r0dffe91 red96731  
    117117
    118118// --------------------------------------------------------------------------
    119 struct ConcurrentSueKeyword : public ast::WithDeclsToAdd<> {
     119struct ConcurrentSueKeyword : public ast::WithDeclsToAdd {
    120120        ConcurrentSueKeyword(
    121121                std::string&& type_name, std::string&& field_name,
     
    639639// --------------------------------------------------------------------------
    640640struct SuspendKeyword final :
    641                 public ast::WithStmtsToAdd<>, public ast::WithGuards {
     641                public ast::WithStmtsToAdd, public ast::WithGuards {
    642642        SuspendKeyword() = default;
    643643        virtual ~SuspendKeyword() = default;
     
    860860
    861861// --------------------------------------------------------------------------
    862 struct MutexKeyword final : public ast::WithDeclsToAdd<> {
     862struct MutexKeyword final : public ast::WithDeclsToAdd {
    863863        const ast::FunctionDecl * postvisit( const ast::FunctionDecl * decl );
    864864        void postvisit( const ast::StructDecl * decl );
  • TabularUnified src/Concurrency/Waituntil.cpp

    r0dffe91 red96731  
    13981398// To add the predicates at global scope we need to do it in a second pass
    13991399// Predicates are added after "struct select_node { ... };"
    1400 class AddPredicateDecls final : public WithDeclsToAdd<> {
     1400class AddPredicateDecls final : public WithDeclsToAdd {
    14011401        vector<FunctionDecl *> & satFns;
    14021402        const StructDecl * selectNodeDecl = nullptr;
  • TabularUnified src/ControlStruct/ExceptDecl.cpp

    r0dffe91 red96731  
    401401}
    402402
    403 struct ExceptDeclCore : public ast::WithDeclsToAdd<> {
     403struct ExceptDeclCore : public ast::WithDeclsToAdd {
    404404        ast::StructDecl const * transformExcept( ast::StructDecl const * decl );
    405405        ast::ObjectDecl const * transformVTable(
  • TabularUnified src/GenPoly/Box.cpp

    r0dffe91 red96731  
    5555/// Adds layout-generation functions to polymorphic types.
    5656struct LayoutFunctionBuilder final :
    57                 public ast::WithDeclsToAdd<>,
     57                public ast::WithDeclsToAdd,
    5858                public ast::WithShortCircuiting,
    5959                public ast::WithVisitorRef<LayoutFunctionBuilder> {
     
    344344                public ast::WithGuards,
    345345                public ast::WithShortCircuiting,
    346                 public ast::WithStmtsToAdd<>,
     346                public ast::WithStmtsToAdd,
    347347                public ast::WithVisitorRef<CallAdapter> {
    348348        CallAdapter();
     
    15751575struct PolyGenericCalculator final :
    15761576                public ast::WithConstTypeSubstitution,
    1577                 public ast::WithDeclsToAdd<>,
     1577                public ast::WithDeclsToAdd,
    15781578                public ast::WithGuards,
    1579                 public ast::WithStmtsToAdd<>,
     1579                public ast::WithStmtsToAdd,
    15801580                public ast::WithVisitorRef<PolyGenericCalculator> {
    15811581        PolyGenericCalculator();
  • TabularUnified src/GenPoly/InstantiateGeneric.cpp

    r0dffe91 red96731  
    277277                public ast::WithVisitorRef<FixDtypeStatic>,
    278278                public ast::WithShortCircuiting,
    279                 public ast::WithStmtsToAdd<> {
     279                public ast::WithStmtsToAdd {
    280280        ast::ApplicationExpr const * previsit( ast::ApplicationExpr const * expr );
    281281        void previsit( ast::AddressExpr const * expr );
     
    421421                public ast::WithCodeLocation,
    422422                public ast::WithConstTypeSubstitution,
    423                 public ast::WithDeclsToAdd<>,
     423                public ast::WithDeclsToAdd,
    424424                public ast::WithGuards,
    425425                public ast::WithVisitorRef<GenericInstantiator>
  • TabularUnified src/GenPoly/Lvalue.cpp

    r0dffe91 red96731  
    8585struct ReferenceConversions final :
    8686                public ast::WithConstTranslationUnit,
    87                 public ast::WithGuards, public ast::WithStmtsToAdd<> {
     87                public ast::WithGuards, public ast::WithStmtsToAdd {
    8888        ast::Expr const * postvisit( ast::CastExpr const * expr );
    8989        ast::Expr const * postvisit( ast::AddressExpr const * expr );
  • TabularUnified src/GenPoly/Specialize.cpp

    r0dffe91 red96731  
    3030struct SpecializeCore final :
    3131                public ast::WithConstTypeSubstitution,
    32                 public ast::WithDeclsToAdd<>,
     32                public ast::WithDeclsToAdd,
    3333                public ast::WithVisitorRef<SpecializeCore> {
    3434        std::string paramPrefix = "_p";
  • TabularUnified src/InitTweak/FixInit.cpp

    r0dffe91 red96731  
    105105/// generate/resolve copy construction expressions for each, and generate/resolve destructors for both
    106106/// arguments and return value temporaries
    107 struct ResolveCopyCtors final : public ast::WithGuards, public ast::WithStmtsToAdd<>, public ast::WithSymbolTable, public ast::WithShortCircuiting, public ast::WithVisitorRef<ResolveCopyCtors>, public ast::WithConstTranslationUnit {
     107struct ResolveCopyCtors final : public ast::WithGuards, public ast::WithStmtsToAdd, public ast::WithSymbolTable, public ast::WithShortCircuiting, public ast::WithVisitorRef<ResolveCopyCtors>, public ast::WithConstTranslationUnit {
    108108        const ast::Expr * postvisit( const ast::ImplicitCopyCtorExpr * impCpCtorExpr );
    109109        const ast::StmtExpr * previsit( const ast::StmtExpr * stmtExpr );
     
    177177/// insert destructor calls at the appropriate places.  must happen before CtorInit nodes are removed
    178178/// (currently by FixInit)
    179 struct InsertDtors final : public ObjDeclCollector, public ast::WithStmtsToAdd<> {
     179struct InsertDtors final : public ObjDeclCollector, public ast::WithStmtsToAdd {
    180180        InsertDtors( ast::Pass<LabelFinder> & finder ) : finder( finder ), labelVars( finder.core.vars ) {}
    181181
     
    194194
    195195/// expand each object declaration to use its constructor after it is declared.
    196 struct FixInit : public ast::WithStmtsToAdd<> {
     196struct FixInit : public ast::WithStmtsToAdd {
    197197        static void fixInitializers( ast::TranslationUnit &translationUnit );
    198198
     
    230230
    231231/// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument
    232 struct FixCtorExprs final : public ast::WithDeclsToAdd<>, public ast::WithSymbolTable, public ast::WithShortCircuiting, public ast::WithConstTranslationUnit {
     232struct FixCtorExprs final : public ast::WithDeclsToAdd, public ast::WithSymbolTable, public ast::WithShortCircuiting, public ast::WithConstTranslationUnit {
    233233        const ast::Expr * postvisit( const ast::ConstructorExpr * ctorExpr );
    234234};
  • TabularUnified src/InitTweak/GenInit.cpp

    r0dffe91 red96731  
    4646        // Outer pass finds declarations, for their type could wrap a type that needs hoisting
    4747        struct HoistArrayDimension_NoResolve final :
    48                         public ast::WithDeclsToAdd<>, public ast::WithShortCircuiting,
     48                        public ast::WithDeclsToAdd, public ast::WithShortCircuiting,
    4949                        public ast::WithGuards, public ast::WithConstTranslationUnit,
    5050                        public ast::WithVisitorRef<HoistArrayDimension_NoResolve>,
     
    205205
    206206        struct ReturnFixer final :
    207                         public ast::WithStmtsToAdd<>, ast::WithGuards, ast::WithShortCircuiting {
     207                        public ast::WithStmtsToAdd, ast::WithGuards, ast::WithShortCircuiting {
    208208                void previsit( const ast::FunctionDecl * decl );
    209209                const ast::ReturnStmt * previsit( const ast::ReturnStmt * stmt );
  • TabularUnified src/ResolvExpr/Resolver.cpp

    r0dffe91 red96731  
    375375: public ast::WithSymbolTable, public ast::WithGuards,
    376376  public ast::WithVisitorRef<Resolver>, public ast::WithShortCircuiting,
    377   public ast::WithStmtsToAdd<> {
     377  public ast::WithStmtsToAdd {
    378378
    379379        ast::ptr< ast::Type > functionReturn = nullptr;
  • TabularUnified src/Tuples/TupleExpansion.cpp

    r0dffe91 red96731  
    2828};
    2929
    30 struct UniqueExprExpander final : public ast::WithDeclsToAdd<> {
     30struct UniqueExprExpander final : public ast::WithDeclsToAdd {
    3131        const ast::Expr * postvisit( const ast::UniqueExpr * unqExpr );
    3232        // Not a vector, because they may not be adding in increasing order.
     
    3737struct TupleMainExpander final :
    3838                public ast::WithCodeLocation,
    39                 public ast::WithDeclsToAdd<>,
     39                public ast::WithDeclsToAdd,
    4040                public ast::WithGuards,
    4141                public ast::WithVisitorRef<TupleMainExpander> {
  • TabularUnified src/Validate/Autogen.cpp

    r0dffe91 red96731  
    5050// --------------------------------------------------------------------------
    5151struct AutogenerateRoutines final :
    52                 public ast::WithDeclsToAdd<>,
     52                public ast::WithDeclsToAdd,
    5353                public ast::WithShortCircuiting {
    5454        void previsit( const ast::EnumDecl * enumDecl );
  • TabularUnified src/Validate/CompoundLiteral.cpp

    r0dffe91 red96731  
    2727
    2828struct CompoundLiteral final :
    29                 public ast::WithDeclsToAdd<> {
     29                public ast::WithDeclsToAdd {
    3030        ast::Storage::Classes storageClasses;
    3131
  • TabularUnified src/Validate/HoistStruct.cpp

    r0dffe91 red96731  
    6868 */
    6969struct HoistStructCore final :
    70                 public ast::WithDeclsToAdd<>, public ast::WithGuards {
     70                public ast::WithDeclsToAdd, public ast::WithGuards {
    7171        ast::StructDecl const * previsit( ast::StructDecl const * decl );
    7272        ast::StructDecl const * postvisit( ast::StructDecl const * decl );
  • TabularUnified src/Validate/HoistTypeDecls.cpp

    r0dffe91 red96731  
    2222namespace {
    2323
    24 struct HoistTypeDecls final : public ast::WithDeclsToAdd<> {
     24struct HoistTypeDecls final : public ast::WithDeclsToAdd {
    2525        void previsit( ast::SizeofExpr const * );
    2626        void previsit( ast::AlignofExpr const * );
  • TabularUnified src/Validate/ImplementEnumFunc.cpp

    r0dffe91 red96731  
    472472
    473473struct ImplementEnumFunc final :
    474                 public ast::WithDeclsToAdd<>, public ast::WithShortCircuiting {
     474                public ast::WithDeclsToAdd, public ast::WithShortCircuiting {
    475475        void previsit(const ast::EnumDecl* enumDecl);
    476476        void previsit(const ast::FunctionDecl* functionDecl);
  • TabularUnified src/Validate/LinkInstanceTypes.cpp

    r0dffe91 red96731  
    2727struct LinkTypesCore : public WithNoIdSymbolTable,
    2828                public ast::WithCodeLocation,
    29                 public ast::WithDeclsToAdd<>,
     29                public ast::WithDeclsToAdd,
    3030                public ast::WithGuards,
    3131                public ast::WithShortCircuiting,
  • TabularUnified src/Validate/ReplaceTypedef.cpp

    r0dffe91 red96731  
    2828struct ReplaceTypedefCore final :
    2929                public ast::WithCodeLocation,
    30                 public ast::WithDeclsToAdd<>,
     30                public ast::WithDeclsToAdd,
    3131                public ast::WithGuards,
    3232                public ast::WithShortCircuiting,
  • TabularUnified src/Virtual/VirtualDtor.cpp

    r0dffe91 red96731  
    119119// collects data needed for next pass that does the circular defn resolution
    120120//     for dtor setters and delete fns (via table above)
    121 struct GenFuncsCreateTables : public ast::WithDeclsToAdd<> {
     121struct GenFuncsCreateTables : public ast::WithDeclsToAdd {
    122122        unordered_map<const StructDecl *, CtorDtor> & structDecls;
    123123        CtorDtorTable & torDecls;
     
    351351// separate pass is needed since  __CFA_set_dtor needs to be defined after
    352352//   the last dtor defn which is found in prior pass
    353 struct GenSetDtor : public ast::WithDeclsToAdd<> {
     353struct GenSetDtor : public ast::WithDeclsToAdd {
    354354        unordered_map<const StructDecl *, CtorDtor> & structDecls; // set of decls that inherit from virt dtor
    355355        CtorDtorTable & torDecls;
Note: See TracChangeset for help on using the changeset viewer.