Ignore:
Timestamp:
Jul 19, 2019, 4:52:59 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b5ce31e, fd642d2
Parents:
e723100 (diff), 335d81f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/FindOpenVars.cc

    re723100 r884f1409  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 09:42:48 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun May 17 09:45:25 2015
    13 // Update Count     : 3
     11// Last Modified By : Andrew
     12// Last Modified On : Fri Jul 12 14:18:00 2019
     13// Update Count     : 4
    1414//
    1515
     
    2929                FindOpenVars_old( OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
    3030
    31                 void previsit( PointerType * pointerType );
    32                 void previsit( ArrayType * arrayType );
    33                 void previsit( FunctionType * functionType );
    34                 void previsit( TupleType * tupleType );
     31                void previsit( const PointerType * pointerType );
     32                void previsit( const ArrayType * arrayType );
     33                void previsit( const FunctionType * functionType );
     34                void previsit( const TupleType * tupleType );
    3535
    36                 void common_action( Type *type );
     36                void common_action( const Type *type );
    3737
    3838                OpenVarSet &openVars, &closedVars;
     
    4141        };
    4242
    43         void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen ) {
     43        void findOpenVars( const Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen ) {
    4444                PassVisitor<FindOpenVars_old> finder( openVars, closedVars, needAssertions, haveAssertions, firstIsOpen );
    4545                type->accept( finder );
     
    5050        }
    5151
    52         void FindOpenVars_old::common_action( Type *type ) {
     52        void FindOpenVars_old::common_action( const Type * type ) {
    5353                if ( nextIsOpen ) {
    54                         for ( Type::ForallList::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
     54                        for ( Type::ForallList::const_iterator i = type->forall.begin(); i != type->forall.end(); ++i ) {
    5555                                openVars[ (*i)->get_name() ] = TypeDecl::Data{ (*i) };
    5656                                for ( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
     
    6161                        }
    6262                } else {
    63                         for ( Type::ForallList::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
     63                        for ( Type::ForallList::const_iterator i = type->forall.begin(); i != type->forall.end(); ++i ) {
    6464                                closedVars[ (*i)->get_name() ] = TypeDecl::Data{ (*i) };
    6565                                for ( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
     
    7878        }
    7979
    80         void FindOpenVars_old::previsit(PointerType *pointerType) {
     80        void FindOpenVars_old::previsit(const PointerType * pointerType) {
    8181                common_action( pointerType );
    8282        }
    8383
    84         void FindOpenVars_old::previsit(ArrayType *arrayType) {
     84        void FindOpenVars_old::previsit(const ArrayType * arrayType) {
    8585                common_action( arrayType );
    8686        }
    8787
    88         void FindOpenVars_old::previsit(FunctionType *functionType) {
     88        void FindOpenVars_old::previsit(const FunctionType * functionType) {
    8989                common_action( functionType );
    9090                nextIsOpen = ! nextIsOpen;
     
    9292        }
    9393
    94         void FindOpenVars_old::previsit(TupleType *tupleType) {
     94        void FindOpenVars_old::previsit(const TupleType * tupleType) {
    9595                common_action( tupleType );
    9696        }
     
    104104                        bool nextIsOpen;
    105105
    106                         FindOpenVars_new( 
    107                                 ast::OpenVarSet & o, ast::OpenVarSet & c, ast::AssertionSet & n, 
     106                        FindOpenVars_new(
     107                                ast::OpenVarSet & o, ast::OpenVarSet & c, ast::AssertionSet & n,
    108108                                ast::AssertionSet & h, FirstMode firstIsOpen )
    109109                        : open( o ), closed( c ), need( n ), have( h ), nextIsOpen( firstIsOpen ) {}
     
    135135        }
    136136
    137         void findOpenVars( 
    138                         const ast::Type * type, ast::OpenVarSet & open, ast::OpenVarSet & closed, 
     137        void findOpenVars(
     138                        const ast::Type * type, ast::OpenVarSet & open, ast::OpenVarSet & closed,
    139139                        ast::AssertionSet & need, ast::AssertionSet & have, FirstMode firstIsOpen ) {
    140140                ast::Pass< FindOpenVars_new > finder{ open, closed, need, have, firstIsOpen };
Note: See TracChangeset for help on using the changeset viewer.