Changeset f53acdf8 for src/Common/PassVisitor.proto.h
- Timestamp:
- Jul 19, 2019, 2:16:01 PM (6 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.proto.h
r1f1c102 rf53acdf8 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 … … 200 217 pass.indexer.func( arg ); \ 201 218 } \ 202 \ 203 template<typename pass_type> \ 204 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 ) { } 205 221 206 222 #define INDEXER_FUNC2( func, type1, type2 ) \ … … 209 225 pass.indexer.func( arg1, arg2 ); \ 210 226 } \ 211 \212 227 template<typename pass_type> \ 213 228 static inline void indexer_impl_##func ( pass_type &, long, type1, type2 ) { } 214 229 215 230 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* );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 * ); 223 238 224 239 #undef INDEXER_FUNC1 … … 226 241 227 242 template<typename pass_type> 228 static inline auto indexer_impl_addStructFwd( pass_type & pass, int, StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) {243 static inline auto indexer_impl_addStructFwd( pass_type & pass, int, const StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) { 229 244 StructDecl * fwd = new StructDecl( decl->name ); 230 245 cloneAll( decl->parameters, fwd->parameters ); … … 233 248 234 249 template<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() ) {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() ) { 239 254 UnionDecl * fwd = new UnionDecl( decl->name ); 240 255 cloneAll( decl->parameters, fwd->parameters ); … … 243 258 244 259 template<typename pass_type> 245 static inline auto indexer_impl_addUnionFwd( pass_type &, long, UnionDecl * ) {}260 static inline auto indexer_impl_addUnionFwd( pass_type &, long, const UnionDecl * ) {} 246 261 247 262 template<typename pass_type>
Note:
See TracChangeset
for help on using the changeset viewer.