- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/TypeEnvironment.h
rd286cf68 r00ac42e 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:24:58 2015 11 // Last Modified By : Aaron B. Moss12 // Last Modified On : Mon Jun 18 11:58:00 201813 // Update Count : 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:35:45 2017 13 // Update Count : 3 14 14 // 15 15 … … 21 21 #include <set> // for set 22 22 #include <string> // for string 23 #include <utility> // for move, swap24 25 #include "WidenMode.h" // for WidenMode26 23 27 24 #include "SynTree/Declaration.h" // for TypeDecl::Data, DeclarationWit... … … 80 77 EqvClass( const EqvClass &other ); 81 78 EqvClass( const EqvClass &other, const Type *ty ); 82 EqvClass( EqvClass &&other );83 79 EqvClass &operator=( const EqvClass &other ); 84 EqvClass &operator=( EqvClass &&other );85 80 ~EqvClass(); 86 81 void print( std::ostream &os, Indenter indent = {} ) const; 87 88 /// Takes ownership of `ty`, freeing old `type`89 void set_type(Type* ty);90 82 }; 91 83 … … 93 85 public: 94 86 const EqvClass* lookup( const std::string &var ) const; 95 private:87 void add( const EqvClass &eqvClass ); 96 88 void add( EqvClass &&eqvClass ); 97 public:98 89 void add( const Type::ForallList &tyDecls ); 99 90 void add( const TypeSubstitution & sub ); … … 103 94 bool isEmpty() const { return env.empty(); } 104 95 void print( std::ostream &os, Indenter indent = {} ) const; 105 //void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) );96 void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) ); 106 97 void simpleCombine( const TypeEnvironment &second ); 107 98 void extractOpenVars( OpenVarSet &openVars ) const; … … 112 103 void addActual( const TypeEnvironment& actualEnv, OpenVarSet& openVars ); 113 104 114 /// Binds the type class represented by `typeInst` to the type `bindTo`; will add 115 /// the class if needed. Returns false on failure. 116 bool bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); 117 118 /// Binds the type classes represented by `var1` and `var2` together; will add 119 /// one or both classes if needed. Returns false on failure. 120 bool bindVarToVar( TypeInstType *var1, TypeInstType *var2, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); 121 122 /// Disallows widening for all bindings in the environment 123 void forbidWidening(); 124 125 using iterator = std::list< EqvClass >::const_iterator; 126 iterator begin() const { return env.begin(); } 127 iterator end() const { return env.end(); } 128 105 typedef std::list< EqvClass >::iterator iterator; 106 iterator begin() { return env.begin(); } 107 iterator end() { return env.end(); } 108 typedef std::list< EqvClass >::const_iterator const_iterator; 109 const_iterator begin() const { return env.begin(); } 110 const_iterator end() const { return env.end(); } 129 111 private: 130 112 std::list< EqvClass > env; 131 132 113 std::list< EqvClass >::iterator internal_lookup( const std::string &var ); 133 114 };
Note: See TracChangeset
for help on using the changeset viewer.