Changeset 2449aef


Ignore:
Timestamp:
Dec 1, 2017, 10:37:19 AM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
82f3226
Parents:
027c496
Message:

Convert EnvRemover? to PassVisitor?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleAssignment.cc

    r027c496 r2449aef  
    2323
    2424#include "CodeGen/OperatorTable.h"
     25#include "Common/PassVisitor.h"
    2526#include "Common/UniqueName.h"             // for UniqueName
    2627#include "Common/utility.h"                // for zipWith
     
    277278        // xxx - maybe this should happen in alternative finder for every StmtExpr?
    278279        // 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
    279         struct EnvRemover : public Visitor {
    280                 virtual void visit( ExprStmt * stmt ) {
    281                         delete stmt->get_expr()->get_env();
    282                         stmt->get_expr()->set_env( nullptr );
    283                         Visitor::visit( stmt );
     280        struct EnvRemover {
     281                void previsit( ExprStmt * stmt ) {
     282                        delete stmt->expr->env;
     283                        stmt->expr->env = nullptr;
    284284                }
    285285        };
     
    293293                        ret->set_init( ctorInit );
    294294                        ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object
    295                         EnvRemover rm; // remove environments from subexpressions of StmtExprs
     295                        PassVisitor<EnvRemover> rm; // remove environments from subexpressions of StmtExprs
    296296                        ctorInit->accept( rm );
    297297                }
Note: See TracChangeset for help on using the changeset viewer.