Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/TypeEnvironment.cc

    ra585396 r50377a4  
    6868        }
    6969
    70         void EqvClass::print( std::ostream &os, int indent ) const {
    71                 os << std::string( indent, ' ' ) << "( ";
     70        void EqvClass::print( std::ostream &os, Indenter indent ) const {
     71                os << "( ";
    7272                std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) );
    7373                os << ")";
    7474                if ( type ) {
    7575                        os << " -> ";
    76                         type->print( os, indent );
     76                        type->print( os, indent+1 );
    7777                } // if
    7878                if ( ! allowWidening ) {
     
    123123                for ( std::list< EqvClass >::const_iterator theClass = env.begin(); theClass != env.end(); ++theClass ) {
    124124                        for ( std::set< std::string >::const_iterator theVar = theClass->vars.begin(); theVar != theClass->vars.end(); ++theVar ) {
    125 ///       std::cout << "adding " << *theVar;
     125///       std::cerr << "adding " << *theVar;
    126126                                if ( theClass->type ) {
    127 ///         std::cout << " bound to ";
    128 ///         theClass->type->print( std::cout );
    129 ///         std::cout << std::endl;
     127///         std::cerr << " bound to ";
     128///         theClass->type->print( std::cerr );
     129///         std::cerr << std::endl;
    130130                                        sub.add( *theVar, theClass->type );
    131131                                } else if ( theVar != theClass->vars.begin() ) {
    132132                                        TypeInstType *newTypeInst = new TypeInstType( Type::Qualifiers(), *theClass->vars.begin(), theClass->data.kind == TypeDecl::Ftype );
    133 ///         std::cout << " bound to variable " << *theClass->vars.begin() << std::endl;
     133///         std::cerr << " bound to variable " << *theClass->vars.begin() << std::endl;
    134134                                        sub.add( *theVar, newTypeInst );
    135135                                        delete newTypeInst;
     
    144144        }
    145145
    146         void TypeEnvironment::print( std::ostream &os, int indent ) const {
     146        void TypeEnvironment::print( std::ostream &os, Indenter indent ) const {
    147147                for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) {
    148148                        i->print( os, indent );
     
    201201        }
    202202
    203         void TypeEnvironment::addActual( const TypeEnvironment& actualEnv, OpenVarSet& openVars ) {
    204                 for ( const EqvClass& c : actualEnv ) {
    205                         EqvClass c2 = c;
    206                         c2.allowWidening = false;
    207                         for ( const std::string& var : c2.vars ) {
    208                                 openVars[ var ] = c2.data;
    209                         }
    210                         env.push_back( std::move(c2) );
    211                 }
    212         }
    213 
    214203} // namespace ResolvExpr
    215204
Note: See TracChangeset for help on using the changeset viewer.