Ignore:
Timestamp:
Aug 13, 2021, 3:58:19 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
de52331
Parents:
c9f9d4f
Message:

added mutex stmt monitor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.impl.h

    rc9f9d4f r6cebfef  
    17811781
    17821782//--------------------------------------------------------------------------
     1783// MutexStmt
     1784template< typename pass_type >
     1785void PassVisitor< pass_type >::visit( MutexStmt * node ) {
     1786        VISIT_START( node );
     1787        // mutex statements introduce a level of scope (for the initialization)
     1788        maybeAccept_impl( node->mutexObjs, *this );
     1789        {
     1790                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     1791                node->stmt = visitStatement( node->stmt );
     1792        }
     1793        VISIT_END( node );
     1794}
     1795
     1796template< typename pass_type >
     1797void PassVisitor< pass_type >::visit( const MutexStmt * node ) {
     1798        VISIT_START( node );
     1799        maybeAccept_impl( node->mutexObjs, *this );
     1800        {
     1801                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     1802                visitStatement( node->stmt );
     1803        }
     1804        VISIT_END( node );
     1805}
     1806
     1807template< typename pass_type >
     1808Statement * PassVisitor< pass_type >::mutate( MutexStmt * node ) {
     1809        MUTATE_START( node );
     1810        maybeMutate_impl( node->mutexObjs, *this );
     1811        {
     1812                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     1813                node->stmt = mutateStatement( node->stmt );
     1814        }
     1815        MUTATE_END( Statement, node );
     1816}
     1817
     1818//--------------------------------------------------------------------------
    17831819// ApplicationExpr
    17841820template< typename pass_type >
Note: See TracChangeset for help on using the changeset viewer.