Changeset 0519e34


Ignore:
Timestamp:
Sep 21, 2020, 3:22:18 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
930e57e
Parents:
a951171 (diff), b2a11ba (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

Location:
src/AST
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.hpp

    ra951171 r0519e34  
    5050// | PureVisitor           - makes the visitor pure, it never modifies nodes in place and always
    5151//                           clones nodes it needs to make changes to
    52 // | WithTypeSubstitution  - provides polymorphic const TypeSubstitution * env for the
     52// | WithConstTypeSubstitution - provides polymorphic const TypeSubstitution * typeSubs for the
    5353//                           current expression
    5454// | WithStmtsToAdd        - provides the ability to insert statements before or after the current
     
    294294//-------------------------------------------------------------------------------------------------
    295295
    296 /// Keep track of the polymorphic const TypeSubstitution * env for the current expression
    297 
    298296/// If used the visitor will always clone nodes.
    299297struct PureVisitor {};
    300298
     299/// Keep track of the polymorphic const TypeSubstitution * typeSubs for the current expression.
    301300struct WithConstTypeSubstitution {
    302         const TypeSubstitution * env = nullptr;
     301        const TypeSubstitution * typeSubs = nullptr;
    303302};
    304303
  • src/AST/Pass.impl.hpp

    ra951171 r0519e34  
    154154                __pedantic_pass_assert( expr );
    155155
    156                 const ast::TypeSubstitution ** env_ptr = __pass::env( core, 0);
    157                 if ( env_ptr && expr->env ) {
    158                         *env_ptr = expr->env;
     156                const ast::TypeSubstitution ** typeSubs_ptr = __pass::typeSubs( core, 0 );
     157                if ( typeSubs_ptr && expr->env ) {
     158                        *typeSubs_ptr = expr->env;
    159159                }
    160160
     
    177177
    178178                // These may be modified by subnode but most be restored once we exit this statemnet.
    179                 ValueGuardPtr< const ast::TypeSubstitution * > __old_env         ( __pass::env( core, 0) );
     179                ValueGuardPtr< const ast::TypeSubstitution * > __old_env         ( __pass::typeSubs( core, 0 ) );
    180180                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before );
    181181                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after  );
     
    14881488
    14891489                // These may be modified by subnode but most be restored once we exit this statemnet.
    1490                 ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::env( core, 0) );
     1490                ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::typeSubs( core, 0 ) );
    14911491                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before );
    14921492                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after  );
  • src/AST/Pass.proto.hpp

    ra951171 r0519e34  
    236236
    237237        // List of fields and their expected types
    238         FIELD_PTR( env, const ast::TypeSubstitution * )
     238        FIELD_PTR( typeSubs, const ast::TypeSubstitution * )
    239239        FIELD_PTR( stmtsToAddBefore, std::list< ast::ptr< ast::Stmt > > )
    240240        FIELD_PTR( stmtsToAddAfter , std::list< ast::ptr< ast::Stmt > > )
Note: See TracChangeset for help on using the changeset viewer.