Changeset fba44f8


Ignore:
Timestamp:
Sep 1, 2016, 11:25:38 AM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, 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:
0362d42, 4d4882a
Parents:
c8dfcd3 (diff), 90e2334 (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' into ctor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rc8dfcd3 rfba44f8  
    8686
    8787        /// Replaces enum types by int, and function or array types in function parameter and return lists by appropriate pointers.
    88         class Pass1 : public Visitor {
     88        class EnumAndPointerDecayPass : public Visitor {
    8989                typedef Visitor Parent;
    9090                virtual void visit( EnumDecl *aggregateDecl );
     
    189189
    190190        void validate( std::list< Declaration * > &translationUnit, bool doDebug ) {
    191                 Pass1 pass1;
     191                EnumAndPointerDecayPass epc;
    192192                Pass2 pass2( doDebug, 0 );
    193193                Pass3 pass3( 0 );
     
    196196                EliminateTypedef::eliminateTypedef( translationUnit );
    197197                HoistStruct::hoistStruct( translationUnit );
    198                 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs Pass1
    199                 acceptAll( translationUnit, pass1 );
     198                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass
     199                acceptAll( translationUnit, epc );
    200200                acceptAll( translationUnit, pass2 );
    201201                ReturnChecker::checkFunctionReturns( translationUnit );
     
    206206
    207207        void validateType( Type *type, const Indexer *indexer ) {
    208                 Pass1 pass1;
     208                EnumAndPointerDecayPass epc;
    209209                Pass2 pass2( false, indexer );
    210210                Pass3 pass3( indexer );
    211                 type->accept( pass1 );
     211                type->accept( epc );
    212212                type->accept( pass2 );
    213213                type->accept( pass3 );
     
    272272        }
    273273
    274         void Pass1::visit( EnumDecl *enumDecl ) {
     274        void EnumAndPointerDecayPass::visit( EnumDecl *enumDecl ) {
    275275                // Set the type of each member of the enumeration to be EnumConstant
    276276                for ( std::list< Declaration * >::iterator i = enumDecl->get_members().begin(); i != enumDecl->get_members().end(); ++i ) {
     
    296296                                DWTIterator j = i;
    297297                                ++i;
     298                                delete *j;
    298299                                dwts.erase( j );
    299300                                if ( i != end ) {
     
    313314        }
    314315
    315         void Pass1::visit( FunctionType *func ) {
     316        void EnumAndPointerDecayPass::visit( FunctionType *func ) {
    316317                // Fix up parameters and return types
    317318                fixFunctionList( func->get_parameters(), func );
Note: See TracChangeset for help on using the changeset viewer.