Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 84bb4d9e5e8e19a101f959de114293008192d69a)
+++ src/InitTweak/FixInit.cc	(revision a0fdbd51112d9506c6a29aefc759d19bbb0828fe)
@@ -10,5 +10,5 @@
 // Created On       : Wed Jan 13 16:29:30 2016
 // Last Modified By : Rob Schluntz
-// Last Modified On : Wed Apr 27 17:08:44 2016
+// Last Modified On : Thu Apr 28 12:25:14 2016
 // Update Count     : 30
 //
@@ -16,5 +16,5 @@
 #include <stack>
 #include <list>
-#include "RemoveInit.h"
+#include "FixInit.h"
 #include "ResolvExpr/Resolver.h"
 #include "ResolvExpr/typeops.h"
Index: src/InitTweak/GenInit.cc
===================================================================
--- src/InitTweak/GenInit.cc	(revision a0fdbd51112d9506c6a29aefc759d19bbb0828fe)
+++ src/InitTweak/GenInit.cc	(revision a0fdbd51112d9506c6a29aefc759d19bbb0828fe)
@@ -0,0 +1,249 @@
+//
+// 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.
+//
+// GenInit.cc --
+//
+// Author           : Rob Schluntz
+// Created On       : Mon May 18 07:44:20 2015
+// Last Modified By : Rob Schluntz
+// Last Modified On : Thu Apr 28 12:26:47 2016
+// Update Count     : 166
+//
+
+#include <stack>
+#include <list>
+#include "GenInit.h"
+#include "SynTree/Declaration.h"
+#include "SynTree/Type.h"
+#include "SynTree/Expression.h"
+#include "SynTree/Statement.h"
+#include "SynTree/Initializer.h"
+#include "SynTree/Mutator.h"
+#include "SymTab/Autogen.h"
+#include "GenPoly/PolyMutator.h"
+
+namespace InitTweak {
+	namespace {
+		const std::list<Label> noLabels;
+		const std::list<Expression *> noDesignators;
+	}
+
+	class ReturnFixer : public GenPoly::PolyMutator {
+	  public:
+		/// consistently allocates a temporary variable for the return value
+		/// of a function so that anything which the resolver decides can be constructed
+		/// into the return type of a function can be returned.
+		static void makeReturnTemp( std::list< Declaration * > &translationUnit );
+
+		ReturnFixer();
+
+		virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
+
+		virtual Statement * mutate( ReturnStmt * returnStmt );
+
+	  protected:
+		std::list<DeclarationWithType*> returnVals;
+		UniqueName tempNamer;
+		std::string funcName;
+	};
+
+	class CtorDtor : public GenPoly::PolyMutator {
+	  public:
+		/// create constructor and destructor statements for object declarations.
+		/// Destructors are inserted directly into the code, whereas constructors
+		/// will be added in after the resolver has run so that the initializer expression
+		/// is only removed if a constructor is found
+		static void generateCtorDtor( std::list< Declaration * > &translationUnit );
+
+		CtorDtor() : inFunction( false ) {}
+
+		virtual DeclarationWithType * mutate( ObjectDecl * );
+		virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
+		virtual Declaration* mutate( StructDecl *aggregateDecl );
+		virtual Declaration* mutate( UnionDecl *aggregateDecl );
+		virtual Declaration* mutate( EnumDecl *aggregateDecl );
+		virtual Declaration* mutate( TraitDecl *aggregateDecl );
+		virtual TypeDecl* mutate( TypeDecl *typeDecl );
+		virtual Declaration* mutate( TypedefDecl *typeDecl );
+
+		virtual Type * mutate( FunctionType *funcType );
+
+	  protected:
+		bool inFunction;
+	};
+
+	void genInit( std::list< Declaration * > & translationUnit ) {
+		ReturnFixer::makeReturnTemp( translationUnit );
+		CtorDtor::generateCtorDtor( translationUnit );
+	}
+
+	void ReturnFixer::makeReturnTemp( std::list< Declaration * > & translationUnit ) {
+		ReturnFixer fixer;
+		mutateAll( translationUnit, fixer );
+	}
+
+	ReturnFixer::ReturnFixer() : tempNamer( "_retVal" ) {}
+
+	Statement *ReturnFixer::mutate( ReturnStmt *returnStmt ) {
+		// update for multiple return values
+		assert( returnVals.size() == 0 || returnVals.size() == 1 );
+		// hands off if the function returns an lvalue - we don't want to allocate a temporary if a variable's address
+		// is being returned
+		if ( returnStmt->get_expr() && returnVals.size() == 1 && funcName != "?=?" && ! returnVals.front()->get_type()->get_isLvalue() ) {
+			// ensure return value is not destructed by explicitly creating
+			// an empty SingleInit node wherein maybeConstruct is false
+			ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, returnVals.front()->get_type()->clone(), new ListInit( std::list<Initializer*>(), noDesignators, false ) );
+			stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
+
+			// and explicitly create the constructor expression separately
+			UntypedExpr *construct = new UntypedExpr( new NameExpr( "?{}" ) );
+			construct->get_args().push_back( new AddressExpr( new VariableExpr( newObj ) ) );
+			construct->get_args().push_back( returnStmt->get_expr() );
+			stmtsToAdd.push_back(new ExprStmt(noLabels, construct));
+
+			returnStmt->set_expr( new VariableExpr( newObj ) );
+		} // if
+		return returnStmt;
+	}
+
+	DeclarationWithType* ReturnFixer::mutate( FunctionDecl *functionDecl ) {
+		std::list<DeclarationWithType*> oldReturnVals = returnVals;
+		std::string oldFuncName = funcName;
+
+		FunctionType * type = functionDecl->get_functionType();
+		returnVals = type->get_returnVals();
+		funcName = functionDecl->get_name();
+		DeclarationWithType * decl = Mutator::mutate( functionDecl );
+		returnVals = oldReturnVals;
+		funcName = oldFuncName;
+		return decl;
+	}
+
+
+	void CtorDtor::generateCtorDtor( std::list< Declaration * > & translationUnit ) {
+		CtorDtor ctordtor;
+		mutateAll( translationUnit, ctordtor );
+	}
+
+	namespace {
+		bool tryConstruct( ObjectDecl * objDecl ) {
+			// xxx - handle designations
+			return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) &&
+	 			(objDecl->get_init() == NULL ||
+				( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() ));
+		}
+
+		Expression * makeCtorDtorExpr( std::string name, ObjectDecl * objDecl, std::list< Expression * > args ) {
+			UntypedExpr * expr = new UntypedExpr( new NameExpr( name ) );
+			expr->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
+			expr->get_args().splice( expr->get_args().end(), args );
+			return expr;
+		}
+
+		class InitExpander : public Visitor {
+		  public:
+		  InitExpander() {}
+		  // ~InitExpander() {}
+			virtual void visit( SingleInit * singleInit );
+			virtual void visit( ListInit * listInit );
+			std::list< Expression * > argList;
+		};
+
+		void InitExpander::visit( SingleInit * singleInit ) {
+			argList.push_back( singleInit->get_value()->clone() );
+		}
+
+		void InitExpander::visit( ListInit * listInit ) {
+			// xxx - for now, assume no nested list inits
+			std::list<Initializer*>::iterator it = listInit->begin_initializers();
+			for ( ; it != listInit->end_initializers(); ++it ) {
+				(*it)->accept( *this );
+			}
+		}
+
+		std::list< Expression * > makeInitList( Initializer * init ) {
+			InitExpander expander;
+			maybeAccept( init, expander );
+			return expander.argList;
+		}
+	}
+
+	DeclarationWithType * CtorDtor::mutate( ObjectDecl * objDecl ) {
+		// hands off if designated or if @=
+		if ( tryConstruct( objDecl ) ) {
+			if ( inFunction ) {
+				if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->get_type() ) ) {
+					// call into makeArrayFunction from validate.cc to generate calls to ctor/dtor for each element of array
+					// TODO: walk initializer and generate appropriate copy ctor if element has initializer
+					std::list< Statement * > ctor;
+					std::list< Statement * > dtor;
+
+					SymTab::makeArrayFunction( NULL, new VariableExpr( objDecl ), at, "?{}", back_inserter( ctor ) );
+					SymTab::makeArrayFunction( NULL, new VariableExpr( objDecl ), at, "^?{}", front_inserter( dtor ), false );
+
+					// Currently makeArrayFunction produces a single Statement - a CompoundStmt
+					// which  wraps everything that needs to happen. As such, it's technically
+					// possible to use a Statement ** in the above calls, but this is inherently
+					// unsafe, so instead we take the slightly less efficient route, but will be
+					// immediately informed if somehow the above assumption is broken. In this case,
+					// we could always wrap the list of statements at this point with a CompoundStmt,
+					// but it seems reasonable at the moment for this to be done by makeArrayFunction
+					// itself
+					assert( ctor.size() == 1 );
+					assert( dtor.size() == 1 );
+
+					objDecl->set_init( new ConstructorInit( ctor.front(), dtor.front(), objDecl->get_init() ) );
+				} else {
+					// it's sufficient to attempt to call the ctor/dtor for the given object and its initializer
+					Expression * ctor = makeCtorDtorExpr( "?{}", objDecl, makeInitList( objDecl->get_init() ) );
+					Expression * dtor = makeCtorDtorExpr( "^?{}", objDecl, std::list< Expression * >() );
+
+					// need to remember init expression, in case no ctors exist
+					// if ctor does exist, want to use ctor expression instead of init
+					// push this decision to the resolver
+					ExprStmt * ctorStmt = new ExprStmt( noLabels, ctor );
+					ExprStmt * dtorStmt = new ExprStmt( noLabels, dtor );
+					objDecl->set_init( new ConstructorInit( ctorStmt, dtorStmt, objDecl->get_init() ) );
+				}
+			} else {
+				// xxx - find a way to construct/destruct globals
+				// hack: implicit "static" initialization routine for each struct type? or something similar?
+				// --ties into module system
+				// this can be done by mangling main and replacing it with our own main which calls each
+				// module initialization routine in some decided order (order given in link command?)
+				// and finally calls mangled main
+			}
+		}
+		return Mutator::mutate( objDecl );
+	}
+
+	DeclarationWithType * CtorDtor::mutate( FunctionDecl *functionDecl ) {
+		// parameters should not be constructed and destructed, so don't mutate FunctionType
+		bool oldInFunc = inFunction;
+		mutateAll( functionDecl->get_oldDecls(), *this );
+		inFunction = true;
+		functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
+		inFunction = oldInFunc;
+		return functionDecl;
+	}
+
+	// should not traverse into any of these declarations to find objects
+	// that need to be constructed or destructed
+	Declaration* CtorDtor::mutate( StructDecl *aggregateDecl ) { return aggregateDecl; }
+	Declaration* CtorDtor::mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }
+	Declaration* CtorDtor::mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }
+	Declaration* CtorDtor::mutate( TraitDecl *aggregateDecl ) { return aggregateDecl; }
+	TypeDecl* CtorDtor::mutate( TypeDecl *typeDecl ) { return typeDecl; }
+	Declaration* CtorDtor::mutate( TypedefDecl *typeDecl ) { return typeDecl; }
+	Type* CtorDtor::mutate( FunctionType *funcType ) { return funcType; }
+
+} // namespace InitTweak
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/InitTweak/GenInit.h
===================================================================
--- src/InitTweak/GenInit.h	(revision a0fdbd51112d9506c6a29aefc759d19bbb0828fe)
+++ src/InitTweak/GenInit.h	(revision a0fdbd51112d9506c6a29aefc759d19bbb0828fe)
@@ -0,0 +1,37 @@
+//
+// 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.
+//
+// RemoveInit.h --
+//
+// Author           : Rodolfo G. Esteves
+// Created On       : Mon May 18 07:44:20 2015
+// Last Modified By : Rob Schluntz
+// Last Modified On : Thu Apr 28 12:22:09 2016
+// Update Count     : 3
+//
+
+#ifndef GEN_INIT_H
+#define GEN_INIT_H
+
+#include <string>
+#include <list>
+
+#include "SynTree/SynTree.h"
+#include "SynTree/Declaration.h"
+#include "SynTree/Mutator.h"
+
+namespace InitTweak {
+	/// Adds return value temporaries and wraps Initializers in ConstructorInit nodes
+	void genInit( std::list< Declaration * > & translationUnit );
+} // namespace
+
+#endif // GENPOLY_POLYMUTATOR_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: c/InitTweak/RemoveInit.cc
===================================================================
--- src/InitTweak/RemoveInit.cc	(revision 84bb4d9e5e8e19a101f959de114293008192d69a)
+++ 	(revision )
@@ -1,267 +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.
-//
-// RemoveInit.cc --
-//
-// Author           : Rob Schluntz
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Thu Apr 14 15:09:36 2016
-// Update Count     : 166
-//
-
-#include <stack>
-#include <list>
-#include "RemoveInit.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Mutator.h"
-#include "SymTab/Autogen.h"
-#include "GenPoly/PolyMutator.h"
-
-namespace InitTweak {
-	namespace {
-		const std::list<Label> noLabels;
-		const std::list<Expression *> noDesignators;
-	}
-
-	class RemoveInit : public GenPoly::PolyMutator {
-	  public:
-		/// removes and replaces initialization for polymorphic value objects
-		/// with assignment (TODO: constructor) statements.
-		/// also consistently allocates a temporary variable for the return value
-		/// of a function so that anything which the resolver decides can be assigned
-		/// into the return type of a function can be returned.
-		static void removeInitializers( std::list< Declaration * > &translationUnit );
-
-		RemoveInit();
-
-		virtual ObjectDecl * mutate( ObjectDecl *objDecl );
-		virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
-
-		virtual Statement * mutate( ReturnStmt * returnStmt );
-
-	  protected:
-		std::list<DeclarationWithType*> returnVals;
-		UniqueName tempNamer;
-		std::string funcName;
-	};
-
-	class CtorDtor : public GenPoly::PolyMutator {
-	  public:
-		/// create constructor and destructor statements for object declarations.
-		/// Destructors are inserted directly into the code, whereas constructors
-		/// will be added in after the resolver has run so that the initializer expression
-		/// is only removed if a constructor is found
-		static void generateCtorDtor( std::list< Declaration * > &translationUnit );
-
-		CtorDtor() : inFunction( false ) {}
-
-		virtual DeclarationWithType * mutate( ObjectDecl * );
-		virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
-		virtual Declaration* mutate( StructDecl *aggregateDecl );
-		virtual Declaration* mutate( UnionDecl *aggregateDecl );
-		virtual Declaration* mutate( EnumDecl *aggregateDecl );
-		virtual Declaration* mutate( TraitDecl *aggregateDecl );
-		virtual TypeDecl* mutate( TypeDecl *typeDecl );
-		virtual Declaration* mutate( TypedefDecl *typeDecl );
-
-		virtual Type * mutate( FunctionType *funcType );
-
-	  protected:
-		bool inFunction;
-	};
-
-	void tweak( std::list< Declaration * > & translationUnit ) {
-		RemoveInit::removeInitializers( translationUnit );
-		CtorDtor::generateCtorDtor( translationUnit );
-	}
-
-	void RemoveInit::removeInitializers( std::list< Declaration * > & translationUnit ) {
-		RemoveInit remover;
-		mutateAll( translationUnit, remover );
-	}
-
-	RemoveInit::RemoveInit() : tempNamer( "_retVal" ) {}
-
-	// in the case where an object has an initializer and a polymorphic type, insert an assignment immediately after the
-	// declaration. This will (seemingly) cause the later phases to do the right thing with the assignment
-	ObjectDecl *RemoveInit::mutate( ObjectDecl *objDecl ) {
-		if (objDecl->get_init() && dynamic_cast<TypeInstType*>(objDecl->get_type())) {
-			if (SingleInit * single = dynamic_cast<SingleInit*>(objDecl->get_init())) {
-				// xxx this can be more complicated - consider ListInit
-				UntypedExpr *assign = new UntypedExpr( new NameExpr( "?{}" ) );
-				assign->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
-				assign->get_args().push_back( single->get_value()->clone() );
-				stmtsToAddAfter.push_back(new ExprStmt(noLabels, assign));
-			} // if
-		} // if
-		return objDecl;
-	}
-
-	Statement *RemoveInit::mutate( ReturnStmt *returnStmt ) {
-		// update for multiple return values
-		assert( returnVals.size() == 0 || returnVals.size() == 1 );
-		// hands off if the function returns an lvalue - we don't want to allocate a temporary if a variable's address
-		// is being returned
-		if ( returnStmt->get_expr() && returnVals.size() == 1 && funcName != "?=?" && ! returnVals.front()->get_type()->get_isLvalue() ) {
-			// ensure return value is not destructed by explicitly creating
-			// an empty SingleInit node wherein maybeConstruct is false
-			ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, returnVals.front()->get_type()->clone(), new ListInit( std::list<Initializer*>(), noDesignators, false ) );
-			stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
-
-			// and explicitly create the constructor expression separately
-			UntypedExpr *construct = new UntypedExpr( new NameExpr( "?{}" ) );
-			construct->get_args().push_back( new AddressExpr( new VariableExpr( newObj ) ) );
-			construct->get_args().push_back( returnStmt->get_expr() );
-			stmtsToAdd.push_back(new ExprStmt(noLabels, construct));
-
-			returnStmt->set_expr( new VariableExpr( newObj ) );
-		} // if
-		return returnStmt;
-	}
-
-	DeclarationWithType* RemoveInit::mutate( FunctionDecl *functionDecl ) {
-		std::list<DeclarationWithType*> oldReturnVals = returnVals;
-		std::string oldFuncName = funcName;
-
-		FunctionType * type = functionDecl->get_functionType();
-		returnVals = type->get_returnVals();
-		funcName = functionDecl->get_name();
-		DeclarationWithType * decl = Mutator::mutate( functionDecl );
-		returnVals = oldReturnVals;
-		funcName = oldFuncName;
-		return decl;
-	}
-
-
-	void CtorDtor::generateCtorDtor( std::list< Declaration * > & translationUnit ) {
-		CtorDtor ctordtor;
-		mutateAll( translationUnit, ctordtor );
-	}
-
-	namespace {
-		bool tryConstruct( ObjectDecl * objDecl ) {
-			// xxx - handle designations
-			return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) &&
-	 			(objDecl->get_init() == NULL ||
-				( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() ));
-		}
-
-		Expression * makeCtorDtorExpr( std::string name, ObjectDecl * objDecl, std::list< Expression * > args ) {
-			UntypedExpr * expr = new UntypedExpr( new NameExpr( name ) );
-			expr->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
-			expr->get_args().splice( expr->get_args().end(), args );
-			return expr;
-		}
-
-		class InitExpander : public Visitor {
-		  public:
-		  InitExpander() {}
-		  // ~InitExpander() {}
-			virtual void visit( SingleInit * singleInit );
-			virtual void visit( ListInit * listInit );
-			std::list< Expression * > argList;
-		};
-
-		void InitExpander::visit( SingleInit * singleInit ) {
-			argList.push_back( singleInit->get_value()->clone() );
-		}
-
-		void InitExpander::visit( ListInit * listInit ) {
-			// xxx - for now, assume no nested list inits
-			std::list<Initializer*>::iterator it = listInit->begin_initializers();
-			for ( ; it != listInit->end_initializers(); ++it ) {
-				(*it)->accept( *this );
-			}
-		}
-
-		std::list< Expression * > makeInitList( Initializer * init ) {
-			InitExpander expander;
-			maybeAccept( init, expander );
-			return expander.argList;
-		}
-	}
-
-	DeclarationWithType * CtorDtor::mutate( ObjectDecl * objDecl ) {
-		// hands off if designated or if @=
-		if ( tryConstruct( objDecl ) ) {
-			if ( inFunction ) {
-				if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->get_type() ) ) {
-					// call into makeArrayFunction from validate.cc to generate calls to ctor/dtor for each element of array
-					// TODO: walk initializer and generate appropriate copy ctor if element has initializer
-					std::list< Statement * > ctor;
-					std::list< Statement * > dtor;
-
-					SymTab::makeArrayFunction( NULL, new VariableExpr( objDecl ), at, "?{}", back_inserter( ctor ) );
-					SymTab::makeArrayFunction( NULL, new VariableExpr( objDecl ), at, "^?{}", front_inserter( dtor ), false );
-
-					// Currently makeArrayFunction produces a single Statement - a CompoundStmt
-					// which  wraps everything that needs to happen. As such, it's technically
-					// possible to use a Statement ** in the above calls, but this is inherently
-					// unsafe, so instead we take the slightly less efficient route, but will be
-					// immediately informed if somehow the above assumption is broken. In this case,
-					// we could always wrap the list of statements at this point with a CompoundStmt,
-					// but it seems reasonable at the moment for this to be done by makeArrayFunction
-					// itself
-					assert( ctor.size() == 1 );
-					assert( dtor.size() == 1 );
-
-					objDecl->set_init( new ConstructorInit( ctor.front(), dtor.front(), objDecl->get_init() ) );
-				} else {
-					// it's sufficient to attempt to call the ctor/dtor for the given object and its initializer
-					Expression * ctor = makeCtorDtorExpr( "?{}", objDecl, makeInitList( objDecl->get_init() ) );
-					Expression * dtor = makeCtorDtorExpr( "^?{}", objDecl, std::list< Expression * >() );
-
-					// need to remember init expression, in case no ctors exist
-					// if ctor does exist, want to use ctor expression instead of init
-					// push this decision to the resolver
-					ExprStmt * ctorStmt = new ExprStmt( noLabels, ctor );
-					ExprStmt * dtorStmt = new ExprStmt( noLabels, dtor );
-					objDecl->set_init( new ConstructorInit( ctorStmt, dtorStmt, objDecl->get_init() ) );
-				}
-			} else {
-				// xxx - find a way to construct/destruct globals
-				// hack: implicit "static" initialization routine for each struct type? or something similar?
-				// --ties into module system
-				// this can be done by mangling main and replacing it with our own main which calls each
-				// module initialization routine in some decided order (order given in link command?)
-				// and finally calls mangled main
-			}
-		}
-		return Mutator::mutate( objDecl );
-	}
-
-	DeclarationWithType * CtorDtor::mutate( FunctionDecl *functionDecl ) {
-		// parameters should not be constructed and destructed, so don't mutate FunctionType
-		bool oldInFunc = inFunction;
-		mutateAll( functionDecl->get_oldDecls(), *this );
-		inFunction = true;
-		functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
-		inFunction = oldInFunc;
-		return functionDecl;
-	}
-
-	// should not traverse into any of these declarations to find objects
-	// that need to be constructed or destructed
-	Declaration* CtorDtor::mutate( StructDecl *aggregateDecl ) { return aggregateDecl; }
-	Declaration* CtorDtor::mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }
-	Declaration* CtorDtor::mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }
-	Declaration* CtorDtor::mutate( TraitDecl *aggregateDecl ) { return aggregateDecl; }
-	TypeDecl* CtorDtor::mutate( TypeDecl *typeDecl ) { return typeDecl; }
-	Declaration* CtorDtor::mutate( TypedefDecl *typeDecl ) { return typeDecl; }
-	Type* CtorDtor::mutate( FunctionType *funcType ) { return funcType; }
-
-} // namespace InitTweak
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: c/InitTweak/RemoveInit.h
===================================================================
--- src/InitTweak/RemoveInit.h	(revision 84bb4d9e5e8e19a101f959de114293008192d69a)
+++ 	(revision )
@@ -1,37 +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.
-//
-// RemoveInit.h --
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Mon Jan 11 16:02:44 2016
-// Update Count     : 3
-//
-
-#ifndef REMOVE_INIT_H
-#define REMOVE_INIT_H
-
-#include <string>
-#include <list>
-
-#include "SynTree/SynTree.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Mutator.h"
-
-namespace InitTweak {
-	/// Adds assignment statements for polymorphic type initializers
-	void tweak( std::list< Declaration * > & translationUnit );
-} // namespace
-
-#endif // GENPOLY_POLYMUTATOR_H
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/InitTweak/module.mk
===================================================================
--- src/InitTweak/module.mk	(revision 84bb4d9e5e8e19a101f959de114293008192d69a)
+++ src/InitTweak/module.mk	(revision a0fdbd51112d9506c6a29aefc759d19bbb0828fe)
@@ -11,8 +11,8 @@
 ## Created On       : Mon Jun  1 17:49:17 2015
 ## Last Modified By : Rob Schluntz
-## Last Modified On : Wed Jan 13 16:29:03 2016
+## Last Modified On : Thu Apr 28 12:23:17 2016
 ## Update Count     : 3
 ###############################################################################
 
-SRC += InitTweak/RemoveInit.cc \
+SRC += InitTweak/GenInit.cc \
 	InitTweak/FixInit.cc
Index: src/Makefile.in
===================================================================
--- src/Makefile.in	(revision 84bb4d9e5e8e19a101f959de114293008192d69a)
+++ src/Makefile.in	(revision a0fdbd51112d9506c6a29aefc759d19bbb0828fe)
@@ -123,5 +123,5 @@
 	GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT) \
 	GenPoly/driver_cfa_cpp-DeclMutator.$(OBJEXT) \
-	InitTweak/driver_cfa_cpp-RemoveInit.$(OBJEXT) \
+	InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT) \
 	InitTweak/driver_cfa_cpp-FixInit.$(OBJEXT) \
 	Parser/driver_cfa_cpp-parser.$(OBJEXT) \
@@ -347,5 +347,5 @@
 	GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc GenPoly/Specialize.cc \
 	GenPoly/CopyParams.cc GenPoly/FindFunction.cc \
-	GenPoly/DeclMutator.cc InitTweak/RemoveInit.cc \
+	GenPoly/DeclMutator.cc InitTweak/GenInit.cc \
 	InitTweak/FixInit.cc Parser/parser.yy Parser/lex.ll \
 	Parser/TypedefTable.cc Parser/ParseNode.cc \
@@ -565,6 +565,6 @@
 	@$(MKDIR_P) InitTweak/$(DEPDIR)
 	@: > InitTweak/$(DEPDIR)/$(am__dirstamp)
-InitTweak/driver_cfa_cpp-RemoveInit.$(OBJEXT):  \
-	InitTweak/$(am__dirstamp) InitTweak/$(DEPDIR)/$(am__dirstamp)
+InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT): InitTweak/$(am__dirstamp) \
+	InitTweak/$(DEPDIR)/$(am__dirstamp)
 InitTweak/driver_cfa_cpp-FixInit.$(OBJEXT): InitTweak/$(am__dirstamp) \
 	InitTweak/$(DEPDIR)/$(am__dirstamp)
@@ -801,5 +801,5 @@
 	-rm -f GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT)
 	-rm -f InitTweak/driver_cfa_cpp-FixInit.$(OBJEXT)
-	-rm -f InitTweak/driver_cfa_cpp-RemoveInit.$(OBJEXT)
+	-rm -f InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT)
 	-rm -f Parser/driver_cfa_cpp-DeclarationNode.$(OBJEXT)
 	-rm -f Parser/driver_cfa_cpp-ExpressionNode.$(OBJEXT)
@@ -908,5 +908,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-RemoveInit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Po@am__quote@
@@ -1378,17 +1378,17 @@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-DeclMutator.obj `if test -f 'GenPoly/DeclMutator.cc'; then $(CYGPATH_W) 'GenPoly/DeclMutator.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/DeclMutator.cc'; fi`
 
-InitTweak/driver_cfa_cpp-RemoveInit.o: InitTweak/RemoveInit.cc
-@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-RemoveInit.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-RemoveInit.Tpo -c -o InitTweak/driver_cfa_cpp-RemoveInit.o `test -f 'InitTweak/RemoveInit.cc' || echo '$(srcdir)/'`InitTweak/RemoveInit.cc
-@am__fastdepCXX_TRUE@	$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-RemoveInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-RemoveInit.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='InitTweak/RemoveInit.cc' object='InitTweak/driver_cfa_cpp-RemoveInit.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-RemoveInit.o `test -f 'InitTweak/RemoveInit.cc' || echo '$(srcdir)/'`InitTweak/RemoveInit.cc
-
-InitTweak/driver_cfa_cpp-RemoveInit.obj: InitTweak/RemoveInit.cc
-@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-RemoveInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-RemoveInit.Tpo -c -o InitTweak/driver_cfa_cpp-RemoveInit.obj `if test -f 'InitTweak/RemoveInit.cc'; then $(CYGPATH_W) 'InitTweak/RemoveInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/RemoveInit.cc'; fi`
-@am__fastdepCXX_TRUE@	$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-RemoveInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-RemoveInit.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='InitTweak/RemoveInit.cc' object='InitTweak/driver_cfa_cpp-RemoveInit.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-RemoveInit.obj `if test -f 'InitTweak/RemoveInit.cc'; then $(CYGPATH_W) 'InitTweak/RemoveInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/RemoveInit.cc'; fi`
+InitTweak/driver_cfa_cpp-GenInit.o: InitTweak/GenInit.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-GenInit.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo -c -o InitTweak/driver_cfa_cpp-GenInit.o `test -f 'InitTweak/GenInit.cc' || echo '$(srcdir)/'`InitTweak/GenInit.cc
+@am__fastdepCXX_TRUE@	$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='InitTweak/GenInit.cc' object='InitTweak/driver_cfa_cpp-GenInit.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-GenInit.o `test -f 'InitTweak/GenInit.cc' || echo '$(srcdir)/'`InitTweak/GenInit.cc
+
+InitTweak/driver_cfa_cpp-GenInit.obj: InitTweak/GenInit.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-GenInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo -c -o InitTweak/driver_cfa_cpp-GenInit.obj `if test -f 'InitTweak/GenInit.cc'; then $(CYGPATH_W) 'InitTweak/GenInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/GenInit.cc'; fi`
+@am__fastdepCXX_TRUE@	$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='InitTweak/GenInit.cc' object='InitTweak/driver_cfa_cpp-GenInit.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-GenInit.obj `if test -f 'InitTweak/GenInit.cc'; then $(CYGPATH_W) 'InitTweak/GenInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/GenInit.cc'; fi`
 
 InitTweak/driver_cfa_cpp-FixInit.o: InitTweak/FixInit.cc
Index: src/main.cc
===================================================================
--- src/main.cc	(revision 84bb4d9e5e8e19a101f959de114293008192d69a)
+++ src/main.cc	(revision a0fdbd51112d9506c6a29aefc759d19bbb0828fe)
@@ -10,5 +10,5 @@
 // Created On       : Fri May 15 23:12:02 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Mon Apr 11 17:49:38 2016
+// Last Modified On : Thu Apr 28 12:24:46 2016
 // Update Count     : 200
 //
@@ -40,5 +40,5 @@
 #include "MakeLibCfa.h"
 #include "InitTweak/Mutate.h"
-#include "InitTweak/RemoveInit.h"
+#include "InitTweak/GenInit.h"
 #include "InitTweak/FixInit.h"
 //#include "Explain/GenProlog.h"
@@ -259,5 +259,5 @@
 		CodeGen::fixNames( translationUnit );
 		OPTPRINT( "tweakInit" )
-		InitTweak::tweak( translationUnit );
+		InitTweak::genInit( translationUnit );
 
 		if ( libcfap ) {
