Changeset 361bf01 for src/ResolvExpr
- Timestamp:
- Dec 11, 2020, 11:20:45 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 5b9a0ae
- Parents:
- a6e0e4c
- Location:
- src/ResolvExpr
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
ra6e0e4c r361bf01 220 220 221 221 void makeUnifiableVars( 222 const ast:: ParameterizedType * type, ast::OpenVarSet & unifiableVars,222 const ast::FunctionType * type, ast::OpenVarSet & unifiableVars, 223 223 ast::AssertionSet & need 224 224 ) { -
src/ResolvExpr/CastCost.cc
ra6e0e4c r361bf01 165 165 } else { 166 166 ast::TypeEnvironment newEnv{ env }; 167 if ( auto wParams = pointerType->base.as< ast:: ParameterizedType >() ) {167 if ( auto wParams = pointerType->base.as< ast::FunctionType >() ) { 168 168 newEnv.add( wParams->forall ); 169 169 } -
src/ResolvExpr/RenameVars.cc
ra6e0e4c r361bf01 93 93 } 94 94 95 template<typename NodeT> 96 const NodeT * openLevel( const NodeT * type ) { 95 const ast::FunctionType * openLevel( const ast::FunctionType * type ) { 97 96 if ( type->forall.empty() ) return type; 98 97 … … 100 99 101 100 // Load new names from this forall clause and perform renaming. 102 NodeT *mutType = ast::mutate( type );101 auto mutType = ast::mutate( type ); 103 102 assert( type == mutType && "mutated type must be unique from ForallSubstitutor" ); 104 103 for ( ast::ptr< ast::TypeDecl > & td : mutType->forall ) { 104 assertf(dynamic_cast<ast::FunctionType *>(mutType), "renaming vars in non-function type"); 105 105 std::ostringstream output; 106 106 output << "_" << resetCount << "_" << level << "_" << td->name; … … 119 119 } 120 120 121 void closeLevel( const ast:: ParameterizedType * type ) {121 void closeLevel( const ast::FunctionType * type ) { 122 122 if ( type->forall.empty() ) return; 123 123 … … 149 149 return renaming.openLevel( type ); 150 150 } 151 152 /* 151 153 const ast::StructInstType * previsit( const ast::StructInstType * type ) { 152 154 return renaming.openLevel( type ); … … 158 160 return renaming.openLevel( type ); 159 161 } 162 */ 163 160 164 const ast::TypeInstType * previsit( const ast::TypeInstType * type ) { 161 return renaming.rename( renaming.openLevel( type ));165 return renaming.rename( type ); 162 166 } 163 void postvisit( const ast:: ParameterizedType * type ) {167 void postvisit( const ast::FunctionType * type ) { 164 168 renaming.closeLevel( type ); 165 169 } -
src/ResolvExpr/Resolver.cc
ra6e0e4c r361bf01 976 976 } 977 977 978 void previsit( const ast::Expr * ) {978 void previsit( const ast::Expr * expr ) { 979 979 if ( result ) { visit_children = false; } 980 if (expr->inferred.hasParams()) { 981 for (auto & imp : expr->inferred.inferParams() ) { 982 previsit(imp.second.expr); 983 } 984 } 980 985 } 981 986 }; -
src/ResolvExpr/Unify.cc
ra6e0e4c r361bf01 898 898 static void markAssertions( 899 899 ast::AssertionSet & assn1, ast::AssertionSet & assn2, 900 const ast:: ParameterizedType * type900 const ast::FunctionType * type 901 901 ) { 902 902 for ( const auto & tyvar : type->forall ) {
Note: See TracChangeset
for help on using the changeset viewer.