Changes in src/ResolvExpr/Unify.h [2773ab8:ea6332d]
- File:
-
- 1 edited
-
src/ResolvExpr/Unify.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Unify.h
r2773ab8 rea6332d 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 13:09:04 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 : Fri Jul 21 23:09:34 2017 13 // Update Count : 3 14 14 // 15 15 … … 18 18 #include <list> // for list 19 19 20 #include "AST/Node.hpp" // for ptr21 #include "AST/TypeEnvironment.hpp" // for TypeEnvironment, AssertionSet, OpenVarSet22 20 #include "Common/utility.h" // for deleteAll 23 21 #include "SynTree/Declaration.h" // for TypeDecl, TypeDecl::Data 24 22 #include "TypeEnvironment.h" // for AssertionSet, OpenVarSet 25 #include "WidenMode.h" // for WidenMode26 23 27 24 class Type; 28 25 class TypeInstType; 29 26 namespace SymTab { 30 class Indexer; 31 } 32 33 namespace ast { 34 class SymbolTable; 35 class Type; 36 } 27 class Indexer; 28 } // namespace SymTab 37 29 38 30 namespace ResolvExpr { 31 struct WidenMode { 32 WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {} 33 WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; } 34 WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; } 35 WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; } 36 WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; } 37 operator bool() { return widenFirst && widenSecond; } 38 39 bool widenFirst : 1, widenSecond : 1; 40 }; 41 42 bool bindVar( TypeInstType *typeInst, Type *other, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); 39 43 bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ); 40 44 bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType ); 41 45 bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ); 42 bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer, Type *&common );43 46 44 47 template< typename Iterator1, typename Iterator2 > … … 69 72 } 70 73 71 bool unify(72 const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,73 ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,74 ast::OpenVarSet & open, const ast::SymbolTable & symtab );75 76 bool unify(77 const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,78 ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,79 ast::OpenVarSet & open, const ast::SymbolTable & symtab, ast::ptr<ast::Type> & common );80 81 bool unifyExact(82 const ast::Type * type1, const ast::Type * type2, ast::TypeEnvironment & env,83 ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open,84 WidenMode widen, const ast::SymbolTable & symtab );85 86 bool unifyInexact(87 const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,88 ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,89 const ast::OpenVarSet & open, WidenMode widen, const ast::SymbolTable & symtab,90 ast::ptr<ast::Type> & common );91 92 74 } // namespace ResolvExpr 93 75
Note:
See TracChangeset
for help on using the changeset viewer.