Ignore:
File:
1 edited

Legend:

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

    re67991f r4990812  
    118118static inline void postvisit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) node_type * node, __attribute__((unused)) long unused ) {}
    119119
    120 template<typename pass_type, typename node_type>
    121 static inline auto previsit_impl( pass_type& pass, const node_type * node, __attribute__((unused)) int unused ) -> decltype( pass.previsit( node ), void() ) {
    122         pass.previsit( node );
    123 }
    124 
    125 template<typename pass_type, typename node_type>
    126 static inline void previsit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) const node_type * node, __attribute__((unused)) long unused ) {}
    127 
    128 
    129 template<typename pass_type, typename node_type>
    130 static inline auto postvisit_impl( pass_type& pass, const node_type * node, __attribute__((unused)) int unused ) -> decltype( pass.postvisit( node ), void() ) {
    131         pass.postvisit( node );
    132 }
    133 
    134 template<typename pass_type, typename node_type>
    135 static inline void postvisit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) const node_type * node, __attribute__((unused)) long unused ) {}
    136 
    137120//---------------------------------------------------------
    138121// Mutate
     
    182165static inline type * name##_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) long unused ) { return nullptr;}    \
    183166
    184 FIELD_PTR( const TypeSubstitution *, env )
     167FIELD_PTR( TypeSubstitution *, env )
    185168FIELD_PTR( std::list< Statement* >, stmtsToAddBefore )
    186169FIELD_PTR( std::list< Statement* >, stmtsToAddAfter  )
     
    191174FIELD_PTR( PassVisitor<pass_type> * const, visitor )
    192175
    193 #undef FIELD_PTR
    194 
    195176//---------------------------------------------------------
    196177// Indexer
     
    217198        pass.indexer.func( arg );                                                                                                \
    218199}                                                                                                                              \
    219 template<typename pass_type>                                                                                                   \
    220 static inline void indexer_impl_##func ( pass_type &, long, type ) { }
     200                                                                                                                               \
     201template<typename pass_type>                                                                                                   \
     202static inline void indexer_impl_##func ( pass_type &, long, type ) { }                                                          \
    221203
    222204#define INDEXER_FUNC2( func, type1, type2 )                                                                                             \
     
    225207        pass.indexer.func( arg1, arg2 );                                                                                                \
    226208}                                                                                                                              \
     209                                                                                                                               \
    227210template<typename pass_type>                                                                                                   \
    228211static inline void indexer_impl_##func ( pass_type &, long, type1, type2 ) { }
    229212
    230213
    231 INDEXER_FUNC1( addId     , const DeclarationWithType *       );
    232 INDEXER_FUNC1( addType   , const NamedTypeDecl *             );
    233 INDEXER_FUNC1( addStruct , const StructDecl *                );
    234 INDEXER_FUNC1( addEnum   , const EnumDecl *                  );
    235 INDEXER_FUNC1( addUnion  , const UnionDecl *                 );
    236 INDEXER_FUNC1( addTrait  , const TraitDecl *                 );
    237 INDEXER_FUNC2( addWith   , const std::list< Expression * > &, const Declaration * );
    238 
    239 #undef INDEXER_FUNC1
    240 #undef INDEXER_FUNC2
    241 
    242 template<typename pass_type>
    243 static inline auto indexer_impl_addStructFwd( pass_type & pass, int, const StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) {
     214INDEXER_FUNC1( addId     , DeclarationWithType *       );
     215INDEXER_FUNC1( addType   , NamedTypeDecl *             );
     216INDEXER_FUNC1( addStruct , StructDecl *                );
     217INDEXER_FUNC1( addEnum   , EnumDecl *                  );
     218INDEXER_FUNC1( addUnion  , UnionDecl *                 );
     219INDEXER_FUNC1( addTrait  , TraitDecl *                 );
     220INDEXER_FUNC2( addWith   , std::list< Expression * > &, BaseSyntaxNode * );
     221
     222
     223template<typename pass_type>
     224static inline auto indexer_impl_addStructFwd( pass_type & pass, int, StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) {
    244225        StructDecl * fwd = new StructDecl( decl->name );
    245226        cloneAll( decl->parameters, fwd->parameters );
     
    248229
    249230template<typename pass_type>
    250 static inline auto indexer_impl_addStructFwd( pass_type &, long, const StructDecl * ) {}
    251 
    252 template<typename pass_type>
    253 static inline auto indexer_impl_addUnionFwd( pass_type & pass, int, const UnionDecl * decl ) -> decltype( pass.indexer.addUnion( decl ), void() ) {
     231static inline auto indexer_impl_addStructFwd( pass_type &, long, StructDecl * ) {}
     232
     233template<typename pass_type>
     234static inline auto indexer_impl_addUnionFwd( pass_type & pass, int, UnionDecl * decl ) -> decltype( pass.indexer.addUnion( decl ), void() ) {
    254235        UnionDecl * fwd = new UnionDecl( decl->name );
    255236        cloneAll( decl->parameters, fwd->parameters );
     
    258239
    259240template<typename pass_type>
    260 static inline auto indexer_impl_addUnionFwd( pass_type &, long, const UnionDecl * ) {}
     241static inline auto indexer_impl_addUnionFwd( pass_type &, long, UnionDecl * ) {}
    261242
    262243template<typename pass_type>
Note: See TracChangeset for help on using the changeset viewer.