Changeset fba44f8
- Timestamp:
- Sep 1, 2016, 11:25:38 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, 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:
- 0362d42, 4d4882a
- Parents:
- c8dfcd3 (diff), 90e2334 (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/SymTab/Validate.cc
rc8dfcd3 rfba44f8 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 Pass1: public Visitor {88 class EnumAndPointerDecayPass : 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 Pass1 pass1;191 EnumAndPointerDecayPass epc; 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 Pass1199 acceptAll( translationUnit, pass1);198 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass 199 acceptAll( translationUnit, epc ); 200 200 acceptAll( translationUnit, pass2 ); 201 201 ReturnChecker::checkFunctionReturns( translationUnit ); … … 206 206 207 207 void validateType( Type *type, const Indexer *indexer ) { 208 Pass1 pass1;208 EnumAndPointerDecayPass epc; 209 209 Pass2 pass2( false, indexer ); 210 210 Pass3 pass3( indexer ); 211 type->accept( pass1);211 type->accept( epc ); 212 212 type->accept( pass2 ); 213 213 type->accept( pass3 ); … … 272 272 } 273 273 274 void Pass1::visit( EnumDecl *enumDecl ) {274 void EnumAndPointerDecayPass::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; 298 299 dwts.erase( j ); 299 300 if ( i != end ) { … … 313 314 } 314 315 315 void Pass1::visit( FunctionType *func ) {316 void EnumAndPointerDecayPass::visit( FunctionType *func ) { 316 317 // Fix up parameters and return types 317 318 fixFunctionList( func->get_parameters(), func );
Note: See TracChangeset
for help on using the changeset viewer.