Changeset 938dd75
- Timestamp:
- Mar 2, 2018, 5:34:52 PM (7 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:
- 000ff2c
- Parents:
- b8baa37
- git-author:
- Rob Schluntz <rschlunt@…> (03/02/18 17:22:17)
- git-committer:
- Rob Schluntz <rschlunt@…> (03/02/18 17:34:52)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleAssignment.cc
rb8baa37 r938dd75 281 281 } 282 282 283 // removes environments from subexpressions within statement exprs, which could throw off later passes like those in Box which rely on PolyMutator .283 // removes environments from subexpressions within statement exprs, which could throw off later passes like those in Box which rely on PolyMutator, and adds the bindings to the compositeEnv 284 284 // xxx - maybe this should happen in alternative finder for every StmtExpr? 285 // xxx - it's possible that these environments could contain some useful information. Maybe the right thing to do is aggregate the environments and pass the aggregate back to be added into the compositeEnv286 285 struct EnvRemover { 287 286 void previsit( ExprStmt * stmt ) { 288 delete stmt->expr->env; 289 stmt->expr->env = nullptr; 290 } 287 assert( compositeEnv ); 288 if ( stmt->expr->env ) { 289 compositeEnv->add( *stmt->expr->env ); 290 delete stmt->expr->env; 291 stmt->expr->env = nullptr; 292 } 293 } 294 295 ResolvExpr::TypeEnvironment * compositeEnv = nullptr; 291 296 }; 292 297 … … 300 305 ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object 301 306 PassVisitor<EnvRemover> rm; // remove environments from subexpressions of StmtExprs 307 rm.pass.compositeEnv = &compositeEnv; 302 308 ctorInit->accept( rm ); 303 309 }
Note: See TracChangeset
for help on using the changeset viewer.