Changes in src/SymTab/Validate.cc [bda58ad:46f6134]
- File:
-
- 1 edited
-
src/SymTab/Validate.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
rbda58ad r46f6134 86 86 87 87 /// Replaces enum types by int, and function or array types in function parameter and return lists by appropriate pointers. 88 class EnumAndPointerDecayPass: public Visitor {88 class Pass1 : public Visitor { 89 89 typedef Visitor Parent; 90 90 virtual void visit( EnumDecl *aggregateDecl ); … … 189 189 190 190 void validate( std::list< Declaration * > &translationUnit, bool doDebug ) { 191 EnumAndPointerDecayPass epc;191 Pass1 pass1; 192 192 Pass2 pass2( doDebug, 0 ); 193 193 Pass3 pass3( 0 ); … … 196 196 EliminateTypedef::eliminateTypedef( translationUnit ); 197 197 HoistStruct::hoistStruct( translationUnit ); 198 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass199 acceptAll( translationUnit, epc);198 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs Pass1 199 acceptAll( translationUnit, pass1 ); 200 200 acceptAll( translationUnit, pass2 ); 201 201 ReturnChecker::checkFunctionReturns( translationUnit ); … … 206 206 207 207 void validateType( Type *type, const Indexer *indexer ) { 208 EnumAndPointerDecayPass epc;208 Pass1 pass1; 209 209 Pass2 pass2( false, indexer ); 210 210 Pass3 pass3( indexer ); 211 type->accept( epc);211 type->accept( pass1 ); 212 212 type->accept( pass2 ); 213 213 type->accept( pass3 ); … … 272 272 } 273 273 274 void EnumAndPointerDecayPass::visit( EnumDecl *enumDecl ) {274 void Pass1::visit( EnumDecl *enumDecl ) { 275 275 // Set the type of each member of the enumeration to be EnumConstant 276 276 for ( std::list< Declaration * >::iterator i = enumDecl->get_members().begin(); i != enumDecl->get_members().end(); ++i ) { … … 296 296 DWTIterator j = i; 297 297 ++i; 298 delete *j;299 298 dwts.erase( j ); 300 299 if ( i != end ) { … … 314 313 } 315 314 316 void EnumAndPointerDecayPass::visit( FunctionType *func ) {315 void Pass1::visit( FunctionType *func ) { 317 316 // Fix up parameters and return types 318 317 fixFunctionList( func->get_parameters(), func );
Note:
See TracChangeset
for help on using the changeset viewer.