Changes in src/AST/Pass.proto.hpp [6d51bd7:04124c4]
- File:
-
- 1 edited
-
src/AST/Pass.proto.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.proto.hpp
r6d51bd7 r04124c4 162 162 163 163 // List of fields and their expected types 164 FIELD_PTR( env, const ast::TypeSubstitution *)164 FIELD_PTR( env, const ast::TypeSubstitution ) 165 165 FIELD_PTR( stmtsToAddBefore, std::list< ast::ptr< ast::Stmt > > ) 166 166 FIELD_PTR( stmtsToAddAfter , std::list< ast::ptr< ast::Stmt > > ) … … 235 235 static inline void func( pass_t &, long, type1, type2 ) {} 236 236 237 INDEXER_FUNC1( addId , constDeclWithType * );238 INDEXER_FUNC1( addType , constNamedTypeDecl * );239 INDEXER_FUNC1( addStruct , constStructDecl * );240 INDEXER_FUNC1( addEnum , constEnumDecl * );241 INDEXER_FUNC1( addUnion , constUnionDecl * );242 INDEXER_FUNC1( addTrait , constTraitDecl * );243 INDEXER_FUNC2( addWith , const std::list< Expression * > &, constNode * );237 INDEXER_FUNC1( addId , DeclWithType * ); 238 INDEXER_FUNC1( addType , NamedTypeDecl * ); 239 INDEXER_FUNC1( addStruct , StructDecl * ); 240 INDEXER_FUNC1( addEnum , EnumDecl * ); 241 INDEXER_FUNC1( addUnion , UnionDecl * ); 242 INDEXER_FUNC1( addTrait , TraitDecl * ); 243 INDEXER_FUNC2( addWith , std::list< Expression * > &, Node * ); 244 244 245 245 // A few extra functions have more complicated behaviour, they are hand written 246 template<typename pass_t>247 static inline auto addStructFwd( pass_t & pass, int, constast::StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) {248 ast::StructDecl * fwd = new ast::StructDecl( decl->location, decl->name );249 fwd->parameters = decl->parameters;250 pass.indexer.addStruct( fwd );251 }252 253 template<typename pass_t>254 static inline void addStructFwd( pass_t &, long, constast::StructDecl * ) {}255 256 template<typename pass_t>257 static inline auto addUnionFwd( pass_t & pass, int, constast::UnionDecl * decl ) -> decltype( pass.indexer.addUnion( decl ), void() ) {258 UnionDecl * fwd = new UnionDecl( decl->location,decl->name );259 fwd->parameters = decl->parameters;260 pass.indexer.addUnion( fwd );261 }262 263 template<typename pass_t>264 static inline void addUnionFwd( pass_t &, long, constast::UnionDecl * ) {}265 266 template<typename pass_t>267 static inline auto addStruct( pass_t & pass, int, const std::string & str ) -> decltype( pass.indexer.addStruct( str ), void() ) {268 if ( ! pass.indexer.lookupStruct( str ) ) {269 pass.indexer.addStruct( str );270 }271 }272 273 template<typename pass_t>274 static inline void addStruct( pass_t &, long, const std::string & ) {}275 276 template<typename pass_t>277 static inline auto addUnion( pass_t & pass, int, const std::string & str ) -> decltype( pass.indexer.addUnion( str ), void() ) {278 if ( ! pass.indexer.lookupUnion( str ) ) {279 pass.indexer.addUnion( str );280 }281 }282 283 template<typename pass_t>284 static inline void addUnion( pass_t &, long, const std::string & ) {}246 // template<typename pass_t> 247 // static inline auto addStructFwd( pass_t & pass, int, ast::StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) { 248 // ast::StructDecl * fwd = new ast::StructDecl( decl->location, decl->name ); 249 // fwd->parameters = decl->parameters; 250 // pass.indexer.addStruct( fwd ); 251 // } 252 253 // template<typename pass_t> 254 // static inline void addStructFwd( pass_t &, long, ast::StructDecl * ) {} 255 256 // template<typename pass_t> 257 // static inline auto addUnionFwd( pass_t & pass, int, ast::UnionDecl * decl ) -> decltype( pass.indexer.addUnion( decl ), void() ) { 258 // UnionDecl * fwd = new UnionDecl( decl->name ); 259 // fwd->parameters = decl->parameters; 260 // pass.indexer.addUnion( fwd ); 261 // } 262 263 // template<typename pass_t> 264 // static inline void addUnionFwd( pass_t &, long, ast::UnionDecl * ) {} 265 266 // template<typename pass_t> 267 // static inline auto addStruct( pass_t & pass, int, const std::string & str ) -> decltype( pass.indexer.addStruct( str ), void() ) { 268 // if ( ! pass.indexer.lookupStruct( str ) ) { 269 // pass.indexer.addStruct( str ); 270 // } 271 // } 272 273 // template<typename pass_t> 274 // static inline void addStruct( pass_t &, long, const std::string & ) {} 275 276 // template<typename pass_t> 277 // static inline auto addUnion( pass_t & pass, int, const std::string & str ) -> decltype( pass.indexer.addUnion( str ), void() ) { 278 // if ( ! pass.indexer.lookupUnion( str ) ) { 279 // pass.indexer.addUnion( str ); 280 // } 281 // } 282 283 // template<typename pass_t> 284 // static inline void addUnion( pass_t &, long, const std::string & ) {} 285 285 286 286 #undef INDEXER_FUNC1
Note:
See TracChangeset
for help on using the changeset viewer.