Changeset 6e50a6b for src/Common


Ignore:
Timestamp:
Jun 18, 2021, 12:20:59 PM (4 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c7d8696a
Parents:
dcbfcbc
Message:

Implementing language-provided syntax for (array) dimensions.

Former z(i) and Z(N) macros are eliminated.

Location:
src/Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.h

    rdcbfcbc r6e50a6b  
    167167        virtual void visit( TypeExpr * typeExpr ) override final;
    168168        virtual void visit( const TypeExpr * typeExpr ) override final;
     169        virtual void visit( DimensionExpr * dimensionExpr ) override final;
     170        virtual void visit( const DimensionExpr * dimensionExpr ) override final;
    169171        virtual void visit( AsmExpr * asmExpr ) override final;
    170172        virtual void visit( const AsmExpr * asmExpr ) override final;
     
    309311        virtual Expression * mutate( CommaExpr * commaExpr ) override final;
    310312        virtual Expression * mutate( TypeExpr * typeExpr ) override final;
     313        virtual Expression * mutate( DimensionExpr * dimensionExpr ) override final;
    311314        virtual Expression * mutate( AsmExpr * asmExpr ) override final;
    312315        virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) override final;
     
    542545class WithIndexer {
    543546protected:
    544         WithIndexer() {}
     547        WithIndexer( bool trackIdentifiers = true ) : indexer(trackIdentifiers) {}
    545548        ~WithIndexer() {}
    546549
  • src/Common/PassVisitor.impl.h

    rdcbfcbc r6e50a6b  
    25192519
    25202520//--------------------------------------------------------------------------
     2521// DimensionExpr
     2522template< typename pass_type >
     2523void PassVisitor< pass_type >::visit( DimensionExpr * node ) {
     2524        VISIT_START( node );
     2525
     2526        indexerScopedAccept( node->result, *this );
     2527
     2528        VISIT_END( node );
     2529}
     2530
     2531template< typename pass_type >
     2532void PassVisitor< pass_type >::visit( const DimensionExpr * node ) {
     2533        VISIT_START( node );
     2534
     2535        indexerScopedAccept( node->result, *this );
     2536
     2537        VISIT_END( node );
     2538}
     2539
     2540template< typename pass_type >
     2541Expression * PassVisitor< pass_type >::mutate( DimensionExpr * node ) {
     2542        MUTATE_START( node );
     2543
     2544        indexerScopedMutate( node->env   , *this );
     2545        indexerScopedMutate( node->result, *this );
     2546
     2547        MUTATE_END( Expression, node );
     2548}
     2549
     2550//--------------------------------------------------------------------------
    25212551// AsmExpr
    25222552template< typename pass_type >
     
    31573187
    31583188        maybeAccept_impl( node->forall, *this );
    3159         // xxx - should PointerType visit/mutate dimension?
     3189        maybeAccept_impl( node->dimension, *this );
    31603190        maybeAccept_impl( node->base, *this );
    31613191
     
    31683198
    31693199        maybeAccept_impl( node->forall, *this );
    3170         // xxx - should PointerType visit/mutate dimension?
     3200        maybeAccept_impl( node->dimension, *this );
    31713201        maybeAccept_impl( node->base, *this );
    31723202
     
    31793209
    31803210        maybeMutate_impl( node->forall, *this );
    3181         // xxx - should PointerType visit/mutate dimension?
     3211        maybeMutate_impl( node->dimension, *this );
    31823212        maybeMutate_impl( node->base, *this );
    31833213
Note: See TracChangeset for help on using the changeset viewer.