- Timestamp:
- Nov 22, 2017, 5:05:54 PM (7 years ago)
- 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:
- 1ba5803
- Parents:
- 83882e9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
r83882e9 rf203a7a 62 62 void previsit( FunctionDecl * functionDecl ); 63 63 64 void previsit( FunctionType * ftype );65 void previsit( PointerType * ptype );66 67 64 void previsit( CompoundStmt * compoundStmt ); 68 65 … … 72 69 unsigned int functionNesting = 0; // current level of nested functions 73 70 74 InitTweak::ManagedTypes managedTypes;75 71 std::vector< FuncData > data; 76 72 }; … … 622 618 // generate ctor/dtors/assign for typedecls, e.g., otype T = int *; 623 619 void AutogenerateRoutines::previsit( TypeDecl * typeDecl ) { 624 visit_children = false;625 620 if ( ! typeDecl->base ) return; 626 621 … … 628 623 TypeFuncGenerator gen( typeDecl, &refType, data, functionNesting, indexer ); 629 624 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 640 626 } 641 627 … … 645 631 } 646 632 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. 653 637 functionNesting += 1; 654 maybeAccept( functionDecl->statements, *visitor ); 655 functionNesting -= 1; 638 GuardAction( [this]() { functionNesting -= 1; } ); 656 639 } 657 640 658 641 void AutogenerateRoutines::previsit( CompoundStmt * ) { 659 GuardScope( managedTypes );660 642 GuardScope( structsDone ); 661 643 }
Note: See TracChangeset
for help on using the changeset viewer.