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