Changeset caa649b for src/Tuples


Ignore:
Timestamp:
Mar 6, 2018, 12:11:11 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
520145b, e5d4e5c, e6c5e79
Parents:
094476d (diff), 1feb535f (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/Tuples/TupleAssignment.cc

    r094476d rcaa649b  
    281281        }
    282282
    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
    284284        // 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 compositeEnv
    286285        struct EnvRemover {
    287286                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;
    291296        };
    292297
     
    300305                        ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object
    301306                        PassVisitor<EnvRemover> rm; // remove environments from subexpressions of StmtExprs
     307                        rm.pass.compositeEnv = &compositeEnv;
    302308                        ctorInit->accept( rm );
    303309                }
Note: See TracChangeset for help on using the changeset viewer.