Ignore:
Timestamp:
Jul 19, 2019, 2:16:01 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
4eb43fa
Parents:
1f1c102 (diff), 8ac3b0e (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' into new-ast

File:
1 edited

Legend:

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

    r1f1c102 rf53acdf8  
    118118static inline void postvisit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) node_type * node, __attribute__((unused)) long unused ) {}
    119119
     120template<typename pass_type, typename node_type>
     121static 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
     125template<typename pass_type, typename node_type>
     126static inline void previsit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) const node_type * node, __attribute__((unused)) long unused ) {}
     127
     128
     129template<typename pass_type, typename node_type>
     130static 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
     134template<typename pass_type, typename node_type>
     135static inline void postvisit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) const node_type * node, __attribute__((unused)) long unused ) {}
     136
    120137//---------------------------------------------------------
    121138// Mutate
     
    200217        pass.indexer.func( arg );                                                                                                \
    201218}                                                                                                                              \
    202                                                                                                                                \
    203 template<typename pass_type>                                                                                                   \
    204 static inline void indexer_impl_##func ( pass_type &, long, type ) { }                                                          \
     219template<typename pass_type>                                                                                                   \
     220static inline void indexer_impl_##func ( pass_type &, long, type ) { }
    205221
    206222#define INDEXER_FUNC2( func, type1, type2 )                                                                                             \
     
    209225        pass.indexer.func( arg1, arg2 );                                                                                                \
    210226}                                                                                                                              \
    211                                                                                                                                \
    212227template<typename pass_type>                                                                                                   \
    213228static inline void indexer_impl_##func ( pass_type &, long, type1, type2 ) { }
    214229
    215230
    216 INDEXER_FUNC1( addId     , DeclarationWithType *       );
    217 INDEXER_FUNC1( addType   , NamedTypeDecl *             );
    218 INDEXER_FUNC1( addStruct , StructDecl *                );
    219 INDEXER_FUNC1( addEnum   , EnumDecl *                  );
    220 INDEXER_FUNC1( addUnion  , UnionDecl *                 );
    221 INDEXER_FUNC1( addTrait  , TraitDecl *                 );
    222 INDEXER_FUNC2( addWith   , std::list< Expression * > &, BaseSyntaxNode * );
     231INDEXER_FUNC1( addId     , const DeclarationWithType *       );
     232INDEXER_FUNC1( addType   , const NamedTypeDecl *             );
     233INDEXER_FUNC1( addStruct , const StructDecl *                );
     234INDEXER_FUNC1( addEnum   , const EnumDecl *                  );
     235INDEXER_FUNC1( addUnion  , const UnionDecl *                 );
     236INDEXER_FUNC1( addTrait  , const TraitDecl *                 );
     237INDEXER_FUNC2( addWith   , const std::list< Expression * > &, const Declaration * );
    223238
    224239#undef INDEXER_FUNC1
     
    226241
    227242template<typename pass_type>
    228 static inline auto indexer_impl_addStructFwd( pass_type & pass, int, StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) {
     243static inline auto indexer_impl_addStructFwd( pass_type & pass, int, const StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) {
    229244        StructDecl * fwd = new StructDecl( decl->name );
    230245        cloneAll( decl->parameters, fwd->parameters );
     
    233248
    234249template<typename pass_type>
    235 static inline auto indexer_impl_addStructFwd( pass_type &, long, StructDecl * ) {}
    236 
    237 template<typename pass_type>
    238 static inline auto indexer_impl_addUnionFwd( pass_type & pass, int, UnionDecl * decl ) -> decltype( pass.indexer.addUnion( decl ), void() ) {
     250static inline auto indexer_impl_addStructFwd( pass_type &, long, const StructDecl * ) {}
     251
     252template<typename pass_type>
     253static inline auto indexer_impl_addUnionFwd( pass_type & pass, int, const UnionDecl * decl ) -> decltype( pass.indexer.addUnion( decl ), void() ) {
    239254        UnionDecl * fwd = new UnionDecl( decl->name );
    240255        cloneAll( decl->parameters, fwd->parameters );
     
    243258
    244259template<typename pass_type>
    245 static inline auto indexer_impl_addUnionFwd( pass_type &, long, UnionDecl * ) {}
     260static inline auto indexer_impl_addUnionFwd( pass_type &, long, const UnionDecl * ) {}
    246261
    247262template<typename pass_type>
Note: See TracChangeset for help on using the changeset viewer.