Changeset 7eabc25
- Timestamp:
- Apr 11, 2016, 6:01:27 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- db4ecc5
- Parents:
- 7a69460
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/RemoveInit.cc
r7a69460 r7eabc25 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon Apr 04 17:18:03 201612 // Last Modified On : Mon Apr 11 17:28:43 2016 13 13 // Update Count : 166 14 14 // … … 95 95 // xxx this can be more complicated - consider ListInit 96 96 UntypedExpr *assign = new UntypedExpr( new NameExpr( "?{}" ) ); 97 assign->get_args().push_back( new AddressExpr (new NameExpr( objDecl->get_name()) ) );97 assign->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) ); 98 98 assign->get_args().push_back( single->get_value()->clone() ); 99 99 stmtsToAddAfter.push_back(new ExprStmt(noLabels, assign)); … … 108 108 // hands off if the function returns an lvalue - we don't want to allocate a temporary if a variable's address 109 109 // is being returned 110 if ( returnStmt->get_expr() && returnVals.size() == 1 && funcName != "?=?" && ! returnVals.front()->get_type()->get_isLvalue() 110 if ( returnStmt->get_expr() && returnVals.size() == 1 && funcName != "?=?" && ! returnVals.front()->get_type()->get_isLvalue() ) { 111 111 // ensure return value is not destructed by explicitly creating 112 112 // an empty SingleInit node wherein maybeConstruct is false … … 116 116 // and explicitly create the constructor expression separately 117 117 UntypedExpr *construct = new UntypedExpr( new NameExpr( "?{}" ) ); 118 construct->get_args().push_back( new AddressExpr (new NameExpr( newObj->get_name()) ) );118 construct->get_args().push_back( new AddressExpr( new VariableExpr( newObj ) ) ); 119 119 construct->get_args().push_back( returnStmt->get_expr() ); 120 120 stmtsToAdd.push_back(new ExprStmt(noLabels, construct));
Note: See TracChangeset
for help on using the changeset viewer.