Changeset 6d267ca
- Timestamp:
- Jul 25, 2017, 10:41:24 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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:
- d335627
- Parents:
- 9191a8e
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/utility.h
r9191a8e r6d267ca 310 310 template< typename T1, typename T2 > 311 311 struct group_iterate_t { 312 group_iterate_t( const T1 & v1, const T2 & v2 ) : args(v1, v2) {313 assertf( v1.size() == v2.size(), "group iteration requires containers of the same size.");312 group_iterate_t( bool skipBoundsCheck, const T1 & v1, const T2 & v2 ) : args(v1, v2) { 313 assertf(skipBoundsCheck || v1.size() == v2.size(), "group iteration requires containers of the same size: <%u, %u>.", v1.size(), v2.size()); 314 314 }; 315 315 … … 336 336 }; 337 337 338 /// performs bounds check to ensure that all arguments are of the same length. 338 339 template< typename... Args > 339 340 group_iterate_t<Args...> group_iterate( Args &&... args ) { 340 return group_iterate_t<Args...>(std::forward<Args>( args )...); 341 return group_iterate_t<Args...>(false, std::forward<Args>( args )...); 342 } 343 344 /// does not perform a bounds check - requires user to ensure that iteration terminates when appropriate. 345 template< typename... Args > 346 group_iterate_t<Args...> unsafe_group_iterate( Args &&... args ) { 347 return group_iterate_t<Args...>(true, std::forward<Args>( args )...); 341 348 } 342 349 -
src/Tuples/Explode.h
r9191a8e r6d267ca 30 30 template< typename OutputIterator > 31 31 void explodeUnique( Expression * expr, const ResolvExpr::Alternative & alt, const SymTab::Indexer & indexer, OutputIterator out, bool isTupleAssign ) { 32 Type * res = expr->get_result() ;32 Type * res = expr->get_result()->stripReferences(); 33 33 if ( TupleType * tupleType = dynamic_cast< TupleType * > ( res ) ) { 34 34 if ( TupleExpr * tupleExpr = dynamic_cast< TupleExpr * >( expr ) ) { … … 38 38 } 39 39 } else { 40 // tuple type, but not tuple expr - recursively index into its components 40 // tuple type, but not tuple expr - recursively index into its components. 41 // if expr type is reference, convert to value type 41 42 Expression * arg = expr->clone(); 43 44 if ( dynamic_cast<ReferenceType *>( arg->get_result() ) ) { 45 // TODO: does this go here (inside uniqueexpr) or outside uniqueexpr? I'm guessing probably should go after... 46 arg = new CastExpr( arg, tupleType->clone() ); 47 } 42 48 if ( Tuples::maybeImpure( arg ) && ! dynamic_cast< UniqueExpr * >( arg ) ) { 43 49 // expressions which may contain side effects require a single unique instance of the expression.
Note: See TracChangeset
for help on using the changeset viewer.