Changes in src/Common/PassVisitor.proto.h [4990812:e67991f]
- File:
-
- 1 edited
-
src/Common/PassVisitor.proto.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.proto.h
r4990812 re67991f 118 118 static inline void postvisit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) node_type * node, __attribute__((unused)) long unused ) {} 119 119 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 120 137 //--------------------------------------------------------- 121 138 // Mutate … … 165 182 static inline type * name##_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) long unused ) { return nullptr;} \ 166 183 167 FIELD_PTR( TypeSubstitution *, env )184 FIELD_PTR( const TypeSubstitution *, env ) 168 185 FIELD_PTR( std::list< Statement* >, stmtsToAddBefore ) 169 186 FIELD_PTR( std::list< Statement* >, stmtsToAddAfter ) … … 174 191 FIELD_PTR( PassVisitor<pass_type> * const, visitor ) 175 192 193 #undef FIELD_PTR 194 176 195 //--------------------------------------------------------- 177 196 // Indexer … … 198 217 pass.indexer.func( arg ); \ 199 218 } \ 200 \ 201 template<typename pass_type> \ 202 static inline void indexer_impl_##func ( pass_type &, long, type ) { } \ 219 template<typename pass_type> \ 220 static inline void indexer_impl_##func ( pass_type &, long, type ) { } 203 221 204 222 #define INDEXER_FUNC2( func, type1, type2 ) \ … … 207 225 pass.indexer.func( arg1, arg2 ); \ 208 226 } \ 209 \210 227 template<typename pass_type> \ 211 228 static inline void indexer_impl_##func ( pass_type &, long, type1, type2 ) { } 212 229 213 230 214 INDEXER_FUNC1( addId , DeclarationWithType * ); 215 INDEXER_FUNC1( addType , NamedTypeDecl * ); 216 INDEXER_FUNC1( addStruct , StructDecl * ); 217 INDEXER_FUNC1( addEnum , EnumDecl * ); 218 INDEXER_FUNC1( addUnion , UnionDecl * ); 219 INDEXER_FUNC1( addTrait , TraitDecl * ); 220 INDEXER_FUNC2( addWith , std::list< Expression * > &, BaseSyntaxNode * ); 221 222 223 template<typename pass_type> 224 static inline auto indexer_impl_addStructFwd( pass_type & pass, int, StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) { 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() ) { 225 244 StructDecl * fwd = new StructDecl( decl->name ); 226 245 cloneAll( decl->parameters, fwd->parameters ); … … 229 248 230 249 template<typename pass_type> 231 static inline auto indexer_impl_addStructFwd( pass_type &, long, StructDecl * ) {}232 233 template<typename pass_type> 234 static inline auto indexer_impl_addUnionFwd( pass_type & pass, int, UnionDecl * decl ) -> decltype( pass.indexer.addUnion( decl ), void() ) {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() ) { 235 254 UnionDecl * fwd = new UnionDecl( decl->name ); 236 255 cloneAll( decl->parameters, fwd->parameters ); … … 239 258 240 259 template<typename pass_type> 241 static inline auto indexer_impl_addUnionFwd( pass_type &, long, UnionDecl * ) {}260 static inline auto indexer_impl_addUnionFwd( pass_type &, long, const UnionDecl * ) {} 242 261 243 262 template<typename pass_type>
Note:
See TracChangeset
for help on using the changeset viewer.