Changes in src/AST/Convert.cpp [c86b08d:561354f]
- File:
-
- 1 edited
-
src/AST/Convert.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
rc86b08d r561354f 283 283 decl->parent = get<AggregateDecl>().accept1( node->parent ); 284 284 declPostamble( decl, node ); 285 return nullptr; // ??285 return nullptr; 286 286 } 287 287 … … 320 320 LinkageSpec::Spec( node->linkage.val ), 321 321 get<Type>().accept1(node->base) 322 ); 323 // decl->data_constructors = get<StructDecl>().acceptL( node->data_constructors ); 324 // decl->data_union = get<UnionDecl>().accept1( node->data_union ); 325 // decl->tag = get<EnumDecl>().accept1( node->tag ); 326 // decl->tag_union = get<StructDecl>().accept1( node->tag_union ); 327 return aggregatePostamble( decl, node ); 328 } 329 330 const ast::Decl * visit( const ast::AdtDecl * node ) override final { 331 if ( inCache(node) ) return nullptr; 332 auto decl = new AdtDecl( 333 node->name, 334 get<Attribute>().acceptL( node->attributes ), 335 LinkageSpec::Spec( node->linkage.val ), 336 get<StructDecl>().acceptL( node->data_constructors ), 337 get<UnionDecl>().accept1( node->data_union ), 338 get<EnumDecl>().accept1( node->tag ), 339 get<StructDecl>().accept1( node->tag_union ) 322 340 ); 323 341 return aggregatePostamble( decl, node ); … … 559 577 auto stmt = new SuspendStmt(); 560 578 stmt->then = get<CompoundStmt>().accept1( node->then ); 561 switch (node->type) {579 switch (node->kind) { 562 580 case ast::SuspendStmt::None : stmt->type = SuspendStmt::None ; break; 563 581 case ast::SuspendStmt::Coroutine: stmt->type = SuspendStmt::Coroutine; break; … … 565 583 } 566 584 return stmtPostamble( stmt, node ); 567 }568 569 const ast::WhenClause * visit( const ast::WhenClause * node ) override final {570 // There is no old-AST WhenClause, so this should never be called.571 assert( !node );572 return nullptr;573 585 } 574 586 … … 579 591 for ( auto clause : node->clauses ) { 580 592 stmt->clauses.push_back({{ 581 get<Expression>().accept1( clause->target ),593 get<Expression>().accept1( clause->target_func ), 582 594 get<Expression>().acceptL( clause->target_args ), 583 595 }, 584 596 get<Statement>().accept1( clause->stmt ), 585 get<Expression>().accept1( clause-> when_cond ),597 get<Expression>().accept1( clause->cond ), 586 598 }); 587 599 } … … 600 612 const ast::WaitForClause * visit( const ast::WaitForClause * node ) override final { 601 613 // There is no old-AST WaitForClause, so this should never be called. 602 assert( !node );603 return nullptr;604 }605 606 const ast::Stmt * visit( const ast::WaitUntilStmt * node ) override final {607 // There is no old-AST WaitUntilStmt, so this should never be called.608 614 assert( !node ); 609 615 return nullptr; … … 1695 1701 GET_ACCEPT_V(attributes, Attribute), 1696 1702 { old->get_funcSpec().val }, 1697 old->type->isVarArgs1703 (old->type->isVarArgs) ? ast::VariableArgs : ast::FixedArgs 1698 1704 }; 1699 1705 … … 1787 1793 decl->uniqueId = old->uniqueId; 1788 1794 decl->storage = { old->storageClasses.val }; 1795 this->node = decl; 1796 } 1797 1798 virtual void visit( const AdtDecl * old ) override final { 1799 if ( inCache( old ) ) return; 1800 auto decl = new ast::AdtDecl( 1801 old->location, 1802 old->name, 1803 GET_ACCEPT_V(attributes, Attribute), 1804 { old->linkage.val } 1805 ); 1806 cache.emplace( old, decl ); 1807 decl->parent = GET_ACCEPT_1(parent, AggregateDecl); 1808 decl->body = old->body; 1809 decl->params = GET_ACCEPT_V(parameters, TypeDecl); 1810 decl->members = GET_ACCEPT_V(members, Decl); 1811 decl->extension = old->extension; 1812 decl->uniqueId = old->uniqueId; 1813 decl->storage = { old->storageClasses.val }; 1814 decl->data_constructors = GET_ACCEPT_V( data_constructors, StructDecl ); 1815 decl->data_union = GET_ACCEPT_1( data_union, UnionDecl ); 1816 decl->tag = GET_ACCEPT_1( tag, EnumDecl ); 1817 decl->tag_union = GET_ACCEPT_1( tag_union, StructDecl ); 1789 1818 this->node = decl; 1790 1819 } … … 2001 2030 GET_ACCEPT_1(else_, Stmt), 2002 2031 GET_ACCEPT_V(initialization, Stmt), 2003 old->isDoWhile,2032 (old->isDoWhile) ? ast::DoWhile : ast::While, 2004 2033 GET_LABELS_V(old->labels) 2005 2034 ); … … 2143 2172 virtual void visit( const SuspendStmt * old ) override final { 2144 2173 if ( inCache( old ) ) return; 2145 ast::SuspendStmt:: Typetype;2174 ast::SuspendStmt::Kind type; 2146 2175 switch (old->type) { 2147 2176 case SuspendStmt::Coroutine: type = ast::SuspendStmt::Coroutine; break; … … 2170 2199 auto clause = new ast::WaitForClause( old->location ); 2171 2200 2172 clause->target = GET_ACCEPT_1(clauses[i].target.function, Expr);2201 clause->target_func = GET_ACCEPT_1(clauses[i].target.function, Expr); 2173 2202 clause->target_args = GET_ACCEPT_V(clauses[i].target.arguments, Expr); 2174 2203 clause->stmt = GET_ACCEPT_1(clauses[i].statement, Stmt); 2175 clause-> when_cond = GET_ACCEPT_1(clauses[i].condition, Expr);2204 clause->cond = GET_ACCEPT_1(clauses[i].condition, Expr); 2176 2205 2177 2206 stmt->clauses.push_back( clause );
Note:
See TracChangeset
for help on using the changeset viewer.