Changeset e67a82d for src/Tuples/Explode.cc
- Timestamp:
- Aug 20, 2020, 11:48:15 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d685cb0
- Parents:
- 67ca73e (diff), 013b028 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/Explode.cc
r67ca73e re67a82d 129 129 for ( const ast::Expr * expr : tupleExpr->exprs ) { 130 130 exprs.emplace_back( applyCast( expr, false ) ); 131 //exprs.emplace_back( ast::ptr< ast::Expr >( applyCast( expr, false ) ) );132 131 } 133 132 if ( first ) { … … 148 147 } 149 148 150 const ast::Expr * post mutate( const ast::UniqueExpr * node ) {149 const ast::Expr * postvisit( const ast::UniqueExpr * node ) { 151 150 // move cast into unique expr so that the unique expr has type T& rather than 152 151 // type T. In particular, this transformation helps with generating the … … 162 161 castAdded = false; 163 162 const ast::Type * newType = getReferenceBase( newNode->result ); 164 return new ast::CastExpr{ newNode->location, n ode, newType };163 return new ast::CastExpr{ newNode->location, newNode, newType }; 165 164 } 166 165 return newNode; 167 166 } 168 167 169 const ast::Expr * post mutate( const ast::TupleIndexExpr * tupleExpr ) {168 const ast::Expr * postvisit( const ast::TupleIndexExpr * tupleExpr ) { 170 169 // tuple index expr needs to be rebuilt to ensure that the type of the 171 170 // field is consistent with the type of the tuple expr, since the field … … 180 179 ast::Pass<CastExploderCore> exploder; 181 180 expr = expr->accept( exploder ); 182 if ( ! exploder. pass.foundUniqueExpr ) {181 if ( ! exploder.core.foundUniqueExpr ) { 183 182 expr = new ast::CastExpr{ expr, new ast::ReferenceType{ expr->result } }; 184 183 }
Note:
See TracChangeset
for help on using the changeset viewer.