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