Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision af5c204ab6dfd6d34a6eb3258329f84bae858722)
+++ src/SymTab/Validate.cc	(revision 06edda0b8a538a16a0e1477728d907da392ecdb4)
@@ -115,8 +115,8 @@
 
 	/// Replaces enum types by int, and function or array types in function parameter and return lists by appropriate pointers.
-	class EnumAndPointerDecayPass final : public Visitor {
-		typedef Visitor Parent;
-		virtual void visit( EnumDecl *aggregateDecl );
-		virtual void visit( FunctionType *func );
+	class EnumAndPointerDecay {
+	public:
+		void previsit( EnumDecl *aggregateDecl );
+		void previsit( FunctionType *func );
 	};
 
@@ -126,5 +126,4 @@
 	  public:
 		LinkReferenceToTypes( bool doDebug, const Indexer *indexer );
-	  private:
   		using Parent::visit;
 		void visit( EnumInstType *enumInst ) final;
@@ -136,5 +135,5 @@
 		void visit( UnionDecl *unionDecl ) final;
 		void visit( TypeInstType *typeInst ) final;
-
+	  private:
 		const Indexer *indexer;
 
@@ -147,11 +146,11 @@
 	};
 
-	/// Replaces array and function types in forall lists by appropriate pointer type
-	class Pass3 final : public Indexer {
+	/// Replaces array and function types in forall lists by appropriate pointer type and assigns each Object and Function declaration a unique ID.
+	class ForallPointerDecay final : public Indexer {
 		typedef Indexer Parent;
 	  public:
 	  	using Parent::visit;
-		Pass3( const Indexer *indexer );
-	  private:
+		ForallPointerDecay( const Indexer *indexer );
+
 		virtual void visit( ObjectDecl *object ) override;
 		virtual void visit( FunctionDecl *func ) override;
@@ -246,7 +245,7 @@
 
 	void validate( std::list< Declaration * > &translationUnit, bool doDebug ) {
-		EnumAndPointerDecayPass epc;
+		PassVisitor<EnumAndPointerDecay> epc;
 		LinkReferenceToTypes lrt( doDebug, 0 );
-		Pass3 pass3( 0 );
+		ForallPointerDecay fpd( 0 );
 		CompoundLiteral compoundliteral;
 		PassVisitor<ValidateGenericParameters> genericParams;
@@ -260,20 +259,20 @@
 		VerifyCtorDtorAssign::verify( translationUnit );  // must happen before autogen, because autogen examines existing ctor/dtors
 		Concurrency::applyKeywords( translationUnit );
-		autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass
+		autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay
 		Concurrency::implementMutexFuncs( translationUnit );
 		Concurrency::implementThreadStarter( translationUnit );
 		ReturnChecker::checkFunctionReturns( translationUnit );
 		compoundliteral.mutateDeclarationList( translationUnit );
-		acceptAll( translationUnit, pass3 );
+		acceptAll( translationUnit, fpd );
 		ArrayLength::computeLength( translationUnit );
 	}
 
 	void validateType( Type *type, const Indexer *indexer ) {
-		EnumAndPointerDecayPass epc;
+		PassVisitor<EnumAndPointerDecay> epc;
 		LinkReferenceToTypes lrt( false, indexer );
-		Pass3 pass3( indexer );
+		ForallPointerDecay fpd( indexer );
 		type->accept( epc );
 		type->accept( lrt );
-		type->accept( pass3 );
+		type->accept( fpd );
 	}
 
@@ -354,5 +353,5 @@
 	}
 
-	void EnumAndPointerDecayPass::visit( EnumDecl *enumDecl ) {
+	void EnumAndPointerDecay::previsit( EnumDecl *enumDecl ) {
 		// Set the type of each member of the enumeration to be EnumConstant
 		for ( std::list< Declaration * >::iterator i = enumDecl->get_members().begin(); i != enumDecl->get_members().end(); ++i ) {
@@ -361,5 +360,4 @@
 			obj->set_type( new EnumInstType( Type::Qualifiers( Type::Const ), enumDecl->get_name() ) );
 		} // for
-		Parent::visit( enumDecl );
 	}
 
@@ -368,5 +366,5 @@
 		void fixFunctionList( DWTList & dwts, FunctionType * func ) {
 			// the only case in which "void" is valid is where it is the only one in the list; then it should be removed
-			// entirely other fix ups are handled by the FixFunction class
+			// entirely. other fix ups are handled by the FixFunction class
 			typedef typename DWTList::iterator DWTIterator;
 			DWTIterator begin( dwts.begin() ), end( dwts.end() );
@@ -387,5 +385,5 @@
 				for ( ; i != end; ++i ) {
 					FixFunction fixer;
-					*i = (*i )->acceptMutator( fixer );
+					*i = (*i)->acceptMutator( fixer );
 					if ( fixer.get_isVoid() ) {
 						throw SemanticError( "invalid type void in function type ", func );
@@ -396,9 +394,8 @@
 	}
 
-	void EnumAndPointerDecayPass::visit( FunctionType *func ) {
+	void EnumAndPointerDecay::previsit( FunctionType *func ) {
 		// Fix up parameters and return types
 		fixFunctionList( func->get_parameters(), func );
 		fixFunctionList( func->get_returnVals(), func );
-		Visitor::visit( func );
 	}
 
@@ -547,5 +544,5 @@
 	}
 
-	Pass3::Pass3( const Indexer *other_indexer ) :  Indexer( false ) {
+	ForallPointerDecay::ForallPointerDecay( const Indexer *other_indexer ) :  Indexer( false ) {
 		if ( other_indexer ) {
 			indexer = other_indexer;
@@ -585,5 +582,5 @@
 	}
 
-	void Pass3::visit( ObjectDecl *object ) {
+	void ForallPointerDecay::visit( ObjectDecl *object ) {
 		forallFixer( object->get_type() );
 		if ( PointerType *pointer = dynamic_cast< PointerType * >( object->get_type() ) ) {
@@ -594,5 +591,5 @@
 	}
 
-	void Pass3::visit( FunctionDecl *func ) {
+	void ForallPointerDecay::visit( FunctionDecl *func ) {
 		forallFixer( func->get_type() );
 		Parent::visit( func );
