Changeset 73f1b1c


Ignore:
Timestamp:
Sep 3, 2020, 11:10:35 AM (14 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
447b0d2b
Parents:
f76ff0b
Message:

Cleaned up comments from the PureVisitor? addition.

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.hpp

    rf76ff0b r73f1b1c  
    4848//
    4949// Several additional features are available through inheritance
     50// | PureVisitor           - makes the visitor pure, it never modifies nodes in place and always
     51//                           clones nodes it needs to make changes to
    5052// | WithTypeSubstitution  - provides polymorphic const TypeSubstitution * env for the
    5153//                           current expression
     
    267269/// Keep track of the polymorphic const TypeSubstitution * env for the current expression
    268270
    269 /// marker to force shallow copies in pass visit
     271/// If used the visitor will always clone nodes.
    270272struct PureVisitor {};
    271273
  • src/AST/Pass.impl.hpp

    rf76ff0b r73f1b1c  
    2121
    2222#include "AST/TypeSubstitution.hpp"
    23 // #include "AST/Copy.hpp"
    2423
    2524#define VISIT_START( node ) \
     
    329328
    330329                if( __pass::differs(old_val, new_val) ) {
    331                         // auto new_parent = mutate(parent);
    332330                        auto new_parent = __pass::mutate<core_t>(parent);
    333331                        new_parent->*child = new_val;
  • src/AST/TypeSubstitution.hpp

    rf76ff0b r73f1b1c  
    4646        template< typename SynTreeClass >
    4747        struct ApplyResult {
    48                 // const SynTreeClass * node;
    4948                ast::ptr<SynTreeClass> node;
    5049                int count;
     
    187186        assert( input );
    188187        Pass<Substituter> sub( *this, false );
    189 //      input = strict_dynamic_cast< const SynTreeClass * >( deepCopy(input)->accept( sub ) );
    190188        input = strict_dynamic_cast< const SynTreeClass * >( input->accept( sub ) );
    191189        return { input, sub.core.subCount };
     
    196194        assert( input );
    197195        Pass<Substituter> sub( *this, true );
    198 //      input = strict_dynamic_cast< const SynTreeClass * >( deepCopy(input)->accept( sub ) );
    199196        input = strict_dynamic_cast< const SynTreeClass * >( input->accept( sub ) );
    200197        return { input, sub.core.subCount };
  • src/ResolvExpr/Unify.cc

    rf76ff0b r73f1b1c  
    11131113                        ast::Pass<TtypeExpander_new> expander{ tenv };
    11141114
    1115                         // ast::ptr<ast::TupleType> tuplec = tuple;
    1116                         // ast::ptr<ast::TupleType> tuple2c = tuple2;
    11171115                        const ast::Type * flat = tuple->accept( expander );
    11181116                        const ast::Type * flat2 = tuple2->accept( expander );
Note: See TracChangeset for help on using the changeset viewer.