Changeset 2a7b3ca for src/Common


Ignore:
Timestamp:
Jun 26, 2017, 4:13:36 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
579263a, 949934e
Parents:
d24d4e1
Message:

convert InstantiateGeneric to PassVisitor, add missing mutate and accept calls to PassVisitor, add missing ValueGuardPtrs to PassVisitor::handleStatementList

Location:
src/Common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.h

    rd24d4e1 r2a7b3ca  
    1212#include "SynTree/Expression.h"
    1313#include "SynTree/Constant.h"
     14#include "SynTree/TypeSubstitution.h"
    1415
    1516#include "PassVisitor.proto.h"
  • src/Common/PassVisitor.impl.h

    rd24d4e1 r2a7b3ca  
    105105        SemanticError errors;
    106106
     107        // don't want statements from outer CompoundStmts to be added to this CompoundStmt
     108        ValueGuardPtr< StmtList_t > oldBeforeStmts( get_beforeStmts() );
     109        ValueGuardPtr< StmtList_t > oldAfterStmts ( get_afterStmts () );
     110        ValueGuardPtr< DeclList_t > oldBeforeDecls( get_beforeDecls() );
     111        ValueGuardPtr< DeclList_t > oldAfterDecls ( get_afterDecls () );
     112
    107113        StmtList_t* beforeStmts = get_beforeStmts();
    108114        StmtList_t* afterStmts  = get_afterStmts();
     
    565571        VISIT_START( node );
    566572
     573        // maybeAccept( node->get_env(), *this );
     574        maybeAccept( node->get_result(), *this );
     575
    567576        for ( auto expr : node->get_args() ) {
    568577                visitExpression( expr );
     
    575584Expression * PassVisitor< pass_type >::mutate( UntypedExpr * node ) {
    576585        MUTATE_START( node );
     586
     587        node->set_env( maybeMutate( node->get_env(), *this ) );
     588        node->set_result( maybeMutate( node->get_result(), *this ) );
    577589
    578590        for ( auto& expr : node->get_args() ) {
  • src/Common/PassVisitor.proto.h

    rd24d4e1 r2a7b3ca  
    5656// Deep magic (a.k.a template meta programming) to make the templated visitor work
    5757// Basically the goal is to make 2 previsit_impl
    58 // 1 - Use when a pass implements a valid previsit. This uses overloading which means the any overload of 
     58// 1 - Use when a pass implements a valid previsit. This uses overloading which means the any overload of
    5959//     'pass.previsit( node )' that compiles will be used for that node for that type
    6060//     This requires that this option only compile for passes that actually define an appropriate visit.
Note: See TracChangeset for help on using the changeset viewer.