Changes in src/SymTab/Validate.cc [83de11e:677c1be]
- File:
-
- 1 edited
-
src/SymTab/Validate.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r83de11e r677c1be 291 291 292 292 namespace { 293 template< typename DWT List>294 void fixFunctionList( DWT List & dwts, FunctionType *func ) {293 template< typename DWTIterator > 294 void fixFunctionList( DWTIterator begin, DWTIterator end, FunctionType *func ) { 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 297 typedef typename DWTList::iterator DWTIterator;298 DWTIterator begin( dwts.begin() ), end( dwts.end() );299 297 if ( begin == end ) return; 300 298 FixFunction fixer; 301 299 DWTIterator i = begin; 302 *i = (*i )->acceptMutator( fixer );300 *i = (*i )->acceptMutator( fixer ); 303 301 if ( fixer.get_isVoid() ) { 304 302 DWTIterator j = i; 305 303 ++i; 306 dwts.erase( j );304 func->get_parameters().erase( j ); 307 305 if ( i != end ) { 308 306 throw SemanticError( "invalid type void in function type ", func ); … … 323 321 void Pass1::visit( FunctionType *func ) { 324 322 // Fix up parameters and return types 325 fixFunctionList( func->get_parameters() , func );326 fixFunctionList( func->get_returnVals() , func );323 fixFunctionList( func->get_parameters().begin(), func->get_parameters().end(), func ); 324 fixFunctionList( func->get_returnVals().begin(), func->get_returnVals().end(), func ); 327 325 Visitor::visit( func ); 328 326 }
Note:
See TracChangeset
for help on using the changeset viewer.