Changeset ffec1bf for src/InitTweak
- Timestamp:
- Jul 25, 2022, 2:23:28 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 4c48be0, 5cf1228, def751f
- Parents:
- 9e23b446 (diff), 1f950c3b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/InitTweak
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/GenInit.cc
r9e23b446 rffec1bf 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // GenInit.cc -- 7 // GenInit.cc -- Generate initializers, and other stuff. 8 8 // 9 9 // Author : Rob Schluntz … … 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 -
src/InitTweak/GenInit.h
r9e23b446 rffec1bf 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // GenInit.h -- 7 // GenInit.h -- Generate initializers, and other stuff. 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 29 29 void genInit( ast::TranslationUnit & translationUnit ); 30 30 31 /// Converts return statements into copy constructor calls on the hidden return variable 31 /// Converts return statements into copy constructor calls on the hidden return variable. 32 /// This pass must happen before auto-gen. 32 33 void fixReturnStatements( std::list< Declaration * > & translationUnit ); 33 34 void fixReturnStatements( ast::TranslationUnit & translationUnit );
Note: See TracChangeset
for help on using the changeset viewer.