Changeset dd0c97b for src/GenPoly
- Timestamp:
- Jan 11, 2017, 3:29:33 PM (9 years ago)
- 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:
- d3a85240
- Parents:
- 627f585
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r627f585 rdd0c97b 136 136 template< typename DeclClass > 137 137 DeclClass *handleDecl( DeclClass *decl, Type *type ); 138 139 using PolyMutator::mutate; 138 template< typename AggDecl > 139 AggDecl * handleAggDecl( AggDecl * aggDecl ); 140 141 typedef PolyMutator Parent; 142 using Parent::mutate; 140 143 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override; 141 144 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override; 145 virtual StructDecl *mutate( StructDecl *structDecl ) override; 146 virtual UnionDecl *mutate( UnionDecl *unionDecl ) override; 142 147 virtual TypeDecl *mutate( TypeDecl *typeDecl ) override; 143 148 virtual TypedefDecl *mutate( TypedefDecl *typedefDecl ) override; … … 1275 1280 template< typename DeclClass > 1276 1281 DeclClass * Pass2::handleDecl( DeclClass *decl, Type *type ) { 1277 DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) );1282 DeclClass *ret = static_cast< DeclClass *>( Parent::mutate( decl ) ); 1278 1283 1279 1284 return ret; … … 1309 1314 } 1310 1315 1316 template< typename AggDecl > 1317 AggDecl * Pass2::handleAggDecl( AggDecl * aggDecl ) { 1318 // prevent tyVars from leaking into containing scope 1319 scopeTyVars.beginScope(); 1320 Parent::mutate( aggDecl ); 1321 scopeTyVars.endScope(); 1322 return aggDecl; 1323 } 1324 1325 StructDecl * Pass2::mutate( StructDecl *aggDecl ) { 1326 return handleAggDecl( aggDecl ); 1327 } 1328 1329 UnionDecl * Pass2::mutate( UnionDecl *aggDecl ) { 1330 return handleAggDecl( aggDecl ); 1331 } 1332 1311 1333 TypeDecl * Pass2::mutate( TypeDecl *typeDecl ) { 1312 1334 addToTyVarMap( typeDecl, scopeTyVars ); … … 1314 1336 return handleDecl( typeDecl, typeDecl->get_base() ); 1315 1337 } else { 1316 return Mutator::mutate( typeDecl );1338 return Parent::mutate( typeDecl ); 1317 1339 } 1318 1340 } … … 1326 1348 makeTyVarMap( pointerType, scopeTyVars ); 1327 1349 1328 Type *ret = Mutator::mutate( pointerType );1350 Type *ret = Parent::mutate( pointerType ); 1329 1351 1330 1352 scopeTyVars.endScope();
Note:
See TracChangeset
for help on using the changeset viewer.