Changeset 8c49c0e for src/ResolvExpr


Ignore:
Timestamp:
Sep 19, 2016, 4:39:33 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
aefcc3b
Parents:
3c13c03
Message:

decouple code that uses Type's forall list from std::list in preparation for trying to replace with a managed list

Location:
src/ResolvExpr
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r3c13c03 r8c49c0e  
    362362        /// Adds type variables to the open variable set and marks their assertions
    363363        void makeUnifiableVars( Type *type, OpenVarSet &unifiableVars, AssertionSet &needAssertions ) {
    364                 for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
     364                for ( Type::ForallList::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
    365365                        unifiableVars[ (*tyvar)->get_name() ] = (*tyvar)->get_kind();
    366366                        for ( std::list< DeclarationWithType* >::iterator assert = (*tyvar)->get_assertions().begin(); assert != (*tyvar)->get_assertions().end(); ++assert ) {
  • src/ResolvExpr/FindOpenVars.cc

    r3c13c03 r8c49c0e  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FindOpenVars.cc -- 
     7// FindOpenVars.cc --
    88//
    99// Author           : Richard C. Bilson
     
    4747        void FindOpenVars::common_action( Type *type ) {
    4848                if ( nextIsOpen ) {
    49                         for ( std::list< TypeDecl* >::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
     49                        for ( Type::ForallList::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
    5050                                openVars[ (*i)->get_name() ] = (*i)->get_kind();
    5151                                for ( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
     
    5656                        }
    5757                } else {
    58                         for ( std::list< TypeDecl* >::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
     58                        for ( Type::ForallList::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
    5959                                closedVars[ (*i)->get_name() ] = (*i)->get_kind();
    6060                                for ( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
  • src/ResolvExpr/RenameVars.cc

    r3c13c03 r8c49c0e  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // RenameVars.cc -- 
     7// RenameVars.cc --
    88//
    99// Author           : Richard C. Bilson
     
    115115                        mapStack.push_front( mapStack.front() );
    116116                        // renames all "forall" type names to `_${level}_${name}'
    117                         for ( std::list< TypeDecl* >::iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
     117                        for ( Type::ForallList::iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
    118118                                std::ostringstream output;
    119119                                output << "_" << level << "_" << (*i)->get_name();
  • src/ResolvExpr/TypeEnvironment.cc

    r3c13c03 r8c49c0e  
    158158        }
    159159
    160         void TypeEnvironment::add( const std::list< TypeDecl* > &tyDecls ) {
    161                 for ( std::list< TypeDecl* >::const_iterator i = tyDecls.begin(); i != tyDecls.end(); ++i ) {
     160        void TypeEnvironment::add( const Type::ForallList &tyDecls ) {
     161                for ( Type::ForallList::const_iterator i = tyDecls.begin(); i != tyDecls.end(); ++i ) {
    162162                        EqvClass newClass;
    163163                        newClass.vars.insert( (*i)->get_name() );
  • src/ResolvExpr/TypeEnvironment.h

    r3c13c03 r8c49c0e  
    5555                bool lookup( const std::string &var, EqvClass &eqvClass ) const;
    5656                void add( const EqvClass &eqvClass );
    57                 void add( const std::list< TypeDecl* > &tyDecls );
     57                void add( const Type::ForallList &tyDecls );
    5858                template< typename SynTreeClass > int apply( SynTreeClass *&type ) const;
    5959                template< typename SynTreeClass > int applyFree( SynTreeClass *&type ) const;
  • src/ResolvExpr/Unify.cc

    r3c13c03 r8c49c0e  
    416416
    417417        void markAssertions( AssertionSet &assertion1, AssertionSet &assertion2, Type *type ) {
    418                 for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
     418                for ( Type::ForallList::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
    419419                        for ( std::list< DeclarationWithType* >::const_iterator assert = (*tyvar)->get_assertions().begin(); assert != (*tyvar)->get_assertions().end(); ++assert ) {
    420420                                markAssertionSet( assertion1, *assert );
Note: See TracChangeset for help on using the changeset viewer.