Changeset 17fc7a5


Ignore:
Timestamp:
Feb 26, 2018, 11:03:13 AM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
45c43e5
Parents:
df7a162
Message:

Expand VISIT/MUTATE_BODY for BasicType?, PointerType?, ArrayType?, ReferenceType?, FunctionType?

File:
1 edited

Legend:

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

    rdf7a162 r17fc7a5  
    20132013}
    20142014
    2015 
     2015//--------------------------------------------------------------------------
     2016// VoidType
    20162017template< typename pass_type >
    20172018void PassVisitor< pass_type >::visit( VoidType * node ) {
     
    20322033}
    20332034
     2035//--------------------------------------------------------------------------
     2036// BasicType
    20342037template< typename pass_type >
    20352038void PassVisitor< pass_type >::visit( BasicType * node ) {
    2036         VISIT_BODY( node );
    2037 }
    2038 
     2039        VISIT_START( node );
     2040
     2041        maybeAccept_impl( node->forall, *this );
     2042
     2043        VISIT_END( node );
     2044}
     2045
     2046template< typename pass_type >
     2047Type * PassVisitor< pass_type >::mutate( BasicType * node ) {
     2048        MUTATE_START( node );
     2049
     2050        maybeMutate_impl( node->forall, *this );
     2051
     2052        MUTATE_END( Type, node );
     2053}
     2054
     2055//--------------------------------------------------------------------------
     2056// PointerType
    20392057template< typename pass_type >
    20402058void PassVisitor< pass_type >::visit( PointerType * node ) {
    2041         VISIT_BODY( node );
    2042 }
    2043 
     2059        VISIT_START( node );
     2060
     2061        maybeAccept_impl( node->forall, *this );
     2062        maybeAccept_impl( node->base, *this );
     2063
     2064        VISIT_END( node );
     2065}
     2066
     2067template< typename pass_type >
     2068Type * PassVisitor< pass_type >::mutate( PointerType * node ) {
     2069        MUTATE_START( node );
     2070
     2071        maybeMutate_impl( node->forall, *this );
     2072        maybeMutate_impl( node->base, *this );
     2073
     2074        MUTATE_END( Type, node );
     2075}
     2076
     2077//--------------------------------------------------------------------------
     2078// ArrayType
    20442079template< typename pass_type >
    20452080void PassVisitor< pass_type >::visit( ArrayType * node ) {
    2046         VISIT_BODY( node );
    2047 }
    2048 
     2081        VISIT_START( node );
     2082
     2083        maybeAccept_impl( node->forall, *this );
     2084        maybeAccept_impl( node->dimension, *this );
     2085        maybeAccept_impl( node->base, *this );
     2086
     2087        VISIT_END( node );
     2088}
     2089
     2090template< typename pass_type >
     2091Type * PassVisitor< pass_type >::mutate( ArrayType * node ) {
     2092        MUTATE_START( node );
     2093
     2094        maybeMutate_impl( node->forall, *this );
     2095        maybeMutate_impl( node->dimension, *this );
     2096        maybeMutate_impl( node->base, *this );
     2097
     2098        MUTATE_END( Type, node );
     2099}
     2100
     2101//--------------------------------------------------------------------------
     2102// ReferenceType
    20492103template< typename pass_type >
    20502104void PassVisitor< pass_type >::visit( ReferenceType * node ) {
    2051         VISIT_BODY( node );
    2052 }
    2053 
     2105        VISIT_START( node );
     2106
     2107        maybeAccept_impl( node->forall, *this );
     2108        maybeAccept_impl( node->base, *this );
     2109
     2110        VISIT_END( node );
     2111}
     2112
     2113template< typename pass_type >
     2114Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) {
     2115        MUTATE_START( node );
     2116
     2117        maybeMutate_impl( node->forall, *this );
     2118        maybeMutate_impl( node->base, *this );
     2119
     2120        MUTATE_END( Type, node );
     2121}
     2122
     2123//--------------------------------------------------------------------------
     2124// FunctionType
    20542125template< typename pass_type >
    20552126void PassVisitor< pass_type >::visit( FunctionType * node ) {
    2056         VISIT_BODY( node );
     2127        VISIT_START( node );
     2128
     2129        maybeAccept_impl( node->forall, *this );
     2130        maybeAccept_impl( node->returnVals, *this );
     2131        maybeAccept_impl( node->parameters, *this );
     2132
     2133        VISIT_END( node );
     2134}
     2135
     2136template< typename pass_type >
     2137Type * PassVisitor< pass_type >::mutate( FunctionType * node ) {
     2138        MUTATE_START( node );
     2139
     2140        maybeMutate_impl( node->forall, *this );
     2141        maybeMutate_impl( node->returnVals, *this );
     2142        maybeMutate_impl( node->parameters, *this );
     2143
     2144        MUTATE_END( Type, node );
    20572145}
    20582146
     
    22582346
    22592347template< typename pass_type >
    2260 Type * PassVisitor< pass_type >::mutate( BasicType * node ) {
    2261         MUTATE_BODY( Type, node );
    2262 }
    2263 
    2264 template< typename pass_type >
    2265 Type * PassVisitor< pass_type >::mutate( PointerType * node ) {
    2266         MUTATE_BODY( Type, node );
    2267 }
    2268 
    2269 template< typename pass_type >
    2270 Type * PassVisitor< pass_type >::mutate( ArrayType * node ) {
    2271         MUTATE_BODY( Type, node );
    2272 }
    2273 
    2274 template< typename pass_type >
    2275 Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) {
    2276         MUTATE_BODY( Type, node );
    2277 }
    2278 
    2279 template< typename pass_type >
    2280 Type * PassVisitor< pass_type >::mutate( FunctionType * node ) {
    2281         MUTATE_BODY( Type, node );
    2282 }
    2283 
    2284 template< typename pass_type >
    22852348Type * PassVisitor< pass_type >::mutate( TypeInstType * node ) {
    22862349        MUTATE_BODY( Type, node );
Note: See TracChangeset for help on using the changeset viewer.