Changes in src/InitTweak/FixInit.cc [7641b6c:ba3706f]
- File:
-
- 1 edited
-
src/InitTweak/FixInit.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
r7641b6c rba3706f 382 382 } // if 383 383 delete stmt; 384 if ( TupleAssignExpr * assign = dynamic_cast< TupleAssignExpr * >( resolved ) ) {385 // fix newly generated StmtExpr386 postvisit( assign->stmtExpr );387 }388 384 return resolved; 389 385 } … … 483 479 env->apply( result ); 484 480 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr ); 485 ret-> type->set_const( false );486 stmtExpr-> returnDecls.push_front( ret );481 ret->get_type()->set_const( false ); 482 stmtExpr->get_returnDecls().push_front( ret ); 487 483 488 484 // must have a non-empty body, otherwise it wouldn't have a result 489 CompoundStmt * body = stmtExpr-> statements;485 CompoundStmt * body = stmtExpr->get_statements(); 490 486 assert( ! body->get_kids().empty() ); 491 487 // must be an ExprStmt, otherwise it wouldn't have a result 492 488 ExprStmt * last = strict_dynamic_cast< ExprStmt * >( body->get_kids().back() ); 493 last-> expr = makeCtorDtor( "?{}", ret, last->get_expr() );494 495 stmtExpr-> dtors.push_front( makeCtorDtor( "^?{}", ret ) );489 last->set_expr( makeCtorDtor( "?{}", ret, last->get_expr() ) ); 490 491 stmtExpr->get_dtors().push_front( makeCtorDtor( "^?{}", ret ) ); 496 492 } // if 497 493 } … … 610 606 // must have a non-empty body, otherwise it wouldn't have a result 611 607 assert( ! stmts.empty() ); 612 assert f( ! stmtExpr->get_returnDecls().empty(), "StmtExpr returns non-void, but no return decls: %s", toString( stmtExpr ).c_str() );608 assert( ! stmtExpr->get_returnDecls().empty() ); 613 609 stmts.push_back( new ExprStmt( new VariableExpr( stmtExpr->get_returnDecls().front() ) ) ); 614 610 stmtExpr->get_returnDecls().clear();
Note:
See TracChangeset
for help on using the changeset viewer.