Changeset 2f42718 for src/InitTweak
- Timestamp:
- Feb 22, 2019, 10:43:29 AM (7 years ago)
- Branches:
- no_list
- Parents:
- 43e0949
- Location:
- src/InitTweak
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
r43e0949 r2f42718 1042 1042 if ( checkWarnings( function ) ) { 1043 1043 FunctionType * type = function->get_functionType(); 1044 assert( ! type-> get_parameters().empty() );1045 thisParam = strict_dynamic_cast< ObjectDecl * >( type-> get_parameters().front() );1044 assert( ! type->parameters.empty() ); 1045 thisParam = strict_dynamic_cast< ObjectDecl * >( type->parameters.front() ); 1046 1046 Type * thisType = getPointerBase( thisParam->get_type() ); 1047 1047 StructInstType * structType = dynamic_cast< StructInstType * >( thisType ); … … 1099 1099 if ( isCopyConstructor( function ) ) { 1100 1100 // if copy ctor, need to pass second-param-of-this-function.field 1101 std::list< DeclarationWithType * > & params = function->get_functionType()->get_parameters();1101 auto & params = function->get_functionType()->parameters; 1102 1102 assert( params.size() == 2 ); 1103 1103 arg2 = new MemberExpr( field, new VariableExpr( params.back() ) ); -
src/InitTweak/GenInit.cc
r43e0949 r2f42718 127 127 128 128 void ReturnFixer::premutate( ReturnStmt *returnStmt ) { 129 std::list< DeclarationWithType * > & returnVals = ftype->get_returnVals();129 auto & returnVals = ftype->returnVals; 130 130 assert( returnVals.size() == 0 || returnVals.size() == 1 ); 131 131 // hands off if the function returns a reference - we don't want to allocate a temporary if a variable's address … … 242 242 // if this function is a user-defined constructor or destructor, mark down the type as "managed" 243 243 if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && CodeGen::isCtorDtor( dwt->get_name() ) ) { 244 std::list< DeclarationWithType * > & params = GenPoly::getFunctionType( dwt->get_type() )->get_parameters();244 auto & params = GenPoly::getFunctionType( dwt->get_type() )->parameters; 245 245 assert( ! params.empty() ); 246 246 Type * type = InitTweak::getPointerBase( params.front()->get_type() ); … … 335 335 // go through assertions and recursively add seen ctor/dtors 336 336 for ( auto & tyDecl : functionDecl->get_functionType()->get_forall() ) { 337 for ( DeclarationWithType *& assertion : tyDecl-> get_assertions()) {337 for ( DeclarationWithType *& assertion : tyDecl->assertions ) { 338 338 managedTypes.handleDWT( assertion ); 339 339 } -
src/InitTweak/InitTweak.cc
r43e0949 r2f42718 410 410 FunctionType *funcType = GenPoly::getFunctionType( appExpr->function->result ); 411 411 assert( funcType ); 412 return funcType-> get_parameters().size() == 1;412 return funcType->parameters.size() == 1; 413 413 } 414 414 return false; … … 616 616 if ( ftype->parameters.size() != 2 ) return nullptr; 617 617 618 Type * t1 = getPointerBase( ftype-> get_parameters().front()->get_type() );618 Type * t1 = getPointerBase( ftype->parameters.front()->get_type() ); 619 619 Type * t2 = ftype->parameters.back()->get_type(); 620 620 assert( t1 );
Note:
See TracChangeset
for help on using the changeset viewer.