Index: src/Tuples/AssignExpand.cc
===================================================================
--- src/Tuples/AssignExpand.cc	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,148 +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.
-//
-// AssignExpand.cc -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 13 08:16:39 2015
-// Update Count     : 4
-//
-
-#include <ctime>
-#include <cstdlib>
-
-#include <list>
-#include <cassert>
-#include <algorithm>
-
-#include "AssignExpand.h"
-
-#include "Parser/ParseNode.h"
-
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-
-namespace Tuples {
-	AssignExpander::AssignExpander() : temporaryNamer("__tpl") {}
-
-	Statement *AssignExpander::mutate( ExprStmt *exprStmt ) {
-		replace.clear();
-		extra.clear();
-		extra2.clear();
-		exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), *this ) );
-
-		CompoundStmt *newSt = 0;
-		if ( ! extra.empty() ) {
-			if ( ! newSt )
-				newSt= new CompoundStmt(std::list<Label>());
-
-			newSt->get_kids().splice(newSt->get_kids().end(), extra);
-		} // if
-
-		if ( ! extra2.empty() ) {
-			if ( ! newSt )
-				newSt= new CompoundStmt(std::list<Label>());
-
-			newSt->get_kids().splice(newSt->get_kids().end(), extra2);
-		}
-
-		if ( ! replace.empty() ) {
-			if ( ! newSt )
-				newSt= new CompoundStmt(std::list<Label>());
-
-			for ( std::list<Expression *>::iterator r = replace.begin(); r != replace.end(); r++ )
-				newSt->get_kids().push_back( new ExprStmt( std::list<Label>(), *r ));
-		}
-
-		if ( newSt ) return newSt; else return exprStmt;
-	}
-
-	Expression *AssignExpander::mutate( SolvedTupleExpr *tupleExpr ) {
-		/* 
-		   std::list<Expression *> &exprs = tupleExpr->get_exprs();
-
-		   if ( tupleExpr->get_type() == SolvedTupleExpr::MASS ) {
-		   // extract lhs of assignments, assert that rhs is the same, create temporaries
-		   assert ( ! exprs.empty());
-		   ApplicationExpr *ap1 = dynamic_cast< ApplicationExpr * >( exprs.front() );
-		   std::list<Expression *> &args = ap1->get_args();
-		   assert(args.size() == 2);
-		   std::list<Type *> &temp_types = args.back()->get_results();
-		   assert(temp_types.size() == 1);
-		   extra.push_back(new DeclStmt( std::list<Label>(), new ObjectDecl(temporaryNamer.newName(), Declaration::Auto, LinkageSpec::C, 0, temp_types.front(), 0 ) ));
-
-		   for ( std::list<Expression *>::iterator e = exprs.begin(); e != exprs.end(); e++ ) {
-		   ApplicationExpr *ap = dynamic_cast< ApplicationExpr * >( *e );
-		   assert( ap != 0 );
-		   replace.push_back(ap);
-		   }
-
-		   return tupleExpr;
-		   } else if ( tupleExpr->get_type() == SolvedTupleExpr::MULTIPLE ||
-		   tupleExpr->get_type() == SolvedTupleExpr::MASS ) */ {
-			std::list<Expression *> &comps = tupleExpr->get_exprs();
-			for ( std::list<Expression *>::iterator i = comps.begin(); i != comps.end(); ++i ) {
-				std::list<Statement *> decls;
-				std::list<Statement *> temps;
-				std::list<Statement *> assigns;
-				if ( ApplicationExpr *app = dynamic_cast< ApplicationExpr * >(*i) ) {
-					assert( app->get_args().size() == 2 );
-
-					Expression *lhsT = app->get_args().front();
-					Expression *rhsT = app->get_args().back();
-					// after the round of type analysis this should be true
-					assert( lhsT->get_results().size() == 1 );
-					assert( rhsT->get_results().size() == 1 );
-					// declare temporaries
-					ObjectDecl *lhs = new ObjectDecl( temporaryNamer.newName("_lhs_"), DeclarationNode::NoStorageClass, LinkageSpec::Intrinsic, 0,
-													  lhsT->get_results().front(), 0 );
-					decls.push_back( new DeclStmt( std::list< Label >(), lhs ) );
-					ObjectDecl *rhs = new ObjectDecl( temporaryNamer.newName("_rhs_"), DeclarationNode::NoStorageClass, LinkageSpec::Intrinsic, 0,
-													  rhsT->get_results().front(), 0);
-					decls.push_back( new DeclStmt( std::list< Label >(), rhs ));
-
-
-					// create temporary for lhs, assign address
-					UntypedExpr *assgnL = new UntypedExpr( new NameExpr( "?=?" ) );
-					assgnL->get_args().push_back( new VariableExpr( lhs ) );
-					assgnL->get_args().push_back( lhsT );
-					temps.push_back( new ExprStmt(std::list<Label>(), assgnL) );
-
-					// create temporary for rhs, assign value
-					UntypedExpr *assgnR = new UntypedExpr( new NameExpr( "?=?" ) );
-					assgnR->get_args().push_back( new VariableExpr( rhs ) );
-					assgnR->get_args().push_back( rhsT );
-					temps.push_back( new ExprStmt(std::list<Label>(), assgnR) );
-
-					// assign rhs to lhs
-					UntypedExpr *assgn = new UntypedExpr( new NameExpr( "?=?" ) );
-					UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) );
-					deref->get_args().push_back( new VariableExpr( lhs ) );
-					assgn->get_args().push_back( deref );
-					assgn->get_args().push_back( new VariableExpr( rhs ) );
-					assigns.push_back( new ExprStmt(std::list<Label>(), assgn) );
-				} else
-					throw CompilerError("Solved Tuple should contain only assignment statements");
-	  
-				extra.splice( extra.begin(), decls );
-				extra.splice( extra.end(), temps );
-				extra2.splice( extra2.end(), assigns );
-			} // for
-			return tupleExpr;
-		}
-		throw 0; // shouldn't be here
-	}
-} // namespace Tuples
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/AssignExpand.h
===================================================================
--- src/Tuples/AssignExpand.h	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,48 +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.
-//
-// AssignExpand.h -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 11:25:53 2015
-// Update Count     : 3
-//
-
-#ifndef _ASSIGN_EXPAND_H_
-#define _ASSIGN_EXPAND_H_
-
-#include <cstdlib>
-
-#include "SynTree/Mutator.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Expression.h"
-
-#include "Common/UniqueName.h"
-
-namespace Tuples {
-	class AssignExpander : public Mutator {
-		typedef Mutator Parent;
-	  public:
-		AssignExpander();
-		virtual Statement *mutate( ExprStmt *expr );
-		virtual Expression *mutate( SolvedTupleExpr *tupleExpr );
-	  private:
-		std::list<Statement *> extra, extra2;
-		std::list<Expression *> replace;
-		UniqueName temporaryNamer;
-	};
-} // namespace Tuples
-
-
-#endif // _ASSIGN_EXPAND_H_
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/FlattenTuple.cc
===================================================================
--- src/Tuples/FlattenTuple.cc	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,69 +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.
-//
-// FlattenTuple.cc -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 11:26:56 2015
-// Update Count     : 1
-//
-
-#include <list>
-#include <vector>
-#include <cassert>
-#include <algorithm>
-
-#include "FlattenTuple.h"
-
-namespace Tuples {
-	FlattenTuple::FlattenTuple() {
-	}
-
-	FlattenTuple::~FlattenTuple() {
-	}
-
-	Expression *FlattenTuple::mutate( TupleExpr *tupleExpr ) {
-		CollectArgs c;
-
-		acceptAll( tupleExpr->get_exprs(), c );
-		tupleExpr->set_exprs( c.get_args() );
-
-		return tupleExpr;
-	}
-
-	void FlattenTuple::CollectArgs::visit( UntypedExpr         *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( NameExpr            *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( CastExpr            *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( AddressExpr         *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( UntypedMemberExpr   *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( MemberExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( VariableExpr        *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( ConstantExpr        *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( SizeofExpr          *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( AlignofExpr         *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( UntypedOffsetofExpr *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( OffsetofExpr        *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( OffsetPackExpr      *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( AttrExpr            *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( LogicalExpr         *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( ConditionalExpr     *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( CommaExpr           *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( TypeExpr            *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-	void FlattenTuple::CollectArgs::visit( UntypedValofExpr    *expr )  {  currentArgs.insert( currentArgs.end(), expr );  }
-
-	void FlattenTuple::CollectArgs::visit( TupleExpr *tupleExpr) {
-		acceptAll( tupleExpr->get_exprs(), *this );
-		//currentArgs.splice( currentArgs.end(), c.get_args() );
-	}
-} // namespace Tuples
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/FlattenTuple.h
===================================================================
--- src/Tuples/FlattenTuple.h	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,71 +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.
-//
-// FlattenTuple.h -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 11:28:15 2015
-// Update Count     : 3
-//
-
-#ifndef _FLATTEN_TUPLE_H_
-#define _FLATTEN_TUPLE_H_
-
-#include "SynTree/Mutator.h"
-#include "SynTree/Visitor.h"
-
-#include "SynTree/Expression.h"
-
-namespace Tuples {
-	class FlattenTuple : public Mutator {
-		typedef Mutator Parent;
-	  public:
-		FlattenTuple();
-		~FlattenTuple();
-
-		virtual Expression *mutate( TupleExpr *tupleExpr );
-	  private:
-		class CollectArgs : public Visitor {
-		  public:
-			virtual void visit( UntypedExpr * );
-			virtual void visit( NameExpr * );
-			virtual void visit( CastExpr *);
-			virtual void visit( AddressExpr * );
-			virtual void visit( UntypedMemberExpr * );
-			virtual void visit( MemberExpr * );
-			virtual void visit( VariableExpr * );
-			virtual void visit( ConstantExpr * ); 
-			virtual void visit( SizeofExpr * );
-			virtual void visit( AlignofExpr * );
-			virtual void visit( UntypedOffsetofExpr * );
-			virtual void visit( OffsetofExpr * );
-			virtual void visit( OffsetPackExpr * );
-			virtual void visit( AttrExpr * );
-			virtual void visit( LogicalExpr * );
-			virtual void visit( ConditionalExpr * );
-			virtual void visit( CommaExpr * );
-			virtual void visit( TypeExpr * );
-			virtual void visit( UntypedValofExpr * );
-
-			virtual void visit( TupleExpr *tupleExpr );
-
-			std::list< Expression *> &get_args() { return currentArgs; }
-		  private:
-			std::list< Expression * > currentArgs;
-		};
-
-	};
-} // namespace Tuples
-
-#endif // _FLATTEN_TUPLE_H_
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/FunctionChecker.cc
===================================================================
--- src/Tuples/FunctionChecker.cc	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,141 +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.
-//
-// FunctionChecker.cc -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 13 08:17:19 2015
-// Update Count     : 4
-//
-
-#include "FunctionChecker.h"
-#include "FunctionFixer.h"
-#include "Common/SemanticError.h"
-
-#include <algorithm>
-#include <iostream>
-#include <cassert>
-
-namespace Tuples {
-	using namespace std;
-
-	void checkFunctions( std::list< Declaration * > translationUnit ) {
-		FunctionChecker fchk( true );
-		TupleDistrib td;
-		FunctionFixer ff;
-
-		mutateAll( translationUnit , fchk );
-		mutateAll( translationUnit , ff );
-		mutateAll( translationUnit , td );
-		return;
-	}
-
-	FunctionChecker::FunctionChecker( bool _topLevel, UniqueName *_nameGen ) : topLevel( _topLevel ), nameGen( _nameGen ) {
-		if ( topLevel ) {
-			assert( ! nameGen );
-			nameGen = new UniqueName("_MVR_");
-		} else
-			assert( nameGen );
-	}
-
-	FunctionChecker::~FunctionChecker() {
-		if ( topLevel ) {
-			delete nameGen;
-			nameGen = 0;
-		}
-	}
-
-	Statement* FunctionChecker::mutate( ExprStmt *exprStmt ) {
-		exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), *this ) );
-		if ( ! tempExpr.empty() ) {
-			assert ( ! temporaries.empty() );
-			CompoundStmt *newBlock = new CompoundStmt( std::list< Label >() );
-			// declarations
-			for ( std::list< ObjectDecl *>::iterator d = temporaries.begin(); d != temporaries.end(); ++d )
-				newBlock->get_kids().push_back( new DeclStmt( std::list<Label>(), *d ) );
-			// new expression statements
-			for ( std::list< Expression *>::iterator e = tempExpr.begin(); e != tempExpr.end(); ++e )
-				newBlock->get_kids().push_back( new ExprStmt( std::list<Label>(), *e ) );
-
-			newBlock->get_kids().push_back( exprStmt );
-			return newBlock;
-		} else
-			return exprStmt;
-	}
-
-	Expression* FunctionChecker::mutate( ApplicationExpr *applicationExpr ) {
-		if ( topLevel )
-			; // In top level of Functionchecker
-
-		if ( applicationExpr->get_results().size() > 1 ) {
-			for ( std::list< Type *>::iterator res = applicationExpr->get_results().begin(); res != applicationExpr->get_results().end(); res++ )
-				temporaries.push_back( new ObjectDecl( nameGen->newName(), DeclarationNode::Auto, LinkageSpec::AutoGen, 0, (*res )->clone(), 0 ) );
-
-			assert( ! temporaries.empty() );
-		}
-
-		applicationExpr->set_function(  maybeMutate( applicationExpr->get_function(), *this ) );
-
-		std::list< Expression * > newArgs;
-		for ( std::list< Expression *>::iterator e = applicationExpr->get_args().begin(); e != applicationExpr->get_args().end(); ++e ) {
-			FunctionChecker rec( false, nameGen );
-			(*e )->acceptMutator( rec );
-
-			if ( ! rec.temporaries.empty() ) {
-				TupleExpr *lhs = new TupleExpr;
-				std::list< Expression * > &tmem = lhs->get_exprs();
-				for ( std::list<ObjectDecl *>::iterator d = rec.temporaries.begin();  d != rec.temporaries.end(); ++d ) {
-					tmem.push_back( new VariableExpr( *d ) );
-					newArgs.push_back( new VariableExpr( *d ) );
-				}
-
-				// construct tuple assignment
-				std::list<Expression *> args;
-				args.push_back( new AddressExpr( lhs ) );
-				args.push_back( *e );
-				tempExpr.push_back( new UntypedExpr( new NameExpr("?=?"), args ) );
-
-				temporaries.splice( temporaries.end(), rec.temporaries );
-			} else
-				newArgs.push_back( *e );
-			// percolate to recursive calls
-		}
-
-		applicationExpr->get_args().clear();
-		std::copy( newArgs.begin(), newArgs.end(), back_inserter( applicationExpr->get_args()) );
-
-		return applicationExpr;
-	}
-
-	Expression* TupleDistrib::mutate( UntypedExpr *expr ) {
-		if (  NameExpr *assgnop = dynamic_cast< NameExpr * >( expr->get_function()) ) {
-			if ( assgnop->get_name() == std::string("?=?") ) {
-				std::list<Expression *> &args = expr->get_args();
-				assert( args.size() == 2 );
-				//if args.front() points to a tuple and if args.back() is already resolved
-				if ( AddressExpr *addr = dynamic_cast<AddressExpr *>( args.front()) )
-					if ( TupleExpr *lhs = dynamic_cast<TupleExpr *>( addr->get_arg()) )
-						if ( ApplicationExpr *rhs = dynamic_cast<ApplicationExpr *>( args.back() ) ) {
-							for ( std::list<Expression *>::iterator tc = lhs->get_exprs().begin(); tc != lhs->get_exprs().end(); ++tc )
-								rhs->get_args().push_back( new AddressExpr( *tc ) );
-							return rhs; // XXX
-						} // if
-			} else
-				assert( false ); // It's not an assignment, shouldn't be here
-		} // if
-		return expr;
-	}
-
-}
-
-// namespace Tuples
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/FunctionChecker.h
===================================================================
--- src/Tuples/FunctionChecker.h	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,64 +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.
-//
-// FunctionChecker.h -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 12:00:57 2015
-// Update Count     : 2
-//
-
-#ifndef _TUPLE_FUNCHK_H_
-#define _TUPLE_FUNCHK_H_
-
-#include <string>
-#include <list>
-#include <iostream>
-
-#include "Common/UniqueName.h"
-
-#include "SynTree/SynTree.h"
-#include "SynTree/Mutator.h"
-
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-
-namespace Tuples {
-	class FunctionChecker : public Mutator {
-		typedef Mutator Parent;
-	  public:
-		FunctionChecker( bool _topLevel = false, UniqueName *_nameGen = 0 );
-		~FunctionChecker();
-
-		virtual Expression* mutate(ApplicationExpr *applicationExpr);
-		virtual Statement* mutate(ExprStmt *exprStmt);
-	  private:
-		bool topLevel;
-		UniqueName *nameGen;
-		std::list< ObjectDecl * > temporaries;
-		std::list< Expression * > tempExpr;
-	};
-
-	class TupleDistrib : public Mutator {
-	  public:
-		virtual Expression* mutate(UntypedExpr *utExpr);
-	  private:
-	};
-
-	void checkFunctions( std::list< Declaration * > translationUnit );
-} // namespace Tuples
-
-#endif // _TUPLE_FUNCHK_H_
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/FunctionFixer.cc
===================================================================
--- src/Tuples/FunctionFixer.cc	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,127 +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.
-//
-// FunctionFixer.cc -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 12:02:22 2015
-// Update Count     : 1
-//
-
-#include <list>
-#include <vector>
-#include <cassert>
-#include <algorithm>
-
-#include "FunctionFixer.h"
-
-namespace Tuples {
-	DeclarationWithType *FunctionFixer::mutate( FunctionDecl *functionDecl ) {
-		functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
-		mutateAll( functionDecl->get_oldDecls(), *this );
-		functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
-		index.visit( functionDecl );
-		rets.clear();
-		return functionDecl;
-	}
-
-	Type *FunctionFixer::mutate( FunctionType *functionType ) {
-		typedef std::list< DeclarationWithType * >  Decls;
-
-		if ( functionType->get_returnVals().size() <= 1 )  return functionType;
-		std::copy( functionType->get_returnVals().begin(), functionType->get_returnVals().end(), back_inserter(rets) );
-
-		Type::Qualifiers qual;
-		for ( Decls::iterator i = rets.begin(); i != rets.end(); i++ ) {
-			(*i)->set_type( new PointerType( qual, (*i)->get_type() ) );
-			functionType->get_parameters().push_back( *i );
-		} // for
-
-		functionType->get_returnVals() = *(new std::list< DeclarationWithType * >());
-
-		functionType->set_isVarArgs( false );
-		return functionType;
-	}
-
-	Statement *FunctionFixer::mutate( ReturnStmt *retStmt ) {
-		bool tupleReturn = false;
-		Expression *rhs = 0;
-		// also check if returning multiple values
-		if ( CastExpr *cst = dynamic_cast<CastExpr *>( retStmt->get_expr() ) ) {
-			if ( ApplicationExpr *app = dynamic_cast<ApplicationExpr *>( cst->get_arg() ) ) {
-				if ( app->get_results().size() > 1 ) { // doesn't need to be ApplicationExpr
-					tupleReturn = true;
-					rhs = app;
-				}
-			} else if ( TupleExpr *t = dynamic_cast<TupleExpr *>( cst->get_arg() ) ) {
-				tupleReturn = true;
-				assert( rets.size() == t->get_exprs().size() ); // stupid check, resolve expression
-				rhs = t;
-			} // if
-
-			if ( tupleReturn ) {
-				assert ( rhs != 0 );
-				std::list< Expression * > lhs;
-				for ( std::list< DeclarationWithType * >::iterator d = rets.begin(); d != rets.end(); ++d ) {
-					std::list<Expression *> largs;
-					largs.push_back(new VariableExpr( *d ));
-					Expression *exp = ResolvExpr::resolveInVoidContext( new CastExpr( new UntypedExpr(new NameExpr("*?"), largs), (*d)->get_type()),
-																		index );
-					lhs.push_back(exp);
-				} // for
-				std::list< Expression * > args;
-				TupleExpr *tlhs = new TupleExpr; tlhs->set_exprs( lhs );
-				args.push_back( new AddressExpr(tlhs) );
-				args.push_back(rhs);
-
-				return new ExprStmt( std::list< Label>(), new UntypedExpr( new NameExpr("?=?"), args ) );
-			} // if
-		} // if
-		/*
-		  else
-		  std::cerr << "Empty return statement" << std::endl;
-		*/
-
-		return retStmt;
-	}
-
-	Expression* FunctionFixer::mutate( VariableExpr *variableExpr ) {
-		if ( rets.empty() ) return variableExpr;
-		mutateAll( variableExpr->get_results(), *this );
-		if ( std::find( rets.begin(), rets.end(), variableExpr->get_var() ) != rets.end() )
-//      if ( PointerType *ptr = dynamic_cast<PointerType *>(variableExpr->get_var()->get_type()) ) {
-			if ( dynamic_cast<PointerType *>(variableExpr->get_var()->get_type()) != 0 ) {
-				std::list<Expression *> largs;
-				largs.push_back( new AddressExpr(variableExpr) );
-				Expression *expr = ResolvExpr::resolveInVoidContext( /*new CastExpr(*/new UntypedExpr( new NameExpr( "*?" ), largs )/*,
-																																	  ptr->get_base()),*/, index);
-				if ( ApplicationExpr *app = dynamic_cast< ApplicationExpr * >( expr ) ) {
-					assert( app->get_args().size() == 1 );
-					app->get_args().pop_front();
-					app->get_args().push_back( variableExpr );
-					return app;
-				}
-			}
-		return variableExpr;
-	}
-
-	/*
-	  Expression* FunctionFixer::mutate(ApplicationExpr *applicationExpr) {
-	  std::cerr << "In Application Expression" << std::endl;
-	  mutateAll( applicationExpr->get_results(), *this );
-	  applicationExpr->set_function(  maybeMutate( applicationExpr->get_function(), *this ) );
-	  mutateAll( applicationExpr->get_args(), *this );
-	  return applicationExpr;
-	  }
-	*/
-} // namespace Tuples
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/FunctionFixer.h
===================================================================
--- src/Tuples/FunctionFixer.h	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,71 +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.
-//
-// FunctionFixer.h -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 14:58:45 2015
-// Update Count     : 3
-//
-
-#ifndef _FUNCTIONFIXER_H_
-#define _FUNCTIONFIXER_H_
-
-#include "SynTree/Mutator.h"
-
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Type.h"
-
-#include "SymTab/Indexer.h"
-#include "ResolvExpr/Resolver.h"
-#include "ResolvExpr/AlternativeFinder.h"
-
-namespace Tuples {
-	class FunctionFixer : public Mutator {
-		typedef Mutator Parent;
-	  public:
-		FunctionFixer() {}
-		virtual ~FunctionFixer() {}
-		virtual Type       *mutate( FunctionType *functionType );
-		virtual Statement  *mutate( ReturnStmt   *retStmt  );
-		virtual DeclarationWithType *mutate( FunctionDecl *functionDecl );
-		virtual Expression *mutate( VariableExpr *variableExpr);
-
-		// indexer runs
-		virtual ObjectDecl     *mutate( ObjectDecl *objectDecl )
-			{ index.visit( objectDecl ); return objectDecl; }
-		virtual TypeDecl       *mutate( TypeDecl *typeDecl )
-			{ index.visit( typeDecl ); return typeDecl; }
-		virtual TypedefDecl    *mutate( TypedefDecl *typeDecl )
-			{ index.visit( typeDecl ); return typeDecl; }
-		virtual StructDecl     *mutate( StructDecl *aggregateDecl )
-			{ index.visit( aggregateDecl ); return aggregateDecl; }
-		virtual UnionDecl      *mutate( UnionDecl *aggregateDecl )
-			{ index.visit( aggregateDecl ); return aggregateDecl; }
-		virtual EnumDecl       *mutate( EnumDecl *aggregateDecl )
-			{ index.visit( aggregateDecl ); return aggregateDecl; }
-
-		virtual Type           *mutate( StructInstType *aggrInst )
-			{ index.visit( aggrInst ); return aggrInst; }
-		virtual Type           *mutate( UnionInstType *aggrInst )
-			{ index.visit( aggrInst ); return aggrInst; }
-	  private:
-		std::list< DeclarationWithType * > rets;
-		SymTab::Indexer index;
-	};
-} // namespace Tuples
-
-#endif // _FUNCTIONFIXER_H_
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/MultRet.cc
===================================================================
--- src/Tuples/MultRet.cc	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,169 +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.
-//
-// MultRet.cc -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jun  8 14:54:44 2015
-// Update Count     : 2
-//
-
-#include <list>
-#include <vector>
-#include <cassert>
-#include <algorithm>
-
-#include "MultRet.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Type.h"
-
-namespace Tuples {
-	MVRMutator::MVRMutator() : newVars( 0 ), newCode( 0 ) {
-	}
-
-	MVRMutator::~MVRMutator() {
-	}
-
-	int MVRMutator::curVal = 0;
-
-	Statement *MVRMutator::mutate( ExprStmt *exprStmt ) {
-		MVRMutator toplevel;
-		exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), toplevel ) );
-
-		if ( toplevel.hasCode() ) {
-			assert ( toplevel.getVars() != 0 );
-
-			typedef std::list<Statement *> Statements;
-
-			CompoundStmt *code = new CompoundStmt( std::list< Label >() );
-
-			// copy variables
-			Statements &vars = toplevel.getVars()->get_kids();
-			for ( Statements::iterator i = vars.begin(); i != vars.end(); i++ )
-				code->get_kids().push_back( *i );
-
-			// copy statements
-			Statements &block = toplevel.getCode()->get_kids();
-			for ( Statements::iterator i = block.begin(); i != block.end(); i++ )
-				code->get_kids().push_back( *i );
-
-			return code;
-		} else
-			return exprStmt;
-	}
-
-	Expression *MVRMutator::mutate( ApplicationExpr *appExpr ) {
-		// appExpr->set_function(  maybeMutate( appExpr->get_function(), *this ) );
-		bool mulretp = false;
-		VariableExpr *funname;
-		if ( (funname = dynamic_cast<VariableExpr *>(appExpr->get_function())) == 0 ) goto DoArgs;
-
-		FunctionDecl *fundecl;
-		if ((fundecl = dynamic_cast<FunctionDecl *>(funname->get_var())) == 0) goto DoArgs;
-		{
-			typedef std::list<DeclarationWithType*> RetType;
-
-			RetType &rets = fundecl->get_functionType()->get_returnVals();
-			if ( rets.size() <= 1 ) goto DoArgs;
-			mulretp = true;
-
-			if ( newVars == 0 )
-				newVars = new CompoundStmt( std::list<Label>(0) );
-
-			for (RetType::iterator i = rets.begin() ; i != rets.end(); i++) {
-				DeclStmt *arg = newVar( *i );
-				newVars->get_kids().push_back( arg );
-				add_pending( arg->get_decl() );
-			} // for
-		}
-
-	  DoArgs:
-		// mutate the argument list
-		typedef std::list< Expression *> Exprs;
-		Exprs &args = appExpr->get_args();
-		std::list< Expression * > newArgs;
-		for ( Exprs::iterator i = args.begin(); i != args.end(); i++ ) {
-			MVRMutator next;
-			Expression *mutated = (*i)->acceptMutator( next );
-
-			if ( next.hasCode() ) {
-				// merge new vars and bodies
-				typedef std::list< Statement * > Stmts;
-				Stmts &vars = next.getVars()->get_kids();
-				Stmts &block = next.getCode()->get_kids();
-
-				if (newVars == 0)
-					newVars = new CompoundStmt( std::list< Label >() );
-				for ( Stmts::iterator i = vars.begin(); i != vars.end(); i++ )  // std::splice? -- need to append lists
-					newVars->get_kids().push_back( *i );
-
-				if (newCode == 0)
-					newCode = new CompoundStmt( std::list< Label >() );
-				for ( Stmts::iterator i = block.begin(); i != block.end(); i++ )
-					newCode->get_kids().push_back( *i );
-			} // if
-
-			if ( next.hasResults() ) {
-				Exprs &res = next.get_results();
-				for ( Exprs::iterator i = res.begin(); i != res.end(); i++ )
-					newArgs.push_back( *i );
-			} else
-				newArgs.push_back( mutated );
-		}
-
-		appExpr->get_args() = newArgs;  // new argument list
-
-		if ( mulretp ) {
-			// add 'out' parameters
-			if ( ! argsToAdd.empty() )
-				for (std::list< Expression *>::iterator i = argsToAdd.begin(); i != argsToAdd.end(); i++)
-					(appExpr->get_args()).push_back( *i );
-			// clear 'out' parameters ( so that the list can be reused -- substitute by auto_ptr later? )
-
-			if (newCode == 0)
-				newCode = new CompoundStmt( std::list<Label>(0) );
-		} // if
-
-		// add to block of code
-		if ( newCode != 0 )
-			newCode->get_kids().push_back( new ExprStmt( std::list<Label>(), appExpr ) );
-
-		return appExpr;
-	}
-
-	// Auxiliary function to generate new names for the `output' parameters
-	DeclStmt *MVRMutator::newVar( DeclarationWithType *reqDecl ) {
-		// std::ostringstream os;
-		// os << "__" << curVal++ << "__";// << std::ends;
-
-		ObjectDecl *decl;
-		if ((decl = dynamic_cast<ObjectDecl *>( reqDecl )) != 0)
-			// return new DeclStmt( new ObjectDecl( std::string (os.str(), os.pcount()), );
-			return new DeclStmt( std::list<Label>(), decl );
-		else
-			return 0;
-	}
-
-	void MVRMutator::add_pending( Declaration *decl ) {
-		ObjectDecl *obj;
-		if ( (obj = dynamic_cast< ObjectDecl * >( decl )) == 0 ) return;
-
-		VariableExpr *var = new VariableExpr(obj, 0 );
-		results.push_back( var ); // probably change this name to newResults or something
-		argsToAdd.push_back( new AddressExpr( var ) );
-		return;
-	}
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/MultRet.h
===================================================================
--- src/Tuples/MultRet.h	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,59 +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.
-//
-// MultRet.h -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 12:39:20 2015
-// Update Count     : 3
-//
-
-#ifndef _MULTRET_H_
-#define _MULTRET_H_
-
-#include "SynTree/Mutator.h"
-#include "SynTree/Visitor.h"
-
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-
-namespace Tuples {
-	class MVRMutator : public Mutator {
-		typedef Mutator Parent;
-	  public:
-		MVRMutator();
-		~MVRMutator();
-
-		virtual Statement  *mutate( ExprStmt        *exprStmt );
-		virtual Expression *mutate( ApplicationExpr *appExpr  );
-
-		bool hasCode() const { return ( newCode != 0 ); }
-		CompoundStmt *getCode() const { return newCode; }
-		CompoundStmt *getVars() const { return newVars; }
-
-		bool hasResults() const { return ( ! results.empty()); }
-		std::list<Expression *> &get_results() { return results; }
-	  private:
-		CompoundStmt *newVars;
-		CompoundStmt *newCode;
-		std::list<Expression *> argsToAdd;
-		std::list<Expression *> results;
-
-		static int curVal;
-		DeclStmt *newVar( DeclarationWithType * );
-		void add_pending( Declaration * );
-	};
-} // namespace Tuples
-
-#endif // _MULTRET_H_
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/Mutate.cc
===================================================================
--- src/Tuples/Mutate.cc	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,41 +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.
-//
-// Mutate.cc -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 14:57:10 2015
-// Update Count     : 2
-//
-
-#include "SynTree/Mutator.h"
-
-#include "Mutate.h"
-//#include "TupleFixer.h"
-//#include "FlattenTuple.h"
-//#include "MultRet.h"
-#include "FunctionFixer.h"
-#include "AssignExpand.h"
-//#include "FixReturn.h"
-//#include "MassAssignment.h"
-
-namespace Tuples {
-	void mutate( std::list< Declaration * > translationUnit ) {
-		//FunctionFixer fst;
-		AssignExpander snd;
-
-		//mutateAll( translationUnit, fst );
-		mutateAll( translationUnit, snd );
-	}
-} // namespace Tuples
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/Mutate.h
===================================================================
--- src/Tuples/Mutate.h	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ 	(revision )
@@ -1,35 +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.
-//
-// Mutate.h -- 
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 14:58:05 2015
-// Update Count     : 2
-//
-
-#ifndef MUTATE_H
-#define MUTATE_H
-
-#include <list>
-#include <iostream>
-
-#include "SynTree/Declaration.h"
-
-namespace Tuples {
-	void mutate( std::list< Declaration* > translationUnit );
-	void mulReturn( std::list< Declaration * > translationUnit );
-} // namespace Tuples
-
-#endif // MUTATE_H
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Tuples/module.mk
===================================================================
--- src/Tuples/module.mk	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
+++ src/Tuples/module.mk	(revision b6424d96bff612f23b49fac429887c0b6bc21a2f)
@@ -15,15 +15,4 @@
 ###############################################################################
 
-SRC += 	Tuples/Mutate.cc \
-	Tuples/AssignExpand.cc \
-	Tuples/FunctionFixer.cc \
-	Tuples/TupleAssignment.cc \
-	Tuples/FunctionChecker.cc \
+SRC += 	Tuples/TupleAssignment.cc \
 	Tuples/NameMatcher.cc
-
-#	Tuples/MultipleAssign.cc \
-#	Tuples/FlattenTuple.cc \
-#	Tuples/MultRet.cc \
-#	Tuples/FixReturn.cc \
-#	Tuples/MassAssignment.cc \
-#	Tuples/TupleFixer.cc
