Changeset fa2c005 for src/AST/Pass.proto.hpp
- Timestamp:
- Jun 8, 2023, 3:19:43 PM (3 years ago)
- Branches:
- ADT
- Parents:
- 044ae62
- File:
-
- 1 edited
-
src/AST/Pass.proto.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.proto.hpp
r044ae62 rfa2c005 477 477 478 478 template<typename core_t> 479 static inline auto addAdtFwd( core_t & core, int, const ast::AdtDecl * decl ) -> decltype( core.symtab.addAdt( decl ), void() ) { 480 ast::AdtDecl * fwd = new ast::AdtDecl( decl->location, decl->name ); 481 for ( const auto & param : decl->params ) { 482 fwd->params.push_back( deepCopy( param.get() ) ); 483 } 484 core.symtab.addAdt( fwd ); 485 } 486 487 template<typename core_t> 488 static inline auto addAdtFwd( core_t &, long, const ast::AdtDecl * ) {} 489 490 template<typename core_t> 479 491 static inline auto addUnionFwd( core_t & core, int, const ast::UnionDecl * decl ) -> decltype( core.symtab.addUnion( decl ), void() ) { 480 492 ast::UnionDecl * fwd = new ast::UnionDecl( decl->location, decl->name ); … … 489 501 490 502 template<typename core_t> 491 static inline auto addAdtFwd( core_t & core, int, const ast::AdtDecl * decl ) -> decltype( core.symtab.addAdt( decl ), void() ) {492 ast::AdtDecl * fwd = new ast::AdtDecl( decl->location, decl->name );493 for ( const auto & param : decl->params ) {494 fwd->params.push_back( deepCopy( param.get() ) );495 }496 // Experimental497 for ( const auto & ctor : decl->data_constructors ) {498 addStructFwd( core, 0, ctor );499 }500 core.symtab.addAdt( fwd );501 }502 503 template<typename core_t>504 static inline auto addAdtFwd( core_t &, long, const ast::AdtDecl) {}505 506 template<typename core_t>507 503 static inline auto addStruct( core_t & core, int, const std::string & str ) -> decltype( core.symtab.addStruct( str ), void() ) { 508 504 if ( ! core.symtab.lookupStruct( str ) ) { … … 513 509 template<typename core_t> 514 510 static inline void addStruct( core_t &, long, const std::string & ) {} 511 512 template<typename core_t> 513 static inline auto addAdt( core_t & core, int, const std::string & str ) -> decltype( core.symtab.addAdt( str ), void() ) { 514 if ( ! core.symtab.lookupAdt( str ) ) { 515 core.symtab.addAdt( str ); 516 } 517 } 518 519 template<typename core_t> 520 static inline void addAdt( core_t &, long, const std::string & ) {} 515 521 516 522 template<typename core_t>
Note:
See TracChangeset
for help on using the changeset viewer.