Ignore:
Timestamp:
Nov 1, 2016, 3:18:59 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
84118d8
Parents:
40744af8 (diff), 0afffee (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    r40744af8 rf51aefb  
    5050                const std::list<Expression*> noDesignators;
    5151
    52                 class InsertImplicitCalls : public GenPoly::PolyMutator {
     52                class InsertImplicitCalls final : public GenPoly::PolyMutator {
    5353                public:
    5454                        /// wrap function application expressions as ImplicitCopyCtorExpr nodes so that it is easy to identify which
     
    5656                        static void insert( std::list< Declaration * > & translationUnit );
    5757
    58                         virtual Expression * mutate( ApplicationExpr * appExpr );
    59                 };
    60 
    61                 class ResolveCopyCtors : public SymTab::Indexer {
     58                        using GenPoly::PolyMutator::mutate;
     59                        virtual Expression * mutate( ApplicationExpr * appExpr ) override;
     60                };
     61
     62                class ResolveCopyCtors final : public SymTab::Indexer {
    6263                public:
    6364                        /// generate temporary ObjectDecls for each argument and return value of each ImplicitCopyCtorExpr,
     
    6667                        static void resolveImplicitCalls( std::list< Declaration * > & translationUnit );
    6768
    68                         virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr );
     69                        using SymTab::Indexer::visit;
     70                        virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ) override;
    6971
    7072                        /// create and resolve ctor/dtor expression: fname(var, [cpArg])
     
    8284                        using Parent::visit;
    8385                        typedef std::set< ObjectDecl * > ObjectSet;
    84                         virtual void visit( CompoundStmt *compoundStmt );
    85                         virtual void visit( DeclStmt *stmt );
     86                        virtual void visit( CompoundStmt *compoundStmt ) override;
     87                        virtual void visit( DeclStmt *stmt ) override;
    8688                  protected:
    8789                        ObjectSet curVars;
     
    103105                }
    104106
    105                 class LabelFinder : public ObjDeclCollector {
     107                class LabelFinder final : public ObjDeclCollector {
    106108                  public:
    107109                        typedef ObjDeclCollector Parent;
     
    117119                        // subclasses are added, there is only one place that the code has to be updated, rather than ensure that
    118120                        // every specialized class knows about every new kind of statement that might be added.
    119                         virtual void visit( CompoundStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    120                         virtual void visit( ExprStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    121                         virtual void visit( AsmStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    122                         virtual void visit( IfStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    123                         virtual void visit( WhileStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    124                         virtual void visit( ForStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    125                         virtual void visit( SwitchStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    126                         virtual void visit( CaseStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    127                         virtual void visit( BranchStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    128                         virtual void visit( ReturnStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    129                         virtual void visit( TryStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    130                         virtual void visit( CatchStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    131                         virtual void visit( FinallyStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    132                         virtual void visit( NullStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    133                         virtual void visit( DeclStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    134                         virtual void visit( ImplicitCtorDtorStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    135                 };
    136 
    137                 class InsertDtors : public ObjDeclCollector {
     121                        using Parent::visit;
     122                        virtual void visit( CompoundStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     123                        virtual void visit( ExprStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     124                        virtual void visit( AsmStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     125                        virtual void visit( IfStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     126                        virtual void visit( WhileStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     127                        virtual void visit( ForStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     128                        virtual void visit( SwitchStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     129                        virtual void visit( CaseStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     130                        virtual void visit( BranchStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     131                        virtual void visit( ReturnStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     132                        virtual void visit( TryStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     133                        virtual void visit( CatchStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     134                        virtual void visit( FinallyStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     135                        virtual void visit( NullStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     136                        virtual void visit( DeclStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     137                        virtual void visit( ImplicitCtorDtorStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     138                };
     139
     140                class InsertDtors final : public ObjDeclCollector {
    138141                public:
    139142                        /// insert destructor calls at the appropriate places.  must happen before CtorInit nodes are removed
     
    147150                        InsertDtors( LabelFinder & finder ) : labelVars( finder.vars ) {}
    148151
    149                         virtual void visit( ObjectDecl * objDecl );
    150 
    151                         virtual void visit( CompoundStmt * compoundStmt );
    152                         virtual void visit( ReturnStmt * returnStmt );
    153                         virtual void visit( BranchStmt * stmt );
     152                        using Parent::visit;
     153
     154                        virtual void visit( ObjectDecl * objDecl ) override;
     155
     156                        virtual void visit( CompoundStmt * compoundStmt ) override;
     157                        virtual void visit( ReturnStmt * returnStmt ) override;
     158                        virtual void visit( BranchStmt * stmt ) override;
    154159                private:
    155160                        void handleGoto( BranchStmt * stmt );
     
    159164                };
    160165
    161                 class FixInit : public GenPoly::PolyMutator {
     166                class FixInit final : public GenPoly::PolyMutator {
    162167                  public:
    163168                        /// expand each object declaration to use its constructor after it is declared.
    164169                        static void fixInitializers( std::list< Declaration * > &translationUnit );
    165170
    166                         virtual DeclarationWithType * mutate( ObjectDecl *objDecl );
     171                        using GenPoly::PolyMutator::mutate;
     172                        virtual DeclarationWithType * mutate( ObjectDecl *objDecl ) override;
    167173
    168174                        std::list< Declaration * > staticDtorDecls;
    169175                };
    170176
    171                 class FixCopyCtors : public GenPoly::PolyMutator {
     177                class FixCopyCtors final : public GenPoly::PolyMutator {
    172178                  public:
    173179                        /// expand ImplicitCopyCtorExpr nodes into the temporary declarations, copy constructors, call expression,
     
    175181                        static void fixCopyCtors( std::list< Declaration * > &translationUnit );
    176182
    177                         virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr );
    178                 };
    179 
    180                 class GenStructMemberCalls : public SymTab::Indexer {
     183                        using GenPoly::PolyMutator::mutate;
     184                        virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) override;
     185                };
     186
     187                class GenStructMemberCalls final : public SymTab::Indexer {
    181188                  public:
    182189                        typedef Indexer Parent;
     
    186193                        static void generate( std::list< Declaration * > & translationUnit );
    187194
    188                         virtual void visit( FunctionDecl * funcDecl );
    189 
    190                         virtual void visit( MemberExpr * memberExpr );
    191                         virtual void visit( ApplicationExpr * appExpr );
     195                        using Parent::visit;
     196
     197                        virtual void visit( FunctionDecl * funcDecl ) override;
     198
     199                        virtual void visit( MemberExpr * memberExpr ) override;
     200                        virtual void visit( ApplicationExpr * appExpr ) override;
    192201
    193202                        SemanticError errors;
     
    207216                // resolve UntypedExprs that are found within newly
    208217                // generated constructor/destructor calls
    209                 class MutatingResolver : public Mutator {
     218                class MutatingResolver final : public Mutator {
    210219                  public:
    211220                        MutatingResolver( SymTab::Indexer & indexer ) : indexer( indexer ) {}
    212221
    213                         virtual DeclarationWithType* mutate( ObjectDecl *objectDecl );
    214 
    215                         virtual Expression* mutate( UntypedExpr *untypedExpr );
    216                         private:
     222                        using Mutator::mutate;
     223                        virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ) override;
     224                        virtual Expression* mutate( UntypedExpr *untypedExpr ) override;
     225
     226                  private:
    217227                        SymTab::Indexer & indexer;
    218228                };
    219229
    220                 class FixCtorExprs : public GenPoly::DeclMutator {
     230                class FixCtorExprs final : public GenPoly::DeclMutator {
    221231                  public:
    222232                        /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument
    223233                        static void fix( std::list< Declaration * > & translationUnit );
    224234
    225                         virtual Expression * mutate( ConstructorExpr * ctorExpr );
     235                        using GenPoly::DeclMutator::mutate;
     236                        virtual Expression * mutate( ConstructorExpr * ctorExpr ) override;
    226237                };
    227238        } // namespace
Note: See TracChangeset for help on using the changeset viewer.