Changeset b8524ca for src/Tuples
- Timestamp:
- Jun 20, 2019, 6:50:42 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 9af00d23
- Parents:
- 234b1cb
- Location:
- src/Tuples
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/Explode.cc
r234b1cb rb8524ca 133 133 if ( first ) { 134 134 castAdded = true; 135 const ast::Expr * tuple = new ast::TupleExpr( 136 tupleExpr->location, std::move( exprs ) ); 137 return new ast::CastExpr( tuple->location, 138 tuple, new ast::ReferenceType( tuple->result.get(), ast::CV::Qualifiers() ) ); 135 const ast::Expr * tuple = new ast::TupleExpr{ 136 tupleExpr->location, std::move( exprs ) }; 137 return new ast::CastExpr{ tuple, new ast::ReferenceType{ tuple->result } }; 139 138 } else { 140 139 return new ast::TupleExpr( tupleExpr->location, std::move( exprs ) ); … … 145 144 } else { 146 145 castAdded = true; 147 return new ast::CastExpr( expr->location, expr, 148 new ast::ReferenceType( expr->result, ast::CV::Qualifiers() ) ); 146 return new ast::CastExpr{ expr, new ast::ReferenceType{ expr->result } }; 149 147 } 150 148 } … … 164 162 castAdded = false; 165 163 const ast::Type * newType = getReferenceBase( newNode->result ); 166 return new ast::CastExpr ( newNode->location, node, newType );164 return new ast::CastExpr{ newNode->location, node, newType }; 167 165 } 168 166 return newNode; … … 183 181 expr = expr->accept( exploder ); 184 182 if ( ! exploder.pass.foundUniqueExpr ) { 185 expr = new ast::CastExpr( expr->location, expr, 186 new ast::ReferenceType( expr->result, ast::CV::Qualifiers() ) ); 183 expr = new ast::CastExpr{ expr, new ast::ReferenceType{ expr->result } }; 187 184 } 188 185 return expr; -
src/Tuples/Explode.h
r234b1cb rb8524ca 211 211 // Cast a reference away to a value-type to allow further explosion. 212 212 if ( dynamic_cast< const ast::ReferenceType *>( local->result.get() ) ) { 213 local = new ast::CastExpr ( local->location, local, tupleType );213 local = new ast::CastExpr{ local, tupleType }; 214 214 } 215 215 // Now we have to go across the tuple via indexing. -
src/Tuples/TupleAssignment.cc
r234b1cb rb8524ca 464 464 // resolve ctor/dtor for the new object 465 465 ast::ptr< ast::Init > ctorInit = ResolvExpr::resolveCtorInit( 466 InitTweak::genCtorInit( ret ), spotter.crntFinder.symtab );466 InitTweak::genCtorInit( location, ret ), spotter.crntFinder.symtab ); 467 467 // remove environments from subexpressions of stmtExpr 468 468 ast::Pass< EnvRemover > rm{ env }; … … 550 550 // is && and RHS is lvalue 551 551 auto lhsType = lhsCand->expr->result.strict_as< ast::ReferenceType >(); 552 rhsCand->expr = new ast::CastExpr{ 553 rhsCand->expr->location, rhsCand->expr, lhsType->base }; 552 rhsCand->expr = new ast::CastExpr{ rhsCand->expr, lhsType->base }; 554 553 ast::ptr< ast::ObjectDecl > lobj = newObject( lhsNamer, lhsCand->expr ); 555 554 ast::ptr< ast::ObjectDecl > robj = newObject( rhsNamer, rhsCand->expr ); … … 604 603 if ( ! lhsCand->expr.as< ast::CastExpr >() ) { 605 604 lhsCand->expr = new ast::CastExpr{ 606 lhsCand->expr->location, lhsCand->expr, 607 new ast::ReferenceType{ lhsCand->expr->result } }; 605 lhsCand->expr, new ast::ReferenceType{ lhsCand->expr->result } }; 608 606 } 609 607 … … 616 614 if ( ! cand->expr->result.as< ast::ReferenceType >() ) { 617 615 cand->expr = new ast::CastExpr{ 618 cand->expr->location, cand->expr, 619 new ast::ReferenceType{ cand->expr->result } }; 616 cand->expr, new ast::ReferenceType{ cand->expr->result } }; 620 617 } 621 618 }
Note: See TracChangeset
for help on using the changeset viewer.