Ignore:
Timestamp:
Sep 26, 2017, 11:27:38 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
5dc26f5
Parents:
201aeb9
Message:

merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r201aeb9 rd67cdb7  
    6262        void fixUniqueId( void );
    6363        virtual Declaration *clone() const = 0;
    64         virtual void accept( Visitor &v ) = 0;
     64        virtual void accept( Visitor &v ) override = 0;
    6565        virtual Declaration *acceptMutator( Mutator &m ) = 0;
    66         virtual void print( std::ostream &os, int indent = 0 ) const = 0;
     66        virtual void print( std::ostream &os, int indent = 0 ) const override = 0;
    6767        virtual void printShort( std::ostream &os, int indent = 0 ) const = 0;
    6868
     
    106106        //void set_functionSpecifiers( Type::FuncSpecifiers newValue ) { fs = newValue; }
    107107
    108         virtual DeclarationWithType *clone() const = 0;
    109         virtual DeclarationWithType *acceptMutator( Mutator &m ) = 0;
     108        virtual DeclarationWithType *clone() const override = 0;
     109        virtual DeclarationWithType *acceptMutator( Mutator &m )  override = 0;
    110110
    111111        virtual Type * get_type() const = 0;
     
    128128        virtual ~ObjectDecl();
    129129
    130         virtual Type * get_type() const { return type; }
    131         virtual void set_type(Type *newType) { type = newType; }
     130        virtual Type * get_type() const override { return type; }
     131        virtual void set_type(Type *newType) override { type = newType; }
    132132
    133133        Initializer *get_init() const { return init; }
     
    139139        static ObjectDecl * newObject( const std::string & name, Type * type, Initializer * init );
    140140
    141         virtual ObjectDecl *clone() const { return new ObjectDecl( *this ); }
    142         virtual void accept( Visitor &v ) { v.visit( this ); }
    143         virtual DeclarationWithType *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    144         virtual void print( std::ostream &os, int indent = 0 ) const;
    145         virtual void printShort( std::ostream &os, int indent = 0 ) const;
     141        virtual ObjectDecl *clone() const override { return new ObjectDecl( *this ); }
     142        virtual void accept( Visitor &v ) override { v.visit( this ); }
     143        virtual DeclarationWithType *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     144        virtual void print( std::ostream &os, int indent = 0 ) const override;
     145        virtual void printShort( std::ostream &os, int indent = 0 ) const override;
    146146};
    147147
     
    157157        virtual ~FunctionDecl();
    158158
    159         Type * get_type() const { return type; }
    160         virtual void set_type(Type * t) { type = strict_dynamic_cast< FunctionType* >( t ); }
     159        virtual Type * get_type() const override { return type; }
     160        virtual void set_type(Type * t) override { type = strict_dynamic_cast< FunctionType* >( t ); }
    161161
    162162        FunctionType * get_functionType() const { return type; }
     
    165165        void set_statements( CompoundStmt *newValue ) { statements = newValue; }
    166166
    167         virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
    168         virtual void accept( Visitor &v ) { v.visit( this ); }
    169         virtual DeclarationWithType *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    170         virtual void print( std::ostream &os, int indent = 0 ) const;
    171         virtual void printShort( std::ostream &os, int indent = 0 ) const;
     167        virtual FunctionDecl *clone() const override { return new FunctionDecl( *this ); }
     168        virtual void accept( Visitor &v ) override { v.visit( this ); }
     169        virtual DeclarationWithType *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     170        virtual void print( std::ostream &os, int indent = 0 ) const override;
     171        virtual void printShort( std::ostream &os, int indent = 0 ) const override;
    172172};
    173173
     
    190190        virtual std::string typeString() const = 0;
    191191
    192         virtual NamedTypeDecl *clone() const = 0;
    193         virtual void print( std::ostream &os, int indent = 0 ) const;
    194         virtual void printShort( std::ostream &os, int indent = 0 ) const;
     192        virtual NamedTypeDecl *clone() const override = 0;
     193        virtual void print( std::ostream &os, int indent = 0 ) const override;
     194        virtual void printShort( std::ostream &os, int indent = 0 ) const override;
    195195};
    196196
     
    227227        TypeDecl * set_sized( bool newValue ) { sized = newValue; return this; }
    228228
    229         virtual std::string typeString() const;
     229        virtual std::string typeString() const override;
    230230        virtual std::string genTypeString() const;
    231231
    232         virtual TypeDecl *clone() const { return new TypeDecl( *this ); }
    233         virtual void accept( Visitor &v ) { v.visit( this ); }
    234         virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    235         virtual void print( std::ostream &os, int indent = 0 ) const;
     232        virtual TypeDecl *clone() const override { return new TypeDecl( *this ); }
     233        virtual void accept( Visitor &v ) override { v.visit( this ); }
     234        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     235        virtual void print( std::ostream &os, int indent = 0 ) const override;
    236236
    237237  private:
     
    245245        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    246246
    247         virtual std::string typeString() const;
    248 
    249         virtual TypedefDecl *clone() const { return new TypedefDecl( *this ); }
    250         virtual void accept( Visitor &v ) { v.visit( this ); }
    251         virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     247        virtual std::string typeString() const override;
     248
     249        virtual TypedefDecl *clone() const override { return new TypedefDecl( *this ); }
     250        virtual void accept( Visitor &v ) override { v.visit( this ); }
     251        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    252252  private:
    253253};
     
    274274        AggregateDecl * set_body( bool body ) { AggregateDecl::body = body; return this; }
    275275
    276         virtual void print( std::ostream &os, int indent = 0 ) const;
    277         virtual void printShort( std::ostream &os, int indent = 0 ) const;
     276        virtual void print( std::ostream &os, int indent = 0 ) const override;
     277        virtual void printShort( std::ostream &os, int indent = 0 ) const override;
    278278  protected:
    279279        virtual std::string typeString() const = 0;
     
    290290        bool is_thread() { return kind == DeclarationNode::Thread; }
    291291
    292         virtual StructDecl *clone() const { return new StructDecl( *this ); }
    293         virtual void accept( Visitor &v ) { v.visit( this ); }
    294         virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     292        virtual StructDecl *clone() const override { return new StructDecl( *this ); }
     293        virtual void accept( Visitor &v ) override { v.visit( this ); }
     294        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    295295  private:
    296296        DeclarationNode::Aggregate kind;
    297         virtual std::string typeString() const;
     297        virtual std::string typeString() const override;
    298298};
    299299
     
    304304        UnionDecl( const UnionDecl &other ) : Parent( other ) {}
    305305
    306         virtual UnionDecl *clone() const { return new UnionDecl( *this ); }
    307         virtual void accept( Visitor &v ) { v.visit( this ); }
    308         virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    309   private:
    310         virtual std::string typeString() const;
     306        virtual UnionDecl *clone() const override { return new UnionDecl( *this ); }
     307        virtual void accept( Visitor &v ) override { v.visit( this ); }
     308        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     309  private:
     310        virtual std::string typeString() const override;
    311311};
    312312
     
    317317        EnumDecl( const EnumDecl &other ) : Parent( other ) {}
    318318
    319         virtual EnumDecl *clone() const { return new EnumDecl( *this ); }
    320         virtual void accept( Visitor &v ) { v.visit( this ); }
    321         virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    322   private:
    323         virtual std::string typeString() const;
     319        virtual EnumDecl *clone() const override { return new EnumDecl( *this ); }
     320        virtual void accept( Visitor &v ) override { v.visit( this ); }
     321        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     322  private:
     323        virtual std::string typeString() const override;
    324324};
    325325
     
    332332        TraitDecl( const TraitDecl &other ) : Parent( other ) {}
    333333
    334         virtual TraitDecl *clone() const { return new TraitDecl( *this ); }
    335         virtual void accept( Visitor &v ) { v.visit( this ); }
    336         virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    337   private:
    338         virtual std::string typeString() const;
     334        virtual TraitDecl *clone() const override { return new TraitDecl( *this ); }
     335        virtual void accept( Visitor &v ) override { v.visit( this ); }
     336        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     337  private:
     338        virtual std::string typeString() const override;
    339339};
    340340
     
    350350        void set_stmt( AsmStmt *newValue ) { stmt = newValue; }
    351351
    352         virtual AsmDecl *clone() const { return new AsmDecl( *this ); }
    353         virtual void accept( Visitor &v ) { v.visit( this ); }
    354         virtual AsmDecl *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    355         virtual void print( std::ostream &os, int indent = 0 ) const;
    356         virtual void printShort( std::ostream &os, int indent = 0 ) const;
    357 };
    358 
    359 std::ostream & operator<<( std::ostream & out, const Declaration * decl );
     352        virtual AsmDecl *clone() const override { return new AsmDecl( *this ); }
     353        virtual void accept( Visitor &v ) override { v.visit( this ); }
     354        virtual AsmDecl *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     355        virtual void print( std::ostream &os, int indent = 0 ) const override;
     356        virtual void printShort( std::ostream &os, int indent = 0 ) const override;
     357};
     358
    360359std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data );
    361360
Note: See TracChangeset for help on using the changeset viewer.