Changeset 771b3c3 for src/GenPoly
- Timestamp:
- Jan 20, 2016, 1:09:05 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:
- d63eeb0
- Parents:
- ca1c11f (diff), 803deb1 (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/GenPoly/Specialize.cc
rca1c11f r771b3c3 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Jan 19 10:40:37201613 // Update Count : 2 312 // Last Modified On : Wed Jan 20 13:00:00 2016 13 // Update Count : 24 14 14 // 15 15 … … 142 142 143 143 Expression * Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ) { 144 assert( actual->get_results().size() >= 1); // using front, should have this assert144 assert( ! actual->get_results().empty() ); // using front, should have this assert 145 145 if ( needsSpecialization( formalType, actual->get_results().front(), env ) ) { 146 146 FunctionType *funType; … … 198 198 199 199 Expression * Specialize::mutate( CastExpr *castExpr ) { 200 assert( castExpr->get_results().size() >= 1 && "Check that functions with void return aren't returning a value" );201 200 castExpr->get_arg()->acceptMutator( *this ); 201 if ( castExpr->get_results().empty() ) { 202 // can't specialize if we don't have a return value 203 return castExpr; 204 } 202 205 Expression *specialized = doSpecialization( castExpr->get_results().front(), castExpr->get_arg() ); 203 206 if ( specialized != castExpr->get_arg() ) {
Note: See TracChangeset
for help on using the changeset viewer.