Ignore:
Timestamp:
Nov 24, 2017, 9:02:40 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
cf966b5
Parents:
88ef2af (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r88ef2af rf7a4f89  
    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        };
     
    622618        // generate ctor/dtors/assign for typedecls, e.g., otype T = int *;
    623619        void AutogenerateRoutines::previsit( TypeDecl * typeDecl ) {
    624                 visit_children = false;
    625620                if ( ! typeDecl->base ) return;
    626621
     
    628623                TypeFuncGenerator gen( typeDecl, &refType, data, functionNesting, indexer );
    629624                generateFunctions( gen, declsToAddAfter );
    630         }
    631 
    632         void AutogenerateRoutines::previsit( FunctionType *) {
    633                 // ensure that we don't add assignment ops for types defined as part of the function
    634                 visit_children = false;
    635         }
    636 
    637         void AutogenerateRoutines::previsit( PointerType *) {
    638                 // ensure that we don't add assignment ops for types defined as part of the pointer
    639                 visit_children = false;
     625
    640626        }
    641627
     
    645631        }
    646632
    647         void AutogenerateRoutines::previsit( FunctionDecl * functionDecl ) {
    648                 visit_children = false;
    649                 // record the existence of this function as appropriate
    650                 managedTypes.handleDWT( functionDecl );
    651 
    652                 maybeAccept( functionDecl->type, *visitor );
     633        void AutogenerateRoutines::previsit( FunctionDecl * ) {
     634                // Track whether we're currently in a function.
     635                // Can ignore function type idiosyncrasies, because function type can never
     636                // declare a new type.
    653637                functionNesting += 1;
    654                 maybeAccept( functionDecl->statements, *visitor );
    655                 functionNesting -= 1;
     638                GuardAction( [this]()  { functionNesting -= 1; } );
    656639        }
    657640
    658641        void AutogenerateRoutines::previsit( CompoundStmt * ) {
    659                 GuardScope( managedTypes );
    660642                GuardScope( structsDone );
    661643        }
Note: See TracChangeset for help on using the changeset viewer.