Ignore:
Timestamp:
Nov 25, 2017, 3:22:18 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c6e2c18
Parents:
9d06142 (diff), 3de176d (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 cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r9d06142 rc0d00b6  
    6262                void previsit( FunctionDecl * functionDecl );
    6363
    64                 void previsit( FunctionType * ftype );
    65                 void previsit( PointerType * ptype );
    66 
    6764                void previsit( CompoundStmt * compoundStmt );
    6865
     
    7269                unsigned int functionNesting = 0;     // current level of nested functions
    7370
    74                 InitTweak::ManagedTypes managedTypes;
    7571                std::vector< FuncData > data;
    7672        };
     
    625621        // generate ctor/dtors/assign for typedecls, e.g., otype T = int *;
    626622        void AutogenerateRoutines::previsit( TypeDecl * typeDecl ) {
    627                 visit_children = false;
    628623                if ( ! typeDecl->base ) return;
    629624
     
    631626                TypeFuncGenerator gen( typeDecl, &refType, data, functionNesting, indexer );
    632627                generateFunctions( gen, declsToAddAfter );
    633         }
    634 
    635         void AutogenerateRoutines::previsit( FunctionType *) {
    636                 // ensure that we don't add assignment ops for types defined as part of the function
    637                 visit_children = false;
    638         }
    639 
    640         void AutogenerateRoutines::previsit( PointerType *) {
    641                 // ensure that we don't add assignment ops for types defined as part of the pointer
    642                 visit_children = false;
     628
    643629        }
    644630
     
    648634        }
    649635
    650         void AutogenerateRoutines::previsit( FunctionDecl * functionDecl ) {
    651                 visit_children = false;
    652                 // record the existence of this function as appropriate
    653                 managedTypes.handleDWT( functionDecl );
    654 
    655                 maybeAccept( functionDecl->type, *visitor );
     636        void AutogenerateRoutines::previsit( FunctionDecl * ) {
     637                // Track whether we're currently in a function.
     638                // Can ignore function type idiosyncrasies, because function type can never
     639                // declare a new type.
    656640                functionNesting += 1;
    657                 maybeAccept( functionDecl->statements, *visitor );
    658                 functionNesting -= 1;
     641                GuardAction( [this]()  { functionNesting -= 1; } );
    659642        }
    660643
    661644        void AutogenerateRoutines::previsit( CompoundStmt * ) {
    662                 GuardScope( managedTypes );
    663645                GuardScope( structsDone );
    664646        }
Note: See TracChangeset for help on using the changeset viewer.