Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/TypeEnvironment.h

    rd286cf68 r00ac42e  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 12:24:58 2015
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Mon Jun 18 11:58:00 2018
    13 // Update Count     : 4
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sat Jul 22 09:35:45 2017
     13// Update Count     : 3
    1414//
    1515
     
    2121#include <set>                         // for set
    2222#include <string>                      // for string
    23 #include <utility>                     // for move, swap
    24 
    25 #include "WidenMode.h"                 // for WidenMode
    2623
    2724#include "SynTree/Declaration.h"       // for TypeDecl::Data, DeclarationWit...
     
    8077                EqvClass( const EqvClass &other );
    8178                EqvClass( const EqvClass &other, const Type *ty );
    82                 EqvClass( EqvClass &&other );
    8379                EqvClass &operator=( const EqvClass &other );
    84                 EqvClass &operator=( EqvClass &&other );
    8580                ~EqvClass();
    8681                void print( std::ostream &os, Indenter indent = {} ) const;
    87 
    88                 /// Takes ownership of `ty`, freeing old `type`
    89                 void set_type(Type* ty);
    9082        };
    9183
     
    9385          public:
    9486                const EqvClass* lookup( const std::string &var ) const;
    95           private:
     87                void add( const EqvClass &eqvClass );
    9688                void add( EqvClass &&eqvClass  );
    97           public:
    9889                void add( const Type::ForallList &tyDecls );
    9990                void add( const TypeSubstitution & sub );
     
    10394                bool isEmpty() const { return env.empty(); }
    10495                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* ) );
    10697                void simpleCombine( const TypeEnvironment &second );
    10798                void extractOpenVars( OpenVarSet &openVars ) const;
     
    112103                void addActual( const TypeEnvironment& actualEnv, OpenVarSet& openVars );
    113104
    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(); }
    129111          private:
    130112                std::list< EqvClass > env;
    131                
    132113                std::list< EqvClass >::iterator internal_lookup( const std::string &var );
    133114        };
Note: See TracChangeset for help on using the changeset viewer.