Changeset 3a5131ed for src/SynTree


Ignore:
Timestamp:
Feb 16, 2017, 3:36:45 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
317450e
Parents:
c3d9adc
Message:

handle KR function declarations

Location:
src/SynTree
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    rc3d9adc r3a5131ed  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  9 14:27:08 2017
    13 // Update Count     : 56
     12// Last Modified On : Thu Feb 16 14:53:35 2017
     13// Update Count     : 57
    1414//
    1515
     
    140140        CompoundStmt *get_statements() const { return statements; }
    141141        void set_statements( CompoundStmt *newValue ) { statements = newValue; }
    142         std::list< std::string >& get_oldIdents() { return oldIdents; }
    143         std::list< Declaration* >& get_oldDecls() { return oldDecls; }
    144142
    145143        virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
     
    151149        FunctionType *type;
    152150        CompoundStmt *statements;
    153         std::list< std::string > oldIdents;
    154         std::list< Declaration* > oldDecls;
    155151};
    156152
  • src/SynTree/FunctionDecl.cc

    rc3d9adc r3a5131ed  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Oct  1 23:06:32 2016
    13 // Update Count     : 21
     12// Last Modified On : Thu Feb 16 15:01:52 2017
     13// Update Count     : 23
    1414//
    1515
     
    4444        delete type;
    4545        delete statements;
    46         deleteAll( oldDecls );
    4746}
    4847
     
    8483        } // if
    8584
    86         if ( ! oldIdents.empty() ) {
    87                 os << string( indent + 2, ' ' ) << "with parameter names" << endl;
    88                 for ( std::list< std::string >::const_iterator i = oldIdents.begin(); i != oldIdents.end(); ++i ) {
    89                         os << string( indent + 4, ' ' ) << *i << endl;
    90                 } // for
    91         } // if
    92 
    93         if ( ! oldDecls.empty() ) {
    94                 os << string( indent + 2, ' ' ) << "with parameter declarations" << endl;
    95                 printAll( oldDecls, os, indent + 4 );
    96         } // if
    9785        if ( statements ) {
    9886                os << string( indent + 2, ' ' ) << "with body " << endl;
  • src/SynTree/Mutator.cc

    rc3d9adc r3a5131ed  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  9 14:22:56 2017
    13 // Update Count     : 20
     12// Last Modified On : Thu Feb 16 15:02:23 2017
     13// Update Count     : 21
    1414//
    1515
     
    3838DeclarationWithType *Mutator::mutate( FunctionDecl *functionDecl ) {
    3939        functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
    40         mutateAll( functionDecl->get_oldDecls(), *this );
    4140        functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
    4241        return functionDecl;
  • src/SynTree/Visitor.cc

    rc3d9adc r3a5131ed  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  9 14:19:22 2017
    13 // Update Count     : 22
     12// Last Modified On : Thu Feb 16 15:01:25 2017
     13// Update Count     : 23
    1414//
    1515
     
    3535void Visitor::visit( FunctionDecl *functionDecl ) {
    3636        maybeAccept( functionDecl->get_functionType(), *this );
    37         acceptAll( functionDecl->get_oldDecls(), *this );
    3837        maybeAccept( functionDecl->get_statements(), *this );
    3938}
Note: See TracChangeset for help on using the changeset viewer.