Index: src/ResolvExpr/PolyCost.cc
===================================================================
--- src/ResolvExpr/PolyCost.cc	(revision 103b2647fd3e1566f5a1eb7f427ed05be4f8311e)
+++ src/ResolvExpr/PolyCost.cc	(revision a180ded007fd6e5c40436d958be413982fb4f1ae)
@@ -14,33 +14,31 @@
 //
 
+#include "Common/PassVisitor.h"
 #include "SymTab/Indexer.h"   // for Indexer
 #include "SynTree/Type.h"     // for TypeInstType, Type
-#include "SynTree/Visitor.h"  // for Visitor
 #include "TypeEnvironment.h"  // for EqvClass, TypeEnvironment
 
 namespace ResolvExpr {
-	class PolyCost : public Visitor {
-	  public:
+	struct PolyCost {
 		PolyCost( const TypeEnvironment &env, const SymTab::Indexer &indexer );
-		int get_result() const { return result; }
-	  private:
-		virtual void visit(TypeInstType *aggregateUseType);
+
+		void previsit( TypeInstType * aggregateUseType );
 		int result;
-		const TypeEnvironment &env;
+		const TypeEnvironment &tenv;
 		const SymTab::Indexer &indexer;
 	};
 
 	int polyCost( Type *type, const TypeEnvironment & env, const SymTab::Indexer &indexer ) {
-		PolyCost coster( env, indexer );
+		PassVisitor<PolyCost> coster( env, indexer );
 		type->accept( coster );
-		return coster.get_result();
+		return coster.pass.result;
 	}
 
-	PolyCost::PolyCost( const TypeEnvironment & env, const SymTab::Indexer & indexer ) : result( 0 ), env( env ), indexer( indexer ) {
+	PolyCost::PolyCost( const TypeEnvironment & env, const SymTab::Indexer & indexer ) : result( 0 ), tenv( env ), indexer( indexer ) {
 	}
 
-	void PolyCost::visit(TypeInstType * typeInst) {
+	void PolyCost::previsit(TypeInstType * typeInst) {
 		EqvClass eqvClass;
-		if ( env.lookup( typeInst->name, eqvClass ) ) {
+		if ( tenv.lookup( typeInst->name, eqvClass ) ) {
 			if ( eqvClass.type ) {
 				if ( TypeInstType * otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) {
