Index: c/GenPoly/PolyMutator.cc
===================================================================
--- src/GenPoly/PolyMutator.cc	(revision a31b384c2f1d792441e593f4312b46973c034c70)
+++ 	(revision )
@@ -1,187 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// PolyMutator.cc --
-//
-// Author           : Richard C. Bilson
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Thu Jun 22 13:47:00 2017
-// Update Count     : 17
-//
-
-#include "PolyMutator.h"
-
-#include "Common/SemanticError.h"  // for SemanticError
-#include "Common/utility.h"        // for ValueGuard
-#include "SynTree/Declaration.h"   // for Declaration, TypeDecl, TypeDecl::Data
-#include "SynTree/Expression.h"    // for Expression, UntypedExpr, StmtExpr ...
-#include "SynTree/Initializer.h"   // for SingleInit, Initializer (ptr only)
-#include "SynTree/Label.h"         // for Label, noLabels
-#include "SynTree/Mutator.h"       // for maybeMutate, mutateAll
-#include "SynTree/Statement.h"     // for CatchStmt, CompoundStmt, ForStmt
-
-class TypeSubstitution;
-
-namespace GenPoly {
-	PolyMutator::PolyMutator() : scopeTyVars( TypeDecl::Data{} ), env( 0 ) {}
-
-	void PolyMutator::mutateStatementList( std::list< Statement* > &statements ) {
-		SemanticError errors;
-
-		for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {
-			if ( ! stmtsToAddAfter.empty() ) {
-				statements.splice( i, stmtsToAddAfter );
-			} // if
-			try {
-				*i = (*i)->acceptMutator( *this );
-			} catch ( SemanticError &e ) {
-				errors.append( e );
-			} // try
-			if ( ! stmtsToAdd.empty() ) {
-				statements.splice( i, stmtsToAdd );
-			} // if
-		} // for
-		if ( ! stmtsToAddAfter.empty() ) {
-			statements.splice( statements.end(), stmtsToAddAfter );
-		} // if
-		if ( ! errors.isEmpty() ) {
-			throw errors;
-		}
-	}
-
-	Statement * PolyMutator::mutateStatement( Statement *stmt ) {
-		// don't want statements from outer CompoundStmts to be added to this CompoundStmt
-		ValueGuard< std::list< Statement* > > oldStmtsToAdd( stmtsToAdd );
-		ValueGuard< std::list< Statement* > > oldStmtsToAddAfter( stmtsToAddAfter );
-		ValueGuard< TypeSubstitution * > oldEnv( env );
-		stmtsToAdd.clear();
-		stmtsToAddAfter.clear();
-
-		Statement *newStmt = maybeMutate( stmt, *this );
-		if ( ! stmtsToAdd.empty() || ! stmtsToAddAfter.empty() ) {
-			CompoundStmt *compound = new CompoundStmt( noLabels );
-			compound->get_kids().splice( compound->get_kids().end(), stmtsToAdd );
-			compound->get_kids().push_back( newStmt );
-			compound->get_kids().splice( compound->get_kids().end(), stmtsToAddAfter );
-			// doEndScope();
-			return compound;
-		} else {
-			return newStmt;
-		}
-	}
-
-	Expression * PolyMutator::mutateExpression( Expression *expr ) {
-		if ( expr ) {
-			if ( expr->get_env() ) {
-				env = expr->get_env();
-			}
-			// xxx - should env be cloned (or moved) onto the result of the mutate?
-			return expr->acceptMutator( *this );
-		} else {
-			return expr;
-		}
-	}
-
-	CompoundStmt * PolyMutator::mutate(CompoundStmt *compoundStmt) {
-		doBeginScope();
-		mutateStatementList( compoundStmt->get_kids() );
-		doEndScope();
-		return compoundStmt;
-	}
-
-	Statement * PolyMutator::mutate(IfStmt *ifStmt) {
-		ifStmt->set_condition(  mutateExpression( ifStmt->get_condition() ) );
-		ifStmt->set_thenPart(  mutateStatement( ifStmt->get_thenPart() ) );
-		ifStmt->set_elsePart(  mutateStatement( ifStmt->get_elsePart() ) );
-		return ifStmt;
-	}
-
-	Statement * PolyMutator::mutate(WhileStmt *whileStmt) {
-		whileStmt->set_condition(  mutateExpression( whileStmt->get_condition() ) );
-		whileStmt->set_body(  mutateStatement( whileStmt->get_body() ) );
-		return whileStmt;
-	}
-
-	Statement * PolyMutator::mutate(ForStmt *forStmt) {
-		mutateAll( forStmt->get_initialization(), *this );
-		forStmt->set_condition(  mutateExpression( forStmt->get_condition() ) );
-		forStmt->set_increment(  mutateExpression( forStmt->get_increment() ) );
-		forStmt->set_body(  mutateStatement( forStmt->get_body() ) );
-		return forStmt;
-	}
-
-	Statement * PolyMutator::mutate(SwitchStmt *switchStmt) {
-		switchStmt->set_condition( mutateExpression( switchStmt->get_condition() ) );
-		mutateStatementList( switchStmt->get_statements() );
-		return switchStmt;
-	}
-
-	Statement * PolyMutator::mutate(CaseStmt *caseStmt) {
-		caseStmt->set_condition(  mutateExpression( caseStmt->get_condition() ) );
-		mutateStatementList( caseStmt->get_statements() );
-		return caseStmt;
-	}
-
-	Statement * PolyMutator::mutate(TryStmt *tryStmt) {
-		tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) );
-		mutateAll( tryStmt->get_catchers(), *this );
-		tryStmt->set_finally( maybeMutate( tryStmt->get_finally(), *this ) );
-		return tryStmt;
-	}
-
-	Statement * PolyMutator::mutate(CatchStmt *cathStmt) {
-		cathStmt->set_body( mutateStatement( cathStmt->get_body() ) );
-		cathStmt->set_cond( maybeMutate( cathStmt->get_cond(), *this ) );
-		cathStmt->set_decl( maybeMutate( cathStmt->get_decl(), *this ) );
-		return cathStmt;
-	}
-
-	Statement * PolyMutator::mutate(ReturnStmt *retStmt) {
-		retStmt->set_expr( mutateExpression( retStmt->get_expr() ) );
-		return retStmt;
-	}
-
-	Statement * PolyMutator::mutate(ExprStmt *exprStmt) {
-		exprStmt->set_expr( mutateExpression( exprStmt->get_expr() ) );
-		return exprStmt;
-	}
-
-
-	Expression * PolyMutator::mutate(UntypedExpr *untypedExpr) {
-		for ( std::list< Expression* >::iterator i = untypedExpr->get_args().begin(); i != untypedExpr->get_args().end(); ++i ) {
-			*i = mutateExpression( *i );
-		} // for
-		return untypedExpr;
-	}
-
-	Expression *PolyMutator::mutate( StmtExpr * stmtExpr ) {
-		// don't want statements from outer CompoundStmts to be added to this StmtExpr
-		ValueGuard< std::list< Statement* > > oldStmtsToAdd( stmtsToAdd );
-		ValueGuard< std::list< Statement* > > oldStmtsToAddAfter( stmtsToAddAfter );
-		ValueGuard< TypeSubstitution * > oldEnv( env );
-
-		// xxx - not sure if this is needed, along with appropriate reset, but I don't think so...
-		// ValueGuard< TyVarMap > oldScopeTyVars( scopeTyVars );
-
-		stmtsToAdd.clear();
-		stmtsToAddAfter.clear();
-		// scopeTyVars.clear();
-
-		return Parent::mutate( stmtExpr );
-	}
-
-	Initializer *PolyMutator::mutate( SingleInit *singleInit ) {
-		singleInit->set_value( mutateExpression( singleInit->get_value() ) );
-		return singleInit;
-	}
-} // namespace GenPoly
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: c/GenPoly/PolyMutator.h
===================================================================
--- src/GenPoly/PolyMutator.h	(revision a31b384c2f1d792441e593f4312b46973c034c70)
+++ 	(revision )
@@ -1,67 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// PolyMutator.h --
-//
-// Author           : Richard C. Bilson
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 22 09:20:31 2017
-// Update Count     : 7
-//
-
-#pragma once
-
-#include <list>               // for list
-
-#include "GenPoly.h"          // for TyVarMap
-#include "SynTree/Mutator.h"  // for Mutator
-#include "SynTree/SynTree.h"  // for Visitor Nodes
-
-namespace GenPoly {
-	class PolyMutator : public Mutator {
-	  public:
-		typedef Mutator Parent;
-		using Parent::mutate;
-
-		PolyMutator();
-
-		virtual CompoundStmt* mutate(CompoundStmt *compoundStmt);
-		virtual Statement* mutate(IfStmt *ifStmt);
-		virtual Statement* mutate(WhileStmt *whileStmt);
-		virtual Statement* mutate(ForStmt *forStmt);
-		virtual Statement* mutate(SwitchStmt *switchStmt);
-		virtual Statement* mutate(CaseStmt *caseStmt);
-		virtual Statement* mutate(TryStmt *returnStmt);
-		virtual Statement* mutate(CatchStmt *catchStmt);
-		virtual Statement* mutate(ExprStmt *catchStmt);
-		virtual Statement* mutate(ReturnStmt *catchStmt);
-
-		virtual Expression* mutate(UntypedExpr *untypedExpr);
-		virtual Expression* mutate( StmtExpr *stmtExpr );
-
-		virtual Initializer* mutate(SingleInit *SingleInit);
-
-		// template method
-		virtual void doBeginScope() {}
-		virtual void doEndScope() {}
-	  protected:
-		void mutateStatementList( std::list< Statement* > &statements );
-		Statement* mutateStatement( Statement *stmt );
-		Expression* mutateExpression( Expression *expr );
-
-		TyVarMap scopeTyVars;
-		TypeSubstitution *env;
-		std::list< Statement* > stmtsToAdd;
-		std::list< Statement* > stmtsToAddAfter;
-	};
-} // namespace
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/GenPoly/module.mk
===================================================================
--- src/GenPoly/module.mk	(revision a31b384c2f1d792441e593f4312b46973c034c70)
+++ src/GenPoly/module.mk	(revision 7c40a241f7b1a3fab06e54892b0098c8ebb9e4d8)
@@ -17,5 +17,4 @@
 SRC += GenPoly/Box.cc \
        GenPoly/GenPoly.cc \
-       GenPoly/PolyMutator.cc \
        GenPoly/ScrubTyVars.cc \
        GenPoly/Lvalue.cc \
Index: src/Makefile.in
===================================================================
--- src/Makefile.in	(revision a31b384c2f1d792441e593f4312b46973c034c70)
+++ src/Makefile.in	(revision 7c40a241f7b1a3fab06e54892b0098c8ebb9e4d8)
@@ -172,5 +172,4 @@
 	GenPoly/driver_cfa_cpp-Box.$(OBJEXT) \
 	GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT) \
-	GenPoly/driver_cfa_cpp-PolyMutator.$(OBJEXT) \
 	GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT) \
 	GenPoly/driver_cfa_cpp-Lvalue.$(OBJEXT) \
@@ -496,31 +495,31 @@
 	ControlStruct/ForExprMutator.cc \
 	ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \
-	GenPoly/GenPoly.cc GenPoly/PolyMutator.cc \
-	GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc GenPoly/Specialize.cc \
-	GenPoly/CopyParams.cc GenPoly/FindFunction.cc \
-	GenPoly/InstantiateGeneric.cc InitTweak/GenInit.cc \
-	InitTweak/FixInit.cc InitTweak/FixGlobalInit.cc \
-	InitTweak/InitTweak.cc Parser/parser.yy Parser/lex.ll \
-	Parser/TypedefTable.cc Parser/ParseNode.cc \
-	Parser/DeclarationNode.cc Parser/ExpressionNode.cc \
-	Parser/StatementNode.cc Parser/InitializerNode.cc \
-	Parser/TypeData.cc Parser/LinkageSpec.cc \
-	Parser/parserutility.cc ResolvExpr/AlternativeFinder.cc \
-	ResolvExpr/Alternative.cc ResolvExpr/Unify.cc \
-	ResolvExpr/PtrsAssignable.cc ResolvExpr/CommonType.cc \
-	ResolvExpr/ConversionCost.cc ResolvExpr/CastCost.cc \
-	ResolvExpr/PtrsCastable.cc ResolvExpr/AdjustExprType.cc \
-	ResolvExpr/AlternativePrinter.cc ResolvExpr/Resolver.cc \
-	ResolvExpr/ResolveTypeof.cc ResolvExpr/RenameVars.cc \
-	ResolvExpr/FindOpenVars.cc ResolvExpr/PolyCost.cc \
-	ResolvExpr/Occurs.cc ResolvExpr/TypeEnvironment.cc \
-	ResolvExpr/CurrentObject.cc SymTab/Indexer.cc \
-	SymTab/Mangler.cc SymTab/Validate.cc SymTab/FixFunction.cc \
-	SymTab/ImplementationType.cc SymTab/TypeEquality.cc \
-	SymTab/Autogen.cc SynTree/Type.cc SynTree/VoidType.cc \
-	SynTree/BasicType.cc SynTree/PointerType.cc \
-	SynTree/ArrayType.cc SynTree/ReferenceType.cc \
-	SynTree/FunctionType.cc SynTree/ReferenceToType.cc \
-	SynTree/TupleType.cc SynTree/TypeofType.cc SynTree/AttrType.cc \
+	GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \
+	GenPoly/Specialize.cc GenPoly/CopyParams.cc \
+	GenPoly/FindFunction.cc GenPoly/InstantiateGeneric.cc \
+	InitTweak/GenInit.cc InitTweak/FixInit.cc \
+	InitTweak/FixGlobalInit.cc InitTweak/InitTweak.cc \
+	Parser/parser.yy Parser/lex.ll Parser/TypedefTable.cc \
+	Parser/ParseNode.cc Parser/DeclarationNode.cc \
+	Parser/ExpressionNode.cc Parser/StatementNode.cc \
+	Parser/InitializerNode.cc Parser/TypeData.cc \
+	Parser/LinkageSpec.cc Parser/parserutility.cc \
+	ResolvExpr/AlternativeFinder.cc ResolvExpr/Alternative.cc \
+	ResolvExpr/Unify.cc ResolvExpr/PtrsAssignable.cc \
+	ResolvExpr/CommonType.cc ResolvExpr/ConversionCost.cc \
+	ResolvExpr/CastCost.cc ResolvExpr/PtrsCastable.cc \
+	ResolvExpr/AdjustExprType.cc ResolvExpr/AlternativePrinter.cc \
+	ResolvExpr/Resolver.cc ResolvExpr/ResolveTypeof.cc \
+	ResolvExpr/RenameVars.cc ResolvExpr/FindOpenVars.cc \
+	ResolvExpr/PolyCost.cc ResolvExpr/Occurs.cc \
+	ResolvExpr/TypeEnvironment.cc ResolvExpr/CurrentObject.cc \
+	SymTab/Indexer.cc SymTab/Mangler.cc SymTab/Validate.cc \
+	SymTab/FixFunction.cc SymTab/ImplementationType.cc \
+	SymTab/TypeEquality.cc SymTab/Autogen.cc SynTree/Type.cc \
+	SynTree/VoidType.cc SynTree/BasicType.cc \
+	SynTree/PointerType.cc SynTree/ArrayType.cc \
+	SynTree/ReferenceType.cc SynTree/FunctionType.cc \
+	SynTree/ReferenceToType.cc SynTree/TupleType.cc \
+	SynTree/TypeofType.cc SynTree/AttrType.cc \
 	SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \
 	SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \
@@ -714,6 +713,4 @@
 	GenPoly/$(DEPDIR)/$(am__dirstamp)
 GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \
-	GenPoly/$(DEPDIR)/$(am__dirstamp)
-GenPoly/driver_cfa_cpp-PolyMutator.$(OBJEXT): GenPoly/$(am__dirstamp) \
 	GenPoly/$(DEPDIR)/$(am__dirstamp)
 GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT): GenPoly/$(am__dirstamp) \
@@ -1008,5 +1005,4 @@
 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po@am__quote@
@@ -1445,18 +1441,4 @@
 @am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-GenPoly.obj `if test -f 'GenPoly/GenPoly.cc'; then $(CYGPATH_W) 'GenPoly/GenPoly.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/GenPoly.cc'; fi`
 
-GenPoly/driver_cfa_cpp-PolyMutator.o: GenPoly/PolyMutator.cc
-@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-PolyMutator.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo -c -o GenPoly/driver_cfa_cpp-PolyMutator.o `test -f 'GenPoly/PolyMutator.cc' || echo '$(srcdir)/'`GenPoly/PolyMutator.cc
-@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='GenPoly/PolyMutator.cc' object='GenPoly/driver_cfa_cpp-PolyMutator.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-PolyMutator.o `test -f 'GenPoly/PolyMutator.cc' || echo '$(srcdir)/'`GenPoly/PolyMutator.cc
-
-GenPoly/driver_cfa_cpp-PolyMutator.obj: GenPoly/PolyMutator.cc
-@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-PolyMutator.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo -c -o GenPoly/driver_cfa_cpp-PolyMutator.obj `if test -f 'GenPoly/PolyMutator.cc'; then $(CYGPATH_W) 'GenPoly/PolyMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/PolyMutator.cc'; fi`
-@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-PolyMutator.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='GenPoly/PolyMutator.cc' object='GenPoly/driver_cfa_cpp-PolyMutator.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-PolyMutator.obj `if test -f 'GenPoly/PolyMutator.cc'; then $(CYGPATH_W) 'GenPoly/PolyMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/PolyMutator.cc'; fi`
-
 GenPoly/driver_cfa_cpp-ScrubTyVars.o: GenPoly/ScrubTyVars.cc
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-ScrubTyVars.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.o `test -f 'GenPoly/ScrubTyVars.cc' || echo '$(srcdir)/'`GenPoly/ScrubTyVars.cc
