Changeset 96f9ef5


Ignore:
Timestamp:
Sep 12, 2017, 5:10:27 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
a0c7dc36
Parents:
93389c1
Message:

Modify TypeDecl? mutate to return a Declaration

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.h

    r93389c1 r96f9ef5  
    145145        virtual Declaration* mutate( EnumDecl *aggregateDecl ) override final;
    146146        virtual Declaration* mutate( TraitDecl *aggregateDecl ) override final;
    147         virtual TypeDecl* mutate( TypeDecl *typeDecl ) override final;
     147        virtual Declaration* mutate( TypeDecl *typeDecl ) override final;
    148148        virtual Declaration* mutate( TypedefDecl *typeDecl ) override final;
    149149        virtual AsmDecl* mutate( AsmDecl *asmDecl ) override final;
  • src/Common/PassVisitor.impl.h

    r93389c1 r96f9ef5  
    976976
    977977template< typename pass_type >
    978 TypeDecl * PassVisitor< pass_type >::mutate( TypeDecl * node ) {
    979         MUTATE_BODY( TypeDecl, node );
     978Declaration * PassVisitor< pass_type >::mutate( TypeDecl * node ) {
     979        MUTATE_BODY( Declaration, node );
    980980}
    981981
  • src/SymTab/Validate.cc

    r93389c1 r96f9ef5  
    752752
    753753                typedeclNames[ typeDecl->get_name() ] = typeDecl;
    754                 return Mutator::mutate( typeDecl );
     754                return dynamic_cast<TypeDecl *>( Mutator::mutate( typeDecl ) );
    755755        }
    756756
  • src/SynTree/Declaration.h

    r93389c1 r96f9ef5  
    136136        Expression *get_bitfieldWidth() const { return bitfieldWidth; }
    137137        void set_bitfieldWidth( Expression *newValue ) { bitfieldWidth = newValue; }
     138
     139        static ObjectDecl * newObject( const std::string & name, Type * type, Initializer * init );
    138140
    139141        virtual ObjectDecl *clone() const { return new ObjectDecl( *this ); }
     
    230232        virtual TypeDecl *clone() const { return new TypeDecl( *this ); }
    231233        virtual void accept( Visitor &v ) { v.visit( this ); }
    232         virtual TypeDecl *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     234        virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    233235        virtual void print( std::ostream &os, int indent = 0 ) const;
    234236
  • src/SynTree/Mutator.cc

    r93389c1 r96f9ef5  
    7878}
    7979
    80 TypeDecl * Mutator::mutate( TypeDecl *typeDecl ) {
     80Declaration * Mutator::mutate( TypeDecl *typeDecl ) {
    8181        handleNamedTypeDecl( typeDecl );
    8282        typeDecl->set_init( maybeMutate( typeDecl->get_init(), *this ) );
  • src/SynTree/Mutator.h

    r93389c1 r96f9ef5  
    3131        virtual Declaration* mutate( EnumDecl *aggregateDecl );
    3232        virtual Declaration* mutate( TraitDecl *aggregateDecl );
    33         virtual TypeDecl* mutate( TypeDecl *typeDecl );
     33        virtual Declaration* mutate( TypeDecl *typeDecl );
    3434        virtual Declaration* mutate( TypedefDecl *typeDecl );
    3535        virtual AsmDecl* mutate( AsmDecl *asmDecl );
Note: See TracChangeset for help on using the changeset viewer.