Changeset e6cee92 for src/Tuples/Explode.h
- Timestamp:
- Jul 17, 2017, 3:25:58 PM (6 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 795d450
- Parents:
- 7ebaa56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/Explode.h
r7ebaa56 re6cee92 27 27 28 28 namespace Tuples { 29 /// helper function used by explode to properly distribute30 /// '&' across a tuple expression31 Expression * distributeAddr( Expression * expr );32 33 29 /// helper function used by explode 34 30 template< typename OutputIterator > 35 31 void explodeUnique( Expression * expr, const ResolvExpr::Alternative & alt, const SymTab::Indexer & indexer, OutputIterator out, bool isTupleAssign ) { 36 if ( isTupleAssign ) {37 // tuple assignment needs AddressExprs to be recursively exploded to easily get at all of the components38 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( expr ) ) {39 ResolvExpr::AltList alts;40 explodeUnique( addrExpr->get_arg(), alt, indexer, back_inserter( alts ), isTupleAssign );41 for ( ResolvExpr::Alternative & alt : alts ) {42 // distribute '&' over all components43 alt.expr = distributeAddr( alt.expr );44 *out++ = alt;45 }46 // in tuple assignment, still need to handle the other cases, but only if not already handled here (don't want to output too many alternatives)47 return;48 }49 }50 32 Type * res = expr->get_result(); 51 33 if ( TupleType * tupleType = dynamic_cast< TupleType * > ( res ) ) {
Note: See TracChangeset
for help on using the changeset viewer.