Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rbda58ad r46f6134  
    8686
    8787        /// Replaces enum types by int, and function or array types in function parameter and return lists by appropriate pointers.
    88         class EnumAndPointerDecayPass : public Visitor {
     88        class Pass1 : public Visitor {
    8989                typedef Visitor Parent;
    9090                virtual void visit( EnumDecl *aggregateDecl );
     
    189189
    190190        void validate( std::list< Declaration * > &translationUnit, bool doDebug ) {
    191                 EnumAndPointerDecayPass epc;
     191                Pass1 pass1;
    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 EnumAndPointerDecayPass
    199                 acceptAll( translationUnit, epc );
     198                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs Pass1
     199                acceptAll( translationUnit, pass1 );
    200200                acceptAll( translationUnit, pass2 );
    201201                ReturnChecker::checkFunctionReturns( translationUnit );
     
    206206
    207207        void validateType( Type *type, const Indexer *indexer ) {
    208                 EnumAndPointerDecayPass epc;
     208                Pass1 pass1;
    209209                Pass2 pass2( false, indexer );
    210210                Pass3 pass3( indexer );
    211                 type->accept( epc );
     211                type->accept( pass1 );
    212212                type->accept( pass2 );
    213213                type->accept( pass3 );
     
    272272        }
    273273
    274         void EnumAndPointerDecayPass::visit( EnumDecl *enumDecl ) {
     274        void Pass1::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;
    299298                                dwts.erase( j );
    300299                                if ( i != end ) {
     
    314313        }
    315314
    316         void EnumAndPointerDecayPass::visit( FunctionType *func ) {
     315        void Pass1::visit( FunctionType *func ) {
    317316                // Fix up parameters and return types
    318317                fixFunctionList( func->get_parameters(), func );
Note: See TracChangeset for help on using the changeset viewer.