Changeset 6f49cdf for src


Ignore:
Timestamp:
Apr 11, 2016, 3:29:19 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
5ba653c
Parents:
bfae637
Message:

Switch uses of TyVarMap? over to begin/endScope()

Location:
src/GenPoly
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    rbfae637 r6f49cdf  
    664664                        if ( functionDecl->get_statements() ) {         // empty routine body ?
    665665                                doBeginScope();
    666                                 TyVarMap oldtyVars = scopeTyVars;
     666                                scopeTyVars.beginScope();;
    667667                                assignOps.beginScope();
    668668                                DeclarationWithType *oldRetval = retval;
     
    706706                                functionDecl->set_statements( functionDecl->get_statements()->acceptMutator( *this ) );
    707707
    708                                 scopeTyVars = oldtyVars;
     708                                scopeTyVars.endScope();
    709709                                assignOps.endScope();
    710710                                retval = oldRetval;
     
    14561456
    14571457                Type * Pass1::mutate( PointerType *pointerType ) {
    1458                         TyVarMap oldtyVars = scopeTyVars;
     1458                        scopeTyVars.beginScope();
    14591459                        makeTyVarMap( pointerType, scopeTyVars );
    14601460
    14611461                        Type *ret = Mutator::mutate( pointerType );
    14621462
    1463                         scopeTyVars = oldtyVars;
     1463                        scopeTyVars.endScope();
    14641464                        return ret;
    14651465                }
    14661466
    14671467                Type * Pass1::mutate( FunctionType *functionType ) {
    1468                         TyVarMap oldtyVars = scopeTyVars;
     1468                        scopeTyVars.beginScope();
    14691469                        makeTyVarMap( functionType, scopeTyVars );
    14701470
    14711471                        Type *ret = Mutator::mutate( functionType );
    14721472
    1473                         scopeTyVars = oldtyVars;
     1473                        scopeTyVars.endScope();
    14741474                        return ret;
    14751475                }
     
    15361536
    15371537                Type * Pass2::mutate( PointerType *pointerType ) {
    1538                         TyVarMap oldtyVars = scopeTyVars;
     1538                        scopeTyVars.beginScope();
    15391539                        makeTyVarMap( pointerType, scopeTyVars );
    15401540
    15411541                        Type *ret = Mutator::mutate( pointerType );
    15421542
    1543                         scopeTyVars = oldtyVars;
     1543                        scopeTyVars.endScope();
    15441544                        return ret;
    15451545                }
    15461546
    15471547                Type *Pass2::mutate( FunctionType *funcType ) {
    1548                         TyVarMap oldtyVars = scopeTyVars;
     1548                        scopeTyVars.beginScope();
    15491549                        makeTyVarMap( funcType, scopeTyVars );
    15501550
     
    16271627                        mutateAll( funcType->get_parameters(), *this );
    16281628
    1629                         scopeTyVars = oldtyVars;
     1629                        scopeTyVars.endScope();
    16301630                        return funcType;
    16311631                }
     
    18241824                template< typename DeclClass >
    18251825                DeclClass * PolyGenericCalculator::handleDecl( DeclClass *decl, Type *type ) {
    1826                         TyVarMap oldtyVars = scopeTyVars;
     1826                        scopeTyVars.beginScope();
    18271827                        makeTyVarMap( type, scopeTyVars );
    18281828
    18291829                        DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) );
    18301830
    1831                         scopeTyVars = oldtyVars;
     1831                        scopeTyVars.endScope();
    18321832                        return ret;
    18331833                }
     
    18511851
    18521852                Type * PolyGenericCalculator::mutate( PointerType *pointerType ) {
    1853                         TyVarMap oldtyVars = scopeTyVars;
     1853                        scopeTyVars.beginScope();
    18541854                        makeTyVarMap( pointerType, scopeTyVars );
    18551855
    18561856                        Type *ret = Mutator::mutate( pointerType );
    18571857
    1858                         scopeTyVars = oldtyVars;
     1858                        scopeTyVars.endScope();
    18591859                        return ret;
    18601860                }
    18611861
    18621862                Type * PolyGenericCalculator::mutate( FunctionType *funcType ) {
    1863                         TyVarMap oldtyVars = scopeTyVars;
     1863                        scopeTyVars.beginScope();
    18641864                        makeTyVarMap( funcType, scopeTyVars );
    18651865
     
    18751875                        Type *ret = Mutator::mutate( funcType );
    18761876
    1877                         scopeTyVars = oldtyVars;
     1877                        scopeTyVars.endScope();
    18781878                        return ret;
    18791879                }
     
    22012201                template< typename DeclClass >
    22022202                DeclClass * Pass3::handleDecl( DeclClass *decl, Type *type ) {
    2203                         TyVarMap oldtyVars = scopeTyVars;
     2203                        scopeTyVars.beginScope();
    22042204                        makeTyVarMap( type, scopeTyVars );
    22052205
     
    22072207                        ScrubTyVars::scrub( decl, scopeTyVars );
    22082208
    2209                         scopeTyVars = oldtyVars;
     2209                        scopeTyVars.endScope();
    22102210                        return ret;
    22112211                }
     
    22372237
    22382238                Type * Pass3::mutate( PointerType *pointerType ) {
    2239                         TyVarMap oldtyVars = scopeTyVars;
     2239                        scopeTyVars.beginScope();
    22402240                        makeTyVarMap( pointerType, scopeTyVars );
    22412241
    22422242                        Type *ret = Mutator::mutate( pointerType );
    22432243
    2244                         scopeTyVars = oldtyVars;
     2244                        scopeTyVars.endScope();
    22452245                        return ret;
    22462246                }
    22472247
    22482248                Type * Pass3::mutate( FunctionType *functionType ) {
    2249                         TyVarMap oldtyVars = scopeTyVars;
     2249                        scopeTyVars.beginScope();
    22502250                        makeTyVarMap( functionType, scopeTyVars );
    22512251
    22522252                        Type *ret = Mutator::mutate( functionType );
    22532253
    2254                         scopeTyVars = oldtyVars;
     2254                        scopeTyVars.endScope();
    22552255                        return ret;
    22562256                }
  • src/GenPoly/FindFunction.cc

    rbfae637 r6f49cdf  
    6161
    6262        Type * FindFunction::mutate( FunctionType *functionType ) {
    63                 TyVarMap oldTyVars = tyVars;
     63                tyVars.beginScope();
    6464                handleForall( functionType->get_forall() );
    6565                mutateAll( functionType->get_returnVals(), *this );
     
    7272                        } // if
    7373                } // if
    74                 tyVars = oldTyVars;
     74                tyVars.endScope();
    7575                return ret;
    7676        }
    7777
    7878        Type * FindFunction::mutate( PointerType *pointerType ) {
    79                 TyVarMap oldTyVars = tyVars;
     79                tyVars.beginScope();
    8080                handleForall( pointerType->get_forall() );
    8181                Type *ret = Mutator::mutate( pointerType );
    82                 tyVars = oldTyVars;
     82                tyVars.endScope();
    8383                return ret;
    8484        }
Note: See TracChangeset for help on using the changeset viewer.