Changeset f1b1e4c for src/SymTab/Validate.cc
- Timestamp:
- Jun 1, 2016, 11:54:23 AM (8 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:
- be945ac
- Parents:
- 70f89d00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r70f89d00 rf1b1e4c 291 291 292 292 namespace { 293 template< typename DWTIterator >294 void fixFunctionList( DWTIterator begin, DWTIterator end, FunctionType *func ) {293 template< typename DWTIterator, typename DWTList > 294 void fixFunctionList( DWTIterator begin, DWTIterator end, FunctionType *func, DWTList & dwts ) { 295 295 // the only case in which "void" is valid is where it is the only one in the list; then it should be removed 296 296 // entirely other fix ups are handled by the FixFunction class … … 298 298 FixFunction fixer; 299 299 DWTIterator i = begin; 300 *i = (*i 300 *i = (*i)->acceptMutator( fixer ); 301 301 if ( fixer.get_isVoid() ) { 302 302 DWTIterator j = i; 303 303 ++i; 304 func->get_parameters().erase( j );304 dwts.erase( j ); 305 305 if ( i != end ) { 306 306 throw SemanticError( "invalid type void in function type ", func ); … … 321 321 void Pass1::visit( FunctionType *func ) { 322 322 // Fix up parameters and return types 323 fixFunctionList( func->get_parameters().begin(), func->get_parameters().end(), func );324 fixFunctionList( func->get_returnVals().begin(), func->get_returnVals().end(), func );323 fixFunctionList( func->get_parameters().begin(), func->get_parameters().end(), func, func->get_parameters() ); 324 fixFunctionList( func->get_returnVals().begin(), func->get_returnVals().end(), func, func->get_returnVals() ); 325 325 Visitor::visit( func ); 326 326 }
Note: See TracChangeset
for help on using the changeset viewer.