Changeset c19edd1 for src/InitTweak
- Timestamp:
- Jun 22, 2022, 12:59:09 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- ae2f2ae
- Parents:
- c5d5723
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/InitTweak/GenInit.cc ¶
rc5d5723 rc19edd1 642 642 643 643 ast::ConstructorInit * genCtorInit( const CodeLocation & loc, const ast::ObjectDecl * objDecl ) { 644 // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor for each 644 // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor for each 645 645 // constructable object 646 646 InitExpander_new srcParam{ objDecl->init }, nullParam{ (const ast::Init *)nullptr }; 647 647 ast::ptr< ast::Expr > dstParam = new ast::VariableExpr(loc, objDecl); 648 649 ast::ptr< ast::Stmt > ctor = SymTab::genImplicitCall( 648 649 ast::ptr< ast::Stmt > ctor = SymTab::genImplicitCall( 650 650 srcParam, dstParam, loc, "?{}", objDecl ); 651 ast::ptr< ast::Stmt > dtor = SymTab::genImplicitCall( 652 nullParam, dstParam, loc, "^?{}", objDecl, 651 ast::ptr< ast::Stmt > dtor = SymTab::genImplicitCall( 652 nullParam, dstParam, loc, "^?{}", objDecl, 653 653 SymTab::LoopBackward ); 654 654 655 655 // check that either both ctor and dtor are present, or neither 656 656 assert( (bool)ctor == (bool)dtor ); 657 657 658 658 if ( ctor ) { 659 // need to remember init expression, in case no ctors exist. If ctor does exist, want to 659 // need to remember init expression, in case no ctors exist. If ctor does exist, want to 660 660 // use ctor expression instead of init. 661 ctor.strict_as< ast::ImplicitCtorDtorStmt >(); 661 ctor.strict_as< ast::ImplicitCtorDtorStmt >(); 662 662 dtor.strict_as< ast::ImplicitCtorDtorStmt >(); 663 663
Note: See TracChangeset
for help on using the changeset viewer.