Changeset caa649b for src/ResolvExpr
- Timestamp:
- Mar 6, 2018, 12:11:11 PM (8 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:
- 520145b, e5d4e5c, e6c5e79
- Parents:
- 094476d (diff), 1feb535f (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. - Location:
- src/ResolvExpr
- Files:
-
- 3 edited
-
Resolver.cc (modified) (2 diffs)
-
TypeEnvironment.cc (modified) (1 diff)
-
TypeEnvironment.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r094476d rcaa649b 788 788 stmtExpr->accept( resolver ); 789 789 stmtExpr->computeResult(); 790 // xxx - aggregate the environments from all statements? Possibly in AlternativeFinder instead? 790 791 } 791 792 … … 793 794 visit_children = false; 794 795 // xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit 795 maybeAccept( ctorInit-> get_ctor(), *visitor );796 maybeAccept( ctorInit-> get_dtor(), *visitor );796 maybeAccept( ctorInit->ctor, *visitor ); 797 maybeAccept( ctorInit->dtor, *visitor ); 797 798 798 799 // found a constructor - can get rid of C-style initializer 799 delete ctorInit-> get_init();800 ctorInit-> set_init( NULL );800 delete ctorInit->init; 801 ctorInit->init = nullptr; 801 802 802 803 // intrinsic single parameter constructors and destructors do nothing. Since this was 803 804 // implicitly generated, there's no way for it to have side effects, so get rid of it 804 805 // to clean up generated code. 805 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit-> get_ctor()) ) {806 delete ctorInit-> get_ctor();807 ctorInit-> set_ctor( NULL );808 } 809 810 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit-> get_dtor()) ) {811 delete ctorInit-> get_dtor();812 ctorInit-> set_dtor( NULL );806 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->ctor ) ) { 807 delete ctorInit->ctor; 808 ctorInit->ctor = nullptr; 809 } 810 811 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->dtor ) ) { 812 delete ctorInit->dtor; 813 ctorInit->dtor = nullptr; 813 814 } 814 815 -
src/ResolvExpr/TypeEnvironment.cc
r094476d rcaa649b 118 118 env.push_back( newClass ); 119 119 } // for 120 } 121 122 void TypeEnvironment::add( const TypeSubstitution & sub ) { 123 EqvClass newClass; 124 for ( auto p : sub ) { 125 newClass.vars.insert( p.first ); 126 newClass.type = p.second->clone(); 127 newClass.allowWidening = false; 128 // Minimal assumptions. Not technically correct, but might be good enough, and 129 // is the best we can do at the moment since information is lost in the 130 // transition to TypeSubstitution 131 newClass.data = TypeDecl::Data{ TypeDecl::Dtype, false }; 132 add( newClass ); 133 } 120 134 } 121 135 -
src/ResolvExpr/TypeEnvironment.h
r094476d rcaa649b 76 76 void add( const EqvClass &eqvClass ); 77 77 void add( const Type::ForallList &tyDecls ); 78 void add( const TypeSubstitution & sub ); 78 79 template< typename SynTreeClass > int apply( SynTreeClass *&type ) const; 79 80 template< typename SynTreeClass > int applyFree( SynTreeClass *&type ) const;
Note:
See TracChangeset
for help on using the changeset viewer.