Changeset 93c10de for src/AST/TypeEnvironment.hpp
- Timestamp:
- Nov 24, 2022, 11:01:37 AM (19 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 82a90d4
- Parents:
- 78de1e5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/TypeEnvironment.hpp
r78de1e5 r93c10de 79 79 80 80 /// Set of open variables 81 using OpenVarSet = std::unordered_map< Type InstType::TypeEnvKey, TypeDecl::Data >;81 using OpenVarSet = std::unordered_map< TypeEnvKey, TypeData >; 82 82 83 83 /// Merges one set of open vars into another … … 95 95 /// they bind to. 96 96 struct EqvClass { 97 std::unordered_set< Type InstType::TypeEnvKey > vars;97 std::unordered_set< TypeEnvKey > vars; 98 98 ptr<Type> bound; 99 99 bool allowWidening; 100 TypeD ecl::Data data;100 TypeData data; 101 101 102 102 EqvClass() : vars(), bound(), allowWidening( true ), data() {} … … 111 111 112 112 /// Singleton class constructor from substitution 113 EqvClass( const Type InstType::TypeEnvKey & v, const Type * b )113 EqvClass( const TypeEnvKey & v, const Type * b ) 114 114 : vars{ v }, bound( b ), allowWidening( false ), data( TypeDecl::Dtype, false ) {} 115 115 116 116 /// Single-var constructor (strips qualifiers from bound type) 117 EqvClass( const Type InstType::TypeEnvKey & v, const Type * b, bool w, const TypeDecl::Data & d )117 EqvClass( const TypeEnvKey & v, const Type * b, bool w, const TypeData & d ) 118 118 : vars{ v }, bound( b ), allowWidening( w ), data( d ) { 119 119 reset_qualifiers( bound ); … … 121 121 122 122 /// Double-var constructor 123 EqvClass( const Type InstType::TypeEnvKey & v, const TypeInstType::TypeEnvKey & u, bool w, const TypeDecl::Data & d )123 EqvClass( const TypeEnvKey & v, const TypeEnvKey & u, bool w, const TypeData & d ) 124 124 : vars{ v, u }, bound(), allowWidening( w ), data( d ) {} 125 125 … … 137 137 public: 138 138 /// Finds the equivalence class containing a variable; nullptr for none such 139 const EqvClass * lookup( const Type InstType::TypeEnvKey & var ) const;139 const EqvClass * lookup( const TypeEnvKey & var ) const; 140 140 141 141 /// Add a new equivalence class for each type variable … … 181 181 /// needed. Returns false on failure. 182 182 bool bindVar( 183 const TypeInstType * typeInst, const Type * bindTo, const TypeD ecl::Data & data,183 const TypeInstType * typeInst, const Type * bindTo, const TypeData & data, 184 184 AssertionSet & need, AssertionSet & have, const OpenVarSet & openVars, 185 185 ResolvExpr::WidenMode widen, const SymbolTable & symtab ); … … 188 188 /// classes if needed. Returns false on failure. 189 189 bool bindVarToVar( 190 const TypeInstType * var1, const TypeInstType * var2, TypeD ecl::Data && data,190 const TypeInstType * var1, const TypeInstType * var2, TypeData && data, 191 191 AssertionSet & need, AssertionSet & have, const OpenVarSet & openVars, 192 192 ResolvExpr::WidenMode widen, const SymbolTable & symtab ); … … 213 213 214 214 /// Private lookup API; returns array index of string, or env.size() for not found 215 ClassList::iterator internal_lookup( const Type InstType::TypeEnvKey & );215 ClassList::iterator internal_lookup( const TypeEnvKey & ); 216 216 }; 217 217
Note: See TracChangeset
for help on using the changeset viewer.