Changeset 3096ec1 for src/ResolvExpr
- Timestamp:
- Oct 2, 2017, 6:02:25 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:
- 11a2d9b
- Parents:
- 9d79f93
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Unify.cc
r9d79f93 r3096ec1 22 22 #include <utility> // for pair 23 23 24 #include "Common/PassVisitor.h" // for PassVisitor 24 25 #include "FindOpenVars.h" // for findOpenVars 25 26 #include "Parser/LinkageSpec.h" // for C … … 537 538 /// If this isn't done then argument lists can have wildly different 538 539 /// size and structure, when they should be compatible. 539 struct TtypeExpander : public Mutator { 540 TypeEnvironment & env; 541 TtypeExpander( TypeEnvironment & env ) : env( env ) {} 542 Type * mutate( TypeInstType * typeInst ) { 540 struct TtypeExpander : public WithShortCircuiting { 541 TypeEnvironment & tenv; 542 TtypeExpander( TypeEnvironment & tenv ) : tenv( tenv ) {} 543 void premutate( TypeInstType * ) { visit_children = false; } 544 Type * postmutate( TypeInstType * typeInst ) { 543 545 EqvClass eqvClass; 544 if ( env.lookup( typeInst->get_name(), eqvClass ) ) {546 if ( tenv.lookup( typeInst->get_name(), eqvClass ) ) { 545 547 if ( eqvClass.data.kind == TypeDecl::Ttype ) { 546 548 // expand ttype parameter into its actual type … … 560 562 dst.clear(); 561 563 for ( DeclarationWithType * dcl : src ) { 562 TtypeExpanderexpander( env );564 PassVisitor<TtypeExpander> expander( env ); 563 565 dcl->acceptMutator( expander ); 564 566 std::list< Type * > types; … … 750 752 std::list<Type *> types1, types2; 751 753 752 TtypeExpanderexpander( env );754 PassVisitor<TtypeExpander> expander( env ); 753 755 flat1->acceptMutator( expander ); 754 756 flat2->acceptMutator( expander );
Note: See TracChangeset
for help on using the changeset viewer.