Changeset 09c72d5
- Timestamp:
- Mar 2, 2018, 5:34:52 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:
- b8baa37
- Parents:
- dd05e12
- git-author:
- Rob Schluntz <rschlunt@…> (03/02/18 17:10:28)
- git-committer:
- Rob Schluntz <rschlunt@…> (03/02/18 17:34:52)
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/TypeEnvironment.cc
rdd05e12 r09c72d5 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
rdd05e12 r09c72d5 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; -
src/SynTree/TypeSubstitution.h
rdd05e12 r09c72d5 82 82 TypeEnvType typeEnv; 83 83 VarEnvType varEnv; 84 85 public: 86 // has to come after declaration of typeEnv 87 auto begin() -> decltype( typeEnv.begin() ) { return typeEnv.begin(); } 88 auto end() -> decltype( typeEnv. end() ) { return typeEnv. end(); } 89 auto begin() const -> decltype( typeEnv.begin() ) { return typeEnv.begin(); } 90 auto end() const -> decltype( typeEnv. end() ) { return typeEnv. end(); } 84 91 }; 85 92
Note: See TracChangeset
for help on using the changeset viewer.