Changeset 6f49cdf
- Timestamp:
- Apr 11, 2016, 3:29:19 PM (9 years ago)
- 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
- Location:
- src/GenPoly
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
rbfae637 r6f49cdf 664 664 if ( functionDecl->get_statements() ) { // empty routine body ? 665 665 doBeginScope(); 666 TyVarMap oldtyVars = scopeTyVars;666 scopeTyVars.beginScope();; 667 667 assignOps.beginScope(); 668 668 DeclarationWithType *oldRetval = retval; … … 706 706 functionDecl->set_statements( functionDecl->get_statements()->acceptMutator( *this ) ); 707 707 708 scopeTyVars = oldtyVars;708 scopeTyVars.endScope(); 709 709 assignOps.endScope(); 710 710 retval = oldRetval; … … 1456 1456 1457 1457 Type * Pass1::mutate( PointerType *pointerType ) { 1458 TyVarMap oldtyVars = scopeTyVars;1458 scopeTyVars.beginScope(); 1459 1459 makeTyVarMap( pointerType, scopeTyVars ); 1460 1460 1461 1461 Type *ret = Mutator::mutate( pointerType ); 1462 1462 1463 scopeTyVars = oldtyVars;1463 scopeTyVars.endScope(); 1464 1464 return ret; 1465 1465 } 1466 1466 1467 1467 Type * Pass1::mutate( FunctionType *functionType ) { 1468 TyVarMap oldtyVars = scopeTyVars;1468 scopeTyVars.beginScope(); 1469 1469 makeTyVarMap( functionType, scopeTyVars ); 1470 1470 1471 1471 Type *ret = Mutator::mutate( functionType ); 1472 1472 1473 scopeTyVars = oldtyVars;1473 scopeTyVars.endScope(); 1474 1474 return ret; 1475 1475 } … … 1536 1536 1537 1537 Type * Pass2::mutate( PointerType *pointerType ) { 1538 TyVarMap oldtyVars = scopeTyVars;1538 scopeTyVars.beginScope(); 1539 1539 makeTyVarMap( pointerType, scopeTyVars ); 1540 1540 1541 1541 Type *ret = Mutator::mutate( pointerType ); 1542 1542 1543 scopeTyVars = oldtyVars;1543 scopeTyVars.endScope(); 1544 1544 return ret; 1545 1545 } 1546 1546 1547 1547 Type *Pass2::mutate( FunctionType *funcType ) { 1548 TyVarMap oldtyVars = scopeTyVars;1548 scopeTyVars.beginScope(); 1549 1549 makeTyVarMap( funcType, scopeTyVars ); 1550 1550 … … 1627 1627 mutateAll( funcType->get_parameters(), *this ); 1628 1628 1629 scopeTyVars = oldtyVars;1629 scopeTyVars.endScope(); 1630 1630 return funcType; 1631 1631 } … … 1824 1824 template< typename DeclClass > 1825 1825 DeclClass * PolyGenericCalculator::handleDecl( DeclClass *decl, Type *type ) { 1826 TyVarMap oldtyVars = scopeTyVars;1826 scopeTyVars.beginScope(); 1827 1827 makeTyVarMap( type, scopeTyVars ); 1828 1828 1829 1829 DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) ); 1830 1830 1831 scopeTyVars = oldtyVars;1831 scopeTyVars.endScope(); 1832 1832 return ret; 1833 1833 } … … 1851 1851 1852 1852 Type * PolyGenericCalculator::mutate( PointerType *pointerType ) { 1853 TyVarMap oldtyVars = scopeTyVars;1853 scopeTyVars.beginScope(); 1854 1854 makeTyVarMap( pointerType, scopeTyVars ); 1855 1855 1856 1856 Type *ret = Mutator::mutate( pointerType ); 1857 1857 1858 scopeTyVars = oldtyVars;1858 scopeTyVars.endScope(); 1859 1859 return ret; 1860 1860 } 1861 1861 1862 1862 Type * PolyGenericCalculator::mutate( FunctionType *funcType ) { 1863 TyVarMap oldtyVars = scopeTyVars;1863 scopeTyVars.beginScope(); 1864 1864 makeTyVarMap( funcType, scopeTyVars ); 1865 1865 … … 1875 1875 Type *ret = Mutator::mutate( funcType ); 1876 1876 1877 scopeTyVars = oldtyVars;1877 scopeTyVars.endScope(); 1878 1878 return ret; 1879 1879 } … … 2201 2201 template< typename DeclClass > 2202 2202 DeclClass * Pass3::handleDecl( DeclClass *decl, Type *type ) { 2203 TyVarMap oldtyVars = scopeTyVars;2203 scopeTyVars.beginScope(); 2204 2204 makeTyVarMap( type, scopeTyVars ); 2205 2205 … … 2207 2207 ScrubTyVars::scrub( decl, scopeTyVars ); 2208 2208 2209 scopeTyVars = oldtyVars;2209 scopeTyVars.endScope(); 2210 2210 return ret; 2211 2211 } … … 2237 2237 2238 2238 Type * Pass3::mutate( PointerType *pointerType ) { 2239 TyVarMap oldtyVars = scopeTyVars;2239 scopeTyVars.beginScope(); 2240 2240 makeTyVarMap( pointerType, scopeTyVars ); 2241 2241 2242 2242 Type *ret = Mutator::mutate( pointerType ); 2243 2243 2244 scopeTyVars = oldtyVars;2244 scopeTyVars.endScope(); 2245 2245 return ret; 2246 2246 } 2247 2247 2248 2248 Type * Pass3::mutate( FunctionType *functionType ) { 2249 TyVarMap oldtyVars = scopeTyVars;2249 scopeTyVars.beginScope(); 2250 2250 makeTyVarMap( functionType, scopeTyVars ); 2251 2251 2252 2252 Type *ret = Mutator::mutate( functionType ); 2253 2253 2254 scopeTyVars = oldtyVars;2254 scopeTyVars.endScope(); 2255 2255 return ret; 2256 2256 } -
src/GenPoly/FindFunction.cc
rbfae637 r6f49cdf 61 61 62 62 Type * FindFunction::mutate( FunctionType *functionType ) { 63 TyVarMap oldTyVars = tyVars;63 tyVars.beginScope(); 64 64 handleForall( functionType->get_forall() ); 65 65 mutateAll( functionType->get_returnVals(), *this ); … … 72 72 } // if 73 73 } // if 74 tyVars = oldTyVars;74 tyVars.endScope(); 75 75 return ret; 76 76 } 77 77 78 78 Type * FindFunction::mutate( PointerType *pointerType ) { 79 TyVarMap oldTyVars = tyVars;79 tyVars.beginScope(); 80 80 handleForall( pointerType->get_forall() ); 81 81 Type *ret = Mutator::mutate( pointerType ); 82 tyVars = oldTyVars;82 tyVars.endScope(); 83 83 return ret; 84 84 }
Note: See TracChangeset
for help on using the changeset viewer.