Changes in src/InitTweak/FixInit.cc [b6fe7e6:906e24d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
rb6fe7e6 r906e24d 391 391 CP_CTOR_PRINT( std::cerr << "Type Substitution: " << *impCpCtorExpr->get_env() << std::endl; ) 392 392 // xxx - need to handle tuple arguments 393 assert( ! arg->get_results().empty() );394 Type * result = arg->get_result s().front();393 assert( arg->has_result() ); 394 Type * result = arg->get_result(); 395 395 if ( skipCopyConstruct( result ) ) continue; // skip certain non-copyable types 396 396 // type may involve type variables, so apply type substitution to get temporary variable's actual type … … 423 423 // level. Trying to pass that environment along. 424 424 callExpr->set_env( impCpCtorExpr->get_env()->clone() ); 425 for ( Type * result : appExpr->get_results() ) { 425 Type * result = appExpr->get_result(); 426 if ( ! result->isVoid() ) { 427 // need to flatten result type and construct each 426 428 result = result->clone(); 427 429 impCpCtorExpr->get_env()->apply( result ); … … 479 481 // know the result type of the assignment is the type of the LHS (minus the pointer), so 480 482 // add that onto the assignment expression so that later steps have the necessary information 481 assign-> add_result( returnDecl->get_type()->clone() );483 assign->set_result( returnDecl->get_type()->clone() ); 482 484 483 485 Expression * retExpr = new CommaExpr( assign, new VariableExpr( returnDecl ) ); 484 if ( callExpr->get_result s().front()->get_isLvalue() ) {486 if ( callExpr->get_result()->get_isLvalue() ) { 485 487 // lvalue returning functions are funny. Lvalue.cc inserts a *? in front of any lvalue returning 486 488 // non-intrinsic function. Add an AddressExpr to the call to negate the derefence and change the … … 500 502 UntypedExpr * deref = new UntypedExpr( new NameExpr( "*?" ) ); 501 503 deref->get_args().push_back( retExpr ); 502 deref-> add_result( resultType );504 deref->set_result( resultType ); 503 505 retExpr = deref; 504 506 } // if … … 939 941 Expression * FixCtorExprs::mutate( ConstructorExpr * ctorExpr ) { 940 942 static UniqueName tempNamer( "_tmp_ctor_expr" ); 941 assert( ctorExpr-> get_results().size() == 1 );942 ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, ctorExpr->get_result s().front()->clone(), nullptr );943 assert( ctorExpr->has_result() && ctorExpr->get_result()->size() == 1 ); 944 ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr ); 943 945 addDeclaration( tmp ); 944 946 … … 952 954 assign->get_args().push_back( new VariableExpr( tmp ) ); 953 955 assign->get_args().push_back( firstArg ); 954 cloneAll( ctorExpr->get_results(), assign->get_results() );956 assign->set_result( ctorExpr->get_result()->clone() ); 955 957 firstArg = assign; 956 958
Note: See TracChangeset
for help on using the changeset viewer.