Changes in src/ResolvExpr/typeops.h [7870799:6f096d2]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/typeops.h
r7870799 r6f096d2 28 28 #include "SynTree/SynTree.h" 29 29 #include "SynTree/Type.h" 30 #include "SymTab/Indexer.h" 30 31 namespace SymTab { 32 class Indexer; 33 } 31 34 32 35 namespace ResolvExpr { … … 60 63 // in AdjustExprType.cc 61 64 /// Replaces array types with the equivalent pointer, and function types with a pointer-to-function 62 void adjustExprType( Type *& type, const TypeEnvironment &env, const SymTab::Indexer &indexer );65 void adjustExprType( Type *& type, const TypeEnvironment & env, const SymTab::Indexer & indexer ); 63 66 64 67 /// Replaces array types with the equivalent pointer, and function types with a pointer-to-function using empty TypeEnvironment and Indexer … … 66 69 67 70 template< typename ForwardIterator > 68 void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment & env, const SymTab::Indexer &indexer ) {71 void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment & env, const SymTab::Indexer & indexer ) { 69 72 while ( begin != end ) { 70 73 adjustExprType( *begin++, env, indexer ); … … 77 80 78 81 // in CastCost.cc 79 Cost castCost( const Type * src, const Type * dest, const SymTab::Indexer & indexer, const TypeEnvironment &env );82 Cost castCost( const Type * src, const Type * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env ); 80 83 Cost castCost( 81 84 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, … … 83 86 84 87 // in ConversionCost.cc 85 Cost conversionCost( const Type * src, const Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );88 Cost conversionCost( const Type * src, const Type * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env ); 86 89 Cost conversionCost( 87 90 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, … … 89 92 90 93 // in AlternativeFinder.cc 91 Cost computeConversionCost( Type * actualType, Type *formalType,92 const SymTab::Indexer & indexer, const TypeEnvironment &env );94 Cost computeConversionCost( Type * actualType, Type * formalType, 95 const SymTab::Indexer & indexer, const TypeEnvironment & env ); 93 96 94 97 // in PtrsAssignable.cc 95 int ptrsAssignable( const Type * src, const Type * dest, const TypeEnvironment & env );98 int ptrsAssignable( const Type * src, const Type * dest, const TypeEnvironment & env ); 96 99 int ptrsAssignable( const ast::Type * src, const ast::Type * dst, 97 100 const ast::TypeEnvironment & env ); 98 101 99 102 // in PtrsCastable.cc 100 int ptrsCastable( const Type * src, const Type * dest, const TypeEnvironment & env, const SymTab::Indexer &indexer );103 int ptrsCastable( const Type * src, const Type * dest, const TypeEnvironment & env, const SymTab::Indexer & indexer ); 101 104 int ptrsCastable( 102 105 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, … … 104 107 105 108 // in Unify.cc 106 bool typesCompatible( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );107 bool typesCompatibleIgnoreQualifiers( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment &env );108 109 inline bool typesCompatible( Type *t1, Type *t2, const SymTab::Indexer &indexer ) {109 bool typesCompatible( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env ); 110 bool typesCompatibleIgnoreQualifiers( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env ); 111 112 inline bool typesCompatible( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) { 110 113 TypeEnvironment env; 111 114 return typesCompatible( t1, t2, indexer, env ); 112 115 } 113 116 114 inline bool typesCompatibleIgnoreQualifiers( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {117 inline bool typesCompatibleIgnoreQualifiers( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) { 115 118 TypeEnvironment env; 116 119 return typesCompatibleIgnoreQualifiers( t1, t2, indexer, env ); … … 131 134 132 135 // in CommonType.cc 133 Type * commonType( Type * type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars );136 Type * commonType( Type * type1, Type * type2, bool widenFirst, bool widenSecond, const SymTab::Indexer & indexer, TypeEnvironment & env, const OpenVarSet & openVars ); 134 137 ast::ptr< ast::Type > commonType( 135 138 const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2, WidenMode widen, … … 137 140 138 141 // in PolyCost.cc 139 int polyCost( Type * type, const TypeEnvironment &env, const SymTab::Indexer &indexer );142 int polyCost( Type * type, const TypeEnvironment & env, const SymTab::Indexer & indexer ); 140 143 int polyCost( 141 144 const ast::Type * type, const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ); 142 145 143 146 // in SpecCost.cc 144 int specCost( Type * type );147 int specCost( Type * type ); 145 148 int specCost( const ast::Type * type ); 146 149 147 150 // in Occurs.cc 148 bool occurs( Type * type, std::string varName, const TypeEnvironment &env );151 bool occurs( Type * type, std::string varName, const TypeEnvironment & env ); 149 152 // new AST version in TypeEnvironment.cpp (only place it was used in old AST) 150 153 151 154 template<typename Iter> 152 bool occursIn( Type* ty, Iter begin, Iter end, const TypeEnvironment & env ) {155 bool occursIn( Type* ty, Iter begin, Iter end, const TypeEnvironment & env ) { 153 156 while ( begin != end ) { 154 157 if ( occurs( ty, *begin, env ) ) return true; … … 197 200 198 201 // in TypeEnvironment.cc 199 bool isFtype( Type * type );202 bool isFtype( Type * type ); 200 203 } // namespace ResolvExpr 201 204
Note: See TracChangeset
for help on using the changeset viewer.