Changeset 7870799 for src/ResolvExpr/typeops.h
- Timestamp:
- Jul 12, 2019, 10:49:02 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- ef5b828
- Parents:
- ee6dbae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/typeops.h
ree6dbae r7870799 73 73 74 74 /// Replaces array types with equivalent pointer, and function types with a pointer-to-function 75 const ast::Type * adjustExprType( 75 const ast::Type * adjustExprType( 76 76 const ast::Type * type, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab ); 77 77 78 78 // in CastCost.cc 79 Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );80 Cost castCost( 81 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 79 Cost castCost( const Type * src, const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 80 Cost castCost( 81 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 82 82 const ast::TypeEnvironment & env ); 83 83 84 84 // in ConversionCost.cc 85 Cost conversionCost( Type *src,Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );86 Cost conversionCost( 87 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 85 Cost conversionCost( const Type *src, const Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 86 Cost conversionCost( 87 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 88 88 const ast::TypeEnvironment & env ); 89 89 90 90 // in AlternativeFinder.cc 91 Cost computeConversionCost( Type *actualType, Type *formalType, 91 Cost computeConversionCost( Type *actualType, Type *formalType, 92 92 const SymTab::Indexer &indexer, const TypeEnvironment &env ); 93 93 94 94 // in PtrsAssignable.cc 95 int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env );95 int ptrsAssignable( const Type * src, const Type * dest, const TypeEnvironment &env ); 96 96 int ptrsAssignable( const ast::Type * src, const ast::Type * dst, 97 97 const ast::TypeEnvironment & env ); 98 98 99 99 // in PtrsCastable.cc 100 int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer );101 int ptrsCastable( 102 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 100 int ptrsCastable( const Type * src, const Type * dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ); 101 int ptrsCastable( 102 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 103 103 const ast::TypeEnvironment & env ); 104 104 105 105 // in Unify.cc 106 106 bool typesCompatible( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 107 bool typesCompatibleIgnoreQualifiers( Type *,Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );107 bool typesCompatibleIgnoreQualifiers( const Type *, const Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 108 108 109 109 inline bool typesCompatible( Type *t1, Type *t2, const SymTab::Indexer &indexer ) { … … 112 112 } 113 113 114 inline bool typesCompatibleIgnoreQualifiers( Type *t1, Type *t2, const SymTab::Indexer &indexer ) {114 inline bool typesCompatibleIgnoreQualifiers( const Type * t1, const Type * t2, const SymTab::Indexer &indexer ) { 115 115 TypeEnvironment env; 116 116 return typesCompatibleIgnoreQualifiers( t1, t2, indexer, env ); 117 117 } 118 118 119 bool typesCompatible( 120 const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {}, 119 bool typesCompatible( 120 const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {}, 121 121 const ast::TypeEnvironment & env = {} ); 122 122 123 123 bool typesCompatibleIgnoreQualifiers( 124 const ast::Type *, const ast::Type *, const ast::SymbolTable &, 124 const ast::Type *, const ast::Type *, const ast::SymbolTable &, 125 125 const ast::TypeEnvironment & env = {} ); 126 126 … … 133 133 Type * commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ); 134 134 ast::ptr< ast::Type > commonType( 135 const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2, WidenMode widen, 135 const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2, WidenMode widen, 136 136 const ast::SymbolTable & symtab, ast::TypeEnvironment & env, const ast::OpenVarSet & open ); 137 137 138 138 // in PolyCost.cc 139 139 int polyCost( Type *type, const TypeEnvironment &env, const SymTab::Indexer &indexer ); 140 int polyCost( 140 int polyCost( 141 141 const ast::Type * type, const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ); 142 142 … … 149 149 // new AST version in TypeEnvironment.cpp (only place it was used in old AST) 150 150 151 template<typename Iter> 151 template<typename Iter> 152 152 bool occursIn( Type* ty, Iter begin, Iter end, const TypeEnvironment &env ) { 153 153 while ( begin != end ) { … … 176 176 177 177 /// flatten tuple type into existing list of types 178 static inline void flatten( 179 const ast::Type * type, std::vector< ast::ptr< ast::Type > > & out 178 static inline void flatten( 179 const ast::Type * type, std::vector< ast::ptr< ast::Type > > & out 180 180 ) { 181 if ( auto tupleType = dynamic_cast< const ast::TupleType * >( type ) ) { 181 if ( auto tupleType = dynamic_cast< const ast::TupleType * >( type ) ) { 182 182 for ( const ast::Type * t : tupleType->types ) { 183 183 flatten( t, out );
Note: See TracChangeset
for help on using the changeset viewer.