Changes in src/ResolvExpr/Unify.cc [5bf3976:93c10de]
- File:
-
- 1 edited
-
src/ResolvExpr/Unify.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Unify.cc
r5bf3976 r93c10de 33 33 #include "AST/TypeEnvironment.hpp" 34 34 #include "Common/PassVisitor.h" // for PassVisitor 35 #include "CommonType.hpp" // for commonType36 35 #include "FindOpenVars.h" // for findOpenVars 37 #include "SpecCost.hpp" // for SpecCost38 36 #include "SynTree/LinkageSpec.h" // for C 39 37 #include "SynTree/Constant.h" // for Constant … … 45 43 #include "Tuples/Tuples.h" // for isTtype 46 44 #include "TypeEnvironment.h" // for EqvClass, AssertionSet, OpenVarSet 47 #include "typeops.h" // for flatten, occurs 45 #include "typeops.h" // for flatten, occurs, commonType 48 46 49 47 namespace ast { … … 52 50 53 51 namespace SymTab { 54 class Indexer;52 class Indexer; 55 53 } // namespace SymTab 56 54 … … 58 56 59 57 namespace ResolvExpr { 60 61 // Template Helpers:62 template< typename Iterator1, typename Iterator2 >63 bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, std::list< Type* > &commonTypes ) {64 for ( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) {65 Type *commonType = 0;66 if ( ! unify( *list1Begin, *list2Begin, env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) {67 return false;68 } // if69 commonTypes.push_back( commonType );70 } // for71 return ( list1Begin == list1End && list2Begin == list2End );72 }73 74 template< typename Iterator1, typename Iterator2 >75 bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) {76 std::list< Type* > commonTypes;77 if ( unifyList( list1Begin, list1End, list2Begin, list2End, env, needAssertions, haveAssertions, openVars, indexer, commonTypes ) ) {78 deleteAll( commonTypes );79 return true;80 } else {81 return false;82 } // if83 }84 58 85 59 struct Unify_old : public WithShortCircuiting {
Note:
See TracChangeset
for help on using the changeset viewer.