Changes in src/Validate/Autogen.cpp [1761046:0522ebe]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/Autogen.cpp
r1761046 r0522ebe 133 133 /// Generates a single struct member operation. 134 134 /// (constructor call, destructor call, assignment call) 135 const ast::Stmt * makeMemberOp( 135 // This is managed because it uses another helper that returns a ast::ptr. 136 ast::ptr<ast::Stmt> makeMemberOp( 136 137 const CodeLocation& location, 137 138 const ast::ObjectDecl * dstParam, const ast::Expr * src, … … 205 206 ast::FunctionDecl * genLabelProto() const; 206 207 ast::FunctionDecl * genValueProto() const; 208 // ast::FunctionDecl * genValueProto2() const; 207 209 }; 208 210 … … 523 525 } 524 526 525 const ast::Stmt *StructFuncGenerator::makeMemberOp(527 ast::ptr<ast::Stmt> StructFuncGenerator::makeMemberOp( 526 528 const CodeLocation& location, const ast::ObjectDecl * dstParam, 527 529 const ast::Expr * src, const ast::ObjectDecl * field, … … 538 540 ) 539 541 ); 540 const ast::Stmt *stmt = genImplicitCall(542 auto stmt = genImplicitCall( 541 543 srcParam, dstSelect, location, func->name, 542 544 field, direction … … 596 598 location, field, new ast::VariableExpr( location, srcParam ) 597 599 ) : nullptr; 598 const ast::Stmt *stmt =600 ast::ptr<ast::Stmt> stmt = 599 601 makeMemberOp( location, dstParam, srcSelect, field, func, direction ); 600 602 601 603 if ( nullptr != stmt ) { 602 stmts->kids. emplace_back( stmt );604 stmts->kids.push_back( stmt ); 603 605 } 604 606 } … … 621 623 for ( auto param = params.begin() + 1 ; current != end ; ++current ) { 622 624 const ast::ptr<ast::Decl> & member = *current; 623 const ast::Stmt *stmt = nullptr;625 ast::ptr<ast::Stmt> stmt = nullptr; 624 626 auto field = member.as<ast::ObjectDecl>(); 625 627 // Not sure why it could be null. … … 639 641 640 642 if ( nullptr != stmt ) { 641 stmts->kids. emplace_back( stmt );643 stmts->kids.push_back( stmt ); 642 644 } 643 645 } … … 789 791 } 790 792 793 // ast::FunctionDecl * EnumFuncGenerator::genValueProto2() const { 794 // return genProto( "valueE", 795 // { new ast::ObjectDecl( getLocation(), "_i", new ast::EnumPosType( new ast::EnumInstType( decl ) ) )}, 796 // { new ast::ObjectDecl( getLocation(), "_ret", ast::deepCopy( decl->base ) ) } ); 797 // } 798 791 799 void EnumFuncGenerator::genAttrFuncForward() { 792 800 if ( decl->base ) { 793 801 ast::FunctionDecl *(EnumFuncGenerator::*attrProtos[3])() const = { 794 802 &EnumFuncGenerator::genPosProto, &EnumFuncGenerator::genLabelProto, 795 &EnumFuncGenerator::genValueProto }; 803 &EnumFuncGenerator::genValueProto 804 // , &EnumFuncGenerator::genValueProto2 805 }; 796 806 for ( auto & generator : attrProtos ) { 797 807 produceForwardDecl( (this->*generator)() );
Note: See TracChangeset
for help on using the changeset viewer.