Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r5bf3976 r93c10de  
    3333#include "AST/TypeEnvironment.hpp"
    3434#include "Common/PassVisitor.h"     // for PassVisitor
    35 #include "CommonType.hpp"           // for commonType
    3635#include "FindOpenVars.h"           // for findOpenVars
    37 #include "SpecCost.hpp"             // for SpecCost
    3836#include "SynTree/LinkageSpec.h"    // for C
    3937#include "SynTree/Constant.h"       // for Constant
     
    4543#include "Tuples/Tuples.h"          // for isTtype
    4644#include "TypeEnvironment.h"        // for EqvClass, AssertionSet, OpenVarSet
    47 #include "typeops.h"                // for flatten, occurs
     45#include "typeops.h"                // for flatten, occurs, commonType
    4846
    4947namespace ast {
     
    5250
    5351namespace SymTab {
    54         class Indexer;
     52class Indexer;
    5553}  // namespace SymTab
    5654
     
    5856
    5957namespace 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                 } // if
    69                 commonTypes.push_back( commonType );
    70         } // for
    71         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         } // if
    83 }
    8458
    8559        struct Unify_old : public WithShortCircuiting {
Note: See TracChangeset for help on using the changeset viewer.