Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/CodeGen/CodeGenerator.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Andrew Beach
-// Last Modified On : Tus Jul 25 15:29:00 2017
-// Update Count     : 486
+// Last Modified On : Fri Aug 18 15:34:00 2017
+// Update Count     : 488
 //
 #include "CodeGenerator.h"
@@ -79,23 +79,33 @@
 	}
 
-	CodeGenerator::LineMarker::LineMarker(
-			CodeLocation const & loc, bool toPrint) :
-		loc(loc), toPrint(toPrint)
-	{}
-
-	CodeGenerator::LineMarker CodeGenerator::lineDirective(
-			BaseSyntaxNode const * node) {
-		return LineMarker(node->location, lineMarks);
-	}
-
-	std::ostream & operator<<(std::ostream & out,
-			CodeGenerator::LineMarker const & marker) {
-		if (marker.toPrint && marker.loc.isSet()) {
-			return out << "\n# " << marker.loc.linenumber << " \""
-				<< marker.loc.filename << "\"\n";
-		} else if (marker.toPrint) {
-			return out << "\n/* Missing CodeLocation */\n";
-		} else {
-        	return out;
+	/* Using updateLocation at the beginning of a node and nextLine
+	 * within a node should become the method of formating.
+	 */
+	void CodeGenerator::updateLocation( CodeLocation const & to ) {
+		if ( !lineMarks ) {
+			return;
+		} else if ( currentLocation.followedBy( to, 0 ) ) {
+			return;
+		} else if ( currentLocation.followedBy( to, 1 ) ) {
+			output << "\n" << indent;
+			currentLocation.linenumber += 1;
+		} else if ( currentLocation.followedBy( to, 2 ) ) {
+			output << "\n\n" << indent;
+			currentLocation.linenumber += 2;
+		} else {
+			output << "\n# " << to.linenumber << " \"" << to.filename
+			       << "\"\n" << indent;
+			currentLocation = to;
+		}
+		output << std::flush;
+	}
+
+	void CodeGenerator::updateLocation( BaseSyntaxNode const * to ) {
+		updateLocation( to->location );
+	}
+
+	void CodeGenerator::nextLine() {
+		if ( !lineMarks ) {
+			output << "\n" << indent << std::flush;
 		}
 	}
@@ -195,5 +205,5 @@
 			++indent;
 			for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++ ) {
-				output << lineDirective( *i ) << indent;
+				updateLocation( *i );
 				(*i)->accept( *this );
 				output << ";" << endl;
@@ -218,5 +228,5 @@
 	void CodeGenerator::visit( EnumDecl * enumDecl ) {
 		extension( enumDecl );
-		output << lineDirective ( enumDecl );
+		updateLocation( enumDecl );
 		output << "enum ";
 		genAttributes( enumDecl->get_attributes() );
@@ -234,5 +244,6 @@
 				ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i );
 				assert( obj );
-				output << lineDirective( obj ) << indent << mangleName( obj );
+				updateLocation( obj );
+				output << mangleName( obj );
 				if ( obj->get_init() ) {
 					output << " = ";
@@ -252,5 +263,5 @@
 	void CodeGenerator::visit( TypedefDecl * typeDecl ) {
 		assertf( ! genC, "Typedefs are removed and substituted in earlier passes." );
-		output << lineDirective( typeDecl );
+		updateLocation( typeDecl );
 		output << "typedef ";
 		output << genType( typeDecl->get_base(), typeDecl->get_name(), pretty, genC ) << endl;
@@ -741,10 +752,11 @@
 	void CodeGenerator::visit( StmtExpr * stmtExpr ) {
 		std::list< Statement * > & stmts = stmtExpr->get_statements()->get_kids();
-		output << lineDirective( stmtExpr) << "({" << std::endl;
+		updateLocation( stmtExpr );
+		output << "({" << std::endl;
 		++indent;
 		unsigned int numStmts = stmts.size();
 		unsigned int i = 0;
 		for ( Statement * stmt : stmts ) {
-			output << lineDirective( stmt ) << indent;
+			updateLocation( stmt );
 			output << printLabels( stmt->get_labels() );
 			if ( i+1 == numStmts ) {
@@ -832,5 +844,5 @@
 
 	void CodeGenerator::visit( IfStmt * ifStmt ) {
-		output << lineDirective( ifStmt );
+		updateLocation( ifStmt );
 		output << "if ( ";
 		ifStmt->get_condition()->accept( *this );
@@ -846,5 +858,5 @@
 
 	void CodeGenerator::visit( SwitchStmt * switchStmt ) {
-		output << lineDirective( switchStmt );
+		updateLocation( switchStmt );
 		output << "switch ( " ;
 		switchStmt->get_condition()->accept( *this );
@@ -859,6 +871,5 @@
 
 	void CodeGenerator::visit( CaseStmt * caseStmt ) {
-		output << lineDirective( caseStmt );
-		output << indent;
+		updateLocation( caseStmt );
 		if ( caseStmt->isDefault()) {
 			output << "default";
Index: src/CodeGen/CodeGenerator.h
===================================================================
--- src/CodeGen/CodeGenerator.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/CodeGen/CodeGenerator.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Andrew Beach
-// Last Modified On : Tus Jul 25 25:30:00 2017
-// Update Count     : 54
+// Last Modified On : Fri Aug 18 15:40:00 2017
+// Update Count     : 56
 //
 
@@ -21,10 +21,7 @@
 
 #include "Common/Indenter.h"      // for Indenter
-
 #include "SynTree/Declaration.h"  // for DeclarationWithType (ptr only), Fun...
 #include "SynTree/Visitor.h"      // for Visitor
 #include "SynTree/SynTree.h"      // for Visitor Nodes
-
-#include "Common/Indenter.h"      // for Indenter
 
 namespace CodeGen {
@@ -113,17 +110,10 @@
 		};
 
-		struct LineMarker {
-			CodeLocation const & loc;
-			bool toPrint;
-
-			LineMarker(CodeLocation const & loc, bool toPrint);
-		};
-
-		LineMarker lineDirective(BaseSyntaxNode const * node);
-
 		void asmName( DeclarationWithType *decl );
 
 		void extension( Expression *expr );
 		void extension( Declaration *decl );
+
+		void updateLocation( BaseSyntaxNode const * to );
 	  private:
 		Indenter indent;
@@ -134,4 +124,8 @@
 		bool genC = false;    // true if output has to be C code
 		bool lineMarks = false;
+
+		CodeLocation currentLocation;
+		void updateLocation( CodeLocation const & to );
+		void nextLine();
 
 		void handleStorageClass( DeclarationWithType *decl );
@@ -160,7 +154,4 @@
 	/// returns C-compatible name of declaration
 	std::string genName( DeclarationWithType * decl );
-
-	std::ostream & operator<<(std::ostream &,
-		CodeGenerator::LineMarker const &);
 } // namespace CodeGen
 
Index: src/CodeGen/Generate.cc
===================================================================
--- src/CodeGen/Generate.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/CodeGen/Generate.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Andrew Beach
-// Last Modified On : Wed May 19 13:05:00 2017
-// Update Count     : 6
+// Last Modified On : Fri Aug 18 15:39:00 2017
+// Update Count     : 7
 //
 #include "Generate.h"
@@ -33,5 +33,5 @@
 		for ( auto & dcl : translationUnit ) {
 			if ( LinkageSpec::isGeneratable( dcl->get_linkage() ) && (doIntrinsics || ! LinkageSpec::isBuiltin( dcl->get_linkage() ) ) ) {
-				os << cgv.lineDirective(dcl);
+				cgv.updateLocation( dcl );
 				dcl->accept(cgv);
 				if ( doSemicolon( dcl ) ) {
Index: src/CodeTools/TrackLoc.cc
===================================================================
--- src/CodeTools/TrackLoc.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/CodeTools/TrackLoc.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -18,4 +18,5 @@
 #include <cstdlib>                   // for exit, EXIT_FAILURE
 #include <iostream>                  // for operator<<, ostream, basic_ostream
+#include <iterator>                  // for back_inserter, inserter
 #include <stack>                     // for stack
 #include <string>                    // for operator<<, string
@@ -23,6 +24,9 @@
 
 #include "Common/PassVisitor.h"      // for PassVisitor
+#include "Common/SemanticError.h"    // for SemanticError
 #include "Common/utility.h"          // for CodeLocation
 #include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
+#include "SynTree/Mutator.h"         // for mutateAll
+#include "SynTree/Visitor.h"         // for acceptAll
 
 class Declaration;
Index: src/Common/CodeLocation.h
===================================================================
--- src/Common/CodeLocation.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
+++ src/Common/CodeLocation.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -0,0 +1,70 @@
+//
+// 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.
+//
+// CodeLocation.h --
+//
+// Author           : Andrew Beach
+// Created On       : Thr Aug 17 11:23:00 2017
+// Last Modified By : Andrew Beach
+// Last Modified On : Thr Aug 17 14:07:00 2017
+// Update Count     : 0
+//
+
+#pragma once
+
+#include <string>
+
+struct CodeLocation {
+	int linenumber;
+	std::string filename;
+
+	/// Create a new unset CodeLocation.
+		CodeLocation()
+		: linenumber( -1 )
+		, filename("")
+	{}
+
+	/// Create a new CodeLocation with the given values.
+	CodeLocation( const char* filename, int lineno )
+		: linenumber( lineno )
+		, filename(filename ? filename : "")
+	{}
+
+	CodeLocation( const CodeLocation& rhs ) = default;
+
+	bool isSet () const {
+		return -1 != linenumber;
+	}
+
+	bool isUnset () const {
+		return !isSet();
+	}
+
+	void unset () {
+		linenumber = -1;
+		filename = "";
+	}
+
+	// Use field access for set.
+
+	bool followedBy( CodeLocation const & other, int seperation ) {
+		return (linenumber + seperation == other.linenumber &&
+		        filename == other.filename);
+	}
+
+	bool operator==( CodeLocation const & other ) {
+		return followedBy( other, 0 );
+	}
+
+	bool operator!=( CodeLocation const & other ) {
+		return !(*this == other);
+	}
+};
+
+inline std::string to_string( const CodeLocation& location ) {
+    return location.isSet() ? location.filename + ":" + std::to_string(location.linenumber) + " " : "";
+}
+
Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Common/PassVisitor.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -1,3 +1,5 @@
 #pragma once
+
+// IWYU pragma: private, include "Common/PassVisitor.h"
 
 #include <stack>
Index: src/Common/SemanticError.h
===================================================================
--- src/Common/SemanticError.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Common/SemanticError.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 21 22:18:59 2017
-// Update Count     : 6
+// Last Modified By : Andrew Beach
+// Last Modified On : Thr Aug 17 14:01:00 2017
+// Update Count     : 7
 //
 
@@ -21,5 +21,5 @@
 #include <string>     // for string
 
-#include "utility.h"  // for CodeLocation, toString
+#include "CodeLocation.h"  // for CodeLocation, toString
 
 struct error {
Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Common/utility.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 21 22:19:13 2017
-// Update Count     : 33
+// Last Modified By : Andrew Beach
+// Last Modified On : Thr Aug 17 11:38:00 2017
+// Update Count     : 34
 //
 
@@ -27,4 +27,5 @@
 
 #include <cassert>
+
 template< typename T >
 static inline T * maybeClone( const T *orig ) {
@@ -347,42 +348,4 @@
 }
 
-struct CodeLocation {
-	int linenumber;
-	std::string filename;
-
-	/// Create a new unset CodeLocation.
-	CodeLocation()
-		: linenumber( -1 )
-		, filename("")
-	{}
-
-	/// Create a new CodeLocation with the given values.
-	CodeLocation( const char* filename, int lineno )
-		: linenumber( lineno )
-		, filename(filename ? filename : "")
-	{}
-
-	CodeLocation( const CodeLocation& rhs ) = default;
-
-	bool isSet () const {
-		return -1 != linenumber;
-	}
-
-	bool isUnset () const {
-		return !isSet();
-	}
-
-	void unset () {
-		linenumber = -1;
-		filename = "";
-	}
-
-	// Use field access for set.
-};
-
-inline std::string to_string( const CodeLocation& location ) {
-	return location.isSet() ? location.filename + ":" + std::to_string(location.linenumber) + " " : "";
-}
-
 // Local Variables: //
 // tab-width: 4 //
Index: src/ControlStruct/ExceptTranslate.cc
===================================================================
--- src/ControlStruct/ExceptTranslate.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/ExceptTranslate.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,16 +10,30 @@
 // Created On       : Wed Jun 14 16:49:00 2017
 // Last Modified By : Andrew Beach
-// Last Modified On : Tus Aug  8 16:54:00 2017
-// Update Count     : 7
+// Last Modified On : Thr Aug 17 17:19:00 2017
+// Update Count     : 9
 //
 
 #include "ExceptTranslate.h"
-#include "Common/PassVisitor.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Type.h"
-#include "SynTree/Attribute.h"
-#include "SynTree/VarExprReplacer.h"
+
+#include <stddef.h>                   // for NULL
+#include <cassert>                    // for assert, assertf
+#include <iterator>                   // for back_inserter, inserter
+#include <string>                     // for string, operator==
+
+#include "Common/PassVisitor.h"       // for PassVisitor, WithGuards
+#include "Common/SemanticError.h"     // for SemanticError
+#include "Common/utility.h"           // for CodeLocation
+#include "Parser/LinkageSpec.h"       // for Cforall
+#include "SynTree/Attribute.h"        // for Attribute
+#include "SynTree/Constant.h"         // for Constant
+#include "SynTree/Declaration.h"      // for ObjectDecl, FunctionDecl, Struc...
+#include "SynTree/Expression.h"       // for UntypedExpr, ConstantExpr, Name...
+#include "SynTree/Initializer.h"      // for SingleInit, ListInit
+#include "SynTree/Label.h"            // for Label, noLabels
+#include "SynTree/Mutator.h"          // for mutateAll
+#include "SynTree/Statement.h"        // for CompoundStmt, CatchStmt, ThrowStmt
+#include "SynTree/Type.h"             // for FunctionType, Type, noQualifiers
+#include "SynTree/VarExprReplacer.h"  // for VarExprReplacer, VarExprReplace...
+#include "SynTree/Visitor.h"          // for acceptAll
 
 namespace ControlStruct {
@@ -152,5 +166,6 @@
 			/*bitfieldWidth*/ NULL,
 			new BasicType( noQualifiers, BasicType::Bool ),
-			/*init*/ NULL
+			/*init*/ NULL,
+			std::list<Attribute *>{ new Attribute( "unused" ) }
 			);
 		ObjectDecl voidptr_obj(
@@ -169,7 +184,10 @@
 			);
 
+		ObjectDecl * unused_index_obj = index_obj.clone();
+		unused_index_obj->attributes.push_back( new Attribute( "unused" ) );
+
 		catch_func_t.get_parameters().push_back( index_obj.clone() );
 		catch_func_t.get_parameters().push_back( exception_obj.clone() );
-		match_func_t.get_returnVals().push_back( index_obj.clone() );
+		match_func_t.get_returnVals().push_back( unused_index_obj );
 		match_func_t.get_parameters().push_back( exception_obj.clone() );
 		handle_func_t.get_returnVals().push_back( bool_obj.clone() );
@@ -403,6 +421,6 @@
 		}
 
-		body->push_back( new ReturnStmt( noLabels, new ConstantExpr(
-			Constant::from_int( 0 ) ) ) );
+		body->push_back( new ReturnStmt( noLabels,
+			new ConstantExpr( Constant::from_int( 0 ) ) ) );
 
 		return new FunctionDecl("match", Type::StorageClasses(),
@@ -435,5 +453,5 @@
 		CompoundStmt * body = new CompoundStmt( noLabels );
 
-		FunctionType * func_type = match_func_t.clone();
+		FunctionType * func_type = handle_func_t.clone();
 		DeclarationWithType * except_obj = func_type->get_parameters().back();
 
@@ -458,6 +476,6 @@
 		}
 
-		body->push_back( new ReturnStmt( noLabels, new ConstantExpr(
-			Constant::from_bool( false ) ) ) );
+		body->push_back( new ReturnStmt( noLabels,
+			new ConstantExpr( Constant::from_bool( false ) ) ) );
 
 		return new FunctionDecl("handle", Type::StorageClasses(),
Index: src/ControlStruct/ExceptTranslate.h
===================================================================
--- src/ControlStruct/ExceptTranslate.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/ExceptTranslate.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,7 @@
 #pragma once
 
-#include <list>
-#include "SynTree/SynTree.h"
+#include <list>  // for list
+
+class Declaration;
 
 namespace ControlStruct {
Index: src/ControlStruct/ForExprMutator.cc
===================================================================
--- src/ControlStruct/ForExprMutator.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/ForExprMutator.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,32 +9,39 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Tue Jul 14 12:14:44 2015
-// Update Count     : 10
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Aug 18 10:22:00 2017
+// Update Count     : 12
 //
 
-#include "SynTree/Mutator.h"
-#include "SynTree/Statement.h"
+#include <list>                 // for list, _List_iterator, list<>::iterator
+
 #include "ForExprMutator.h"
+#include "SynTree/Label.h"      // for Label
+#include "SynTree/Statement.h"  // for Statement (ptr only), ForStmt, Compou...
 
 namespace ControlStruct {
+	Statement *hoist( Statement *originalStmt, std::list<Statement *> &init ) {
+		// If no hoisting is needed, skip:
+		if ( 0 == init.size() ) {
+			return originalStmt;
+		}
+
+		// Create compound statement, move initializers outside,
+		// the resut of the original stays as is.
+		CompoundStmt *block = new CompoundStmt( std::list< Label >() );
+		std::list<Statement *> &stmts = block->get_kids();
+		stmts.splice( stmts.end(), init );
+
+		// Add for to the new block.
+		stmts.push_back( originalStmt );
+		return block;
+	}
+
+	Statement *ForExprMutator::postmutate( IfStmt *ifStmt ) {
+		return hoist( ifStmt, ifStmt->initialization );
+	}
 	Statement *ForExprMutator::postmutate( ForStmt *forStmt ) {
 		// hoist any initializer declarations to make them C89 (rather than C99)
-		std::list<Statement *> &init = forStmt->get_initialization();
-		if ( init.size() == 0 ) {
-			return forStmt;
-		} // if
-
-		// create compound statement, move initializers outside, leave _for_ as-is
-		CompoundStmt *block = new CompoundStmt( std::list< Label >() );
-		std::list<Statement *> &stmts = block->get_kids();
-		for ( std::list<Statement *>::iterator it = init.begin(); it != init.end(); ++it ) {
-			stmts.push_back( *it );
-		}	// for
-
-		// add for to the new block
-		stmts.push_back( forStmt );
-		forStmt->set_initialization( std::list<Statement *>() );
-		return block;
+		return hoist( forStmt, forStmt->initialization );
 	}
 } // namespace ControlStruct
Index: src/ControlStruct/ForExprMutator.h
===================================================================
--- src/ControlStruct/ForExprMutator.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/ForExprMutator.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,16 +10,18 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 22 09:17:08 2017
-// Update Count     : 4
+// Last Modified On : Thu Aug 17 15:32:48 2017
+// Update Count     : 5
 //
 
 #pragma once
 
-#include "SynTree/Mutator.h"
-#include "Common/utility.h"
+class IfStmt;
+class ForStmt;
+class Statement;
 
 namespace ControlStruct {
 	class ForExprMutator {
 	  public:
+		Statement *postmutate( IfStmt * );
 		Statement *postmutate( ForStmt * );
 	};
Index: src/ControlStruct/LabelFixer.cc
===================================================================
--- src/ControlStruct/LabelFixer.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/LabelFixer.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,15 +14,15 @@
 //
 
-#include <list>
-#include <cassert>
+#include <cassert>                         // for assert
+#include <list>                            // for list, _List_iterator, list...
+#include <string>                          // for operator+, string, operator==
+#include <utility>                         // for pair
 
+#include "ControlStruct/LabelGenerator.h"  // for LabelGenerator
 #include "LabelFixer.h"
-#include "MLEMutator.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Declaration.h"
-#include "Common/utility.h"
-
-#include <iostream>
+#include "MLEMutator.h"                    // for MLEMutator
+#include "SynTree/Declaration.h"           // for FunctionDecl
+#include "SynTree/Expression.h"            // for NameExpr, Expression, Unty...
+#include "SynTree/Statement.h"             // for Statement, BranchStmt, Com...
 
 namespace ControlStruct {
Index: src/ControlStruct/LabelFixer.h
===================================================================
--- src/ControlStruct/LabelFixer.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/LabelFixer.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,13 +16,16 @@
 #pragma once
 
-#include "Common/utility.h"
-#include "SynTree/SynTree.h"
-#include "SynTree/Visitor.h"
-#include "SynTree/Label.h"
-#include "LabelGenerator.h"
-#include <map>
+#include <list>                    // for list
+#include <map>                     // for map
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "SynTree/Label.h"         // for Label
+#include "SynTree/Visitor.h"       // for Visitor
+#include "SynTree/SynTree.h"       // for Visitor Nodes
 
 namespace ControlStruct {
 	/// normalizes label definitions and generates multi-level exit labels
+class LabelGenerator;
+
 	class LabelFixer final : public Visitor {
 		typedef Visitor Parent;
Index: src/ControlStruct/LabelGenerator.cc
===================================================================
--- src/ControlStruct/LabelGenerator.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/LabelGenerator.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,16 +9,17 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jun 23 12:18:34 2015
-// Update Count     : 13
+// Last Modified By : Andrew Beach
+// Last Modified On : Thr Aug 14 14:14:00 2015
+// Update Count     : 14
 //
 
-#include <iostream>
-#include <sstream>
+#include <iostream>             // for operator<<, basic_ostream
+#include <sstream>              // for ostringstream
+#include <list>                 // for list
 
 #include "LabelGenerator.h"
-#include "SynTree/Label.h"
-#include "SynTree/Attribute.h"
-#include "SynTree/Statement.h"
+#include "SynTree/Attribute.h"  // for Attribute
+#include "SynTree/Label.h"      // for Label, operator<<
+#include "SynTree/Statement.h"  // for Statement
 
 namespace ControlStruct {
Index: src/ControlStruct/LabelGenerator.h
===================================================================
--- src/ControlStruct/LabelGenerator.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/LabelGenerator.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,9 @@
 #pragma once
 
-#include "SynTree/SynTree.h"
-#include <string>
+#include <string>           // for string
+
+#include "SynTree/Label.h"  // for Label
+
+class Statement;
 
 namespace ControlStruct {
Index: src/ControlStruct/MLEMutator.cc
===================================================================
--- src/ControlStruct/MLEMutator.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/MLEMutator.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -20,11 +20,15 @@
 // where these labels are generated.
 
-#include <cassert>
-#include <algorithm>
-
+#include <ext/alloc_traits.h>              // for __alloc_traits<>::value_type
+#include <algorithm>                       // for find, find_if
+#include <cassert>                         // for assert, assertf
+#include <memory>                          // for allocator_traits<>::value_...
+
+#include "Common/utility.h"                // for toString, operator+
+#include "ControlStruct/LabelGenerator.h"  // for LabelGenerator
 #include "MLEMutator.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Attribute.h"
+#include "SynTree/Attribute.h"             // for Attribute
+#include "SynTree/Expression.h"            // for Expression
+#include "SynTree/Statement.h"             // for BranchStmt, CompoundStmt
 
 namespace ControlStruct {
Index: src/ControlStruct/MLEMutator.h
===================================================================
--- src/ControlStruct/MLEMutator.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/MLEMutator.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,17 +16,19 @@
 #pragma once
 
-#include <map>
-#include <list>
+#include <list>                    // for list
+#include <map>                     // for map
+#include <string>                  // for string
 
-#include "Common/utility.h"
-#include "SynTree/SynTree.h"
-#include "SynTree/Mutator.h"
-#include "SynTree/Label.h"
-
-#include "LabelGenerator.h"
+#include "Common/SemanticError.h"  // for SemanticError
+#include "SynTree/Label.h"         // for Label
+#include "SynTree/Mutator.h"       // for Mutator
+#include "SynTree/SynTree.h"       // for Visitor Nodes
 
 namespace ControlStruct {
+class LabelGenerator;
+
 	class MLEMutator : public Mutator {
 		class Entry;
+
 		typedef Mutator Parent;
 	  public:
Index: src/ControlStruct/Mutate.cc
===================================================================
--- src/ControlStruct/Mutate.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/Mutate.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,19 +14,18 @@
 //
 
-#include <algorithm>
-#include <iostream>
-#include <cassert>
-#include <list>
+#include <iterator>                // for back_inserter, inserter
+#include <list>                    // for list
 
+#include "Common/PassVisitor.h"    // for mutateAll
+#include "Common/SemanticError.h"  // for SemanticError
+#include "ForExprMutator.h"        // for ForExprMutator
+#include "LabelFixer.h"            // for LabelFixer
 #include "Mutate.h"
-#include "LabelFixer.h"
-#include "MLEMutator.h"
-#include "ForExprMutator.h"
+#include "SynTree/Declaration.h"   // for Declaration
+#include "SynTree/Mutator.h"       // for mutateAll
 //#include "ExceptMutator.h"
 
-#include "Common/utility.h"
-#include "Common/PassVisitor.h"
-
-#include "SynTree/Visitor.h"
+#include "Common/PassVisitor.h"    // for PassVisitor
+#include "SynTree/Visitor.h"       // for acceptAll
 
 using namespace std;
Index: src/ControlStruct/Mutate.h
===================================================================
--- src/ControlStruct/Mutate.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ControlStruct/Mutate.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,8 +16,7 @@
 #pragma once
 
-#include <list>
-#include <iostream>
+#include <list>  // for list
 
-#include "SynTree/Declaration.h"
+class Declaration;
 
 namespace ControlStruct {
Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/Box.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,52 +14,46 @@
 //
 
-#include <algorithm>
-#include <iterator>
-#include <list>
-#include <map>
-#include <set>
-#include <stack>
-#include <string>
-#include <utility>
-#include <vector>
-#include <cassert>
+#include <algorithm>                     // for mismatch
+#include <cassert>                       // for assert, safe_dynamic_cast
+#include <iostream>                      // for operator<<, stringstream
+#include <list>                          // for list, list<>::iterator, _Lis...
+#include <map>                           // for _Rb_tree_const_iterator, map
+#include <memory>                        // for auto_ptr
+#include <set>                           // for set
+#include <string>                        // for string, allocator, basic_string
+#include <utility>                       // for pair
 
 #include "Box.h"
-#include "DeclMutator.h"
-#include "Lvalue.h"
-#include "FindFunction.h"
-#include "PolyMutator.h"
-#include "ScopedSet.h"
-#include "ScrubTyVars.h"
-
-#include "Parser/ParseNode.h"
-
-#include "SynTree/Attribute.h"
-#include "SynTree/Constant.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Mutator.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Type.h"
-#include "SynTree/TypeSubstitution.h"
-
-#include "ResolvExpr/TypeEnvironment.h"
-#include "ResolvExpr/TypeMap.h"
-#include "ResolvExpr/typeops.h"
-
-#include "SymTab/Indexer.h"
-#include "SymTab/Mangler.h"
-
-#include "Common/ScopedMap.h"
-#include "Common/SemanticError.h"
-#include "Common/UniqueName.h"
-#include "Common/utility.h"
 
 #include "CodeGen/OperatorTable.h"
-
-#include "InitTweak/InitTweak.h"
-
-#include <ext/functional> // temporary
+#include "Common/ScopedMap.h"            // for ScopedMap, ScopedMap<>::iter...
+#include "Common/SemanticError.h"        // for SemanticError
+#include "Common/UniqueName.h"           // for UniqueName
+#include "Common/utility.h"              // for toString
+#include "DeclMutator.h"                 // for DeclMutator
+#include "FindFunction.h"                // for findFunction, findAndReplace...
+#include "GenPoly/ErasableScopedMap.h"   // for ErasableScopedMap<>::const_i...
+#include "GenPoly/GenPoly.h"             // for TyVarMap, isPolyType, mangle...
+#include "InitTweak/InitTweak.h"         // for getFunctionName, isAssignment
+#include "Lvalue.h"                      // for generalizedLvalue
+#include "Parser/LinkageSpec.h"          // for C, Spec, Cforall, Intrinsic
+#include "PolyMutator.h"                 // for PolyMutator
+#include "ResolvExpr/TypeEnvironment.h"  // for EqvClass
+#include "ResolvExpr/typeops.h"          // for typesCompatible
+#include "ScopedSet.h"                   // for ScopedSet, ScopedSet<>::iter...
+#include "ScrubTyVars.h"                 // for ScrubTyVars
+#include "SymTab/Indexer.h"              // for Indexer
+#include "SymTab/Mangler.h"              // for Mangler
+#include "SynTree/Attribute.h"           // for Attribute
+#include "SynTree/Constant.h"            // for Constant
+#include "SynTree/Declaration.h"         // for DeclarationWithType, ObjectDecl
+#include "SynTree/Expression.h"          // for ApplicationExpr, UntypedExpr
+#include "SynTree/Initializer.h"         // for SingleInit, Initializer, Lis...
+#include "SynTree/Label.h"               // for Label, noLabels
+#include "SynTree/Mutator.h"             // for maybeMutate, Mutator, mutateAll
+#include "SynTree/Statement.h"           // for ExprStmt, DeclStmt, ReturnStmt
+#include "SynTree/SynTree.h"             // for UniqueId
+#include "SynTree/Type.h"                // for Type, FunctionType, PointerType
+#include "SynTree/TypeSubstitution.h"    // for TypeSubstitution, operator<<
 
 namespace GenPoly {
Index: src/GenPoly/Box.h
===================================================================
--- src/GenPoly/Box.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/Box.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,7 @@
 #pragma once
 
-#include <list>
-#include "SynTree/SynTree.h"
+#include <list>  // for list
+
+class Declaration;
 
 namespace GenPoly {
Index: src/GenPoly/CopyParams.cc
===================================================================
--- src/GenPoly/CopyParams.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/CopyParams.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,14 +14,20 @@
 //
 
-#include <set>
-#include <map>
-#include <cassert>
+#include <cassert>                 // for assert
+#include <list>                    // for list, _List_iterator, _List_const_...
+#include <map>                     // for map, _Rb_tree_const_iterator, map<...
+#include <set>                     // for set, set<>::const_iterator
+#include <string>                  // for string, operator==
+#include <utility>                 // for pair
 
-#include "SynTree/Declaration.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Visitor.h"
-#include "Common/UniqueName.h"
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/UniqueName.h"     // for UniqueName
+#include "SynTree/Declaration.h"   // for DeclarationWithType, TypeDecl, Fun...
+#include "SynTree/Expression.h"    // for VariableExpr, ApplicationExpr, Add...
+#include "SynTree/Label.h"         // for Label, noLabels
+#include "SynTree/Statement.h"     // for CompoundStmt, DeclStmt, ExprStmt
+#include "SynTree/SynTree.h"       // for UniqueId
+#include "SynTree/Type.h"          // for FunctionType, TypeInstType, Type
+#include "SynTree/Visitor.h"       // for acceptAll, Visitor
 
 namespace GenPoly {
Index: src/GenPoly/DeclMutator.cc
===================================================================
--- src/GenPoly/DeclMutator.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/DeclMutator.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,11 @@
 #include "DeclMutator.h"
 
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
+#include <memory>                  // for allocator_traits<>::value_type
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "SynTree/Declaration.h"   // for Declaration
+#include "SynTree/Expression.h"    // for Expression
+#include "SynTree/Label.h"         // for Label, noLabels
+#include "SynTree/Statement.h"     // for CatchStmt, Statement, CompoundStmt
 
 namespace GenPoly {
Index: src/GenPoly/DeclMutator.h
===================================================================
--- src/GenPoly/DeclMutator.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/DeclMutator.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,10 +16,9 @@
 #pragma once
 
-#include <list>
-#include <vector>
+#include <list>               // for list
+#include <vector>             // for vector
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Mutator.h"
+#include "SynTree/Mutator.h"  // for Mutator
+#include "SynTree/SynTree.h"  // for Visitor Nodes
 
 namespace GenPoly {
Index: src/GenPoly/FindFunction.cc
===================================================================
--- src/GenPoly/FindFunction.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/FindFunction.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,9 +15,14 @@
 
 #include "FindFunction.h"
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Visitor.h"
 
-#include "ScrubTyVars.h"
+#include <utility>                      // for pair
+
+#include "Common/SemanticError.h"       // for SemanticError
+#include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::iterator
+#include "GenPoly/GenPoly.h"            // for TyVarMap
+#include "ScrubTyVars.h"                // for ScrubTyVars
+#include "SynTree/Declaration.h"        // for DeclarationWithType, TypeDecl
+#include "SynTree/Mutator.h"            // for Mutator, mutateAll
+#include "SynTree/Type.h"               // for FunctionType, Type, Type::For...
 
 namespace GenPoly {
Index: src/GenPoly/FindFunction.h
===================================================================
--- src/GenPoly/FindFunction.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/FindFunction.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,10 @@
 #pragma once
 
-#include "SynTree/SynTree.h"
-#include "GenPoly.h"
+#include <list>       // for list
+
+#include "GenPoly.h"  // for TyVarMap
+
+class FunctionType;
+class Type;
 
 namespace GenPoly {
Index: src/GenPoly/GenPoly.cc
===================================================================
--- src/GenPoly/GenPoly.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/GenPoly.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,16 +15,20 @@
 
 #include "GenPoly.h"
-#include "assert.h"
-
-#include "SynTree/Expression.h"
-#include "SynTree/Type.h"
-#include "ResolvExpr/typeops.h"
-
-#include <iostream>
-#include <iterator>
-#include <list>
-#include <typeindex>
-#include <typeinfo>
-#include <vector>
+
+#include <cassert>                      // for assertf, assert
+#include <iostream>                     // for operator<<, ostream, basic_os...
+#include <iterator>                     // for back_insert_iterator, back_in...
+#include <list>                         // for list, _List_iterator, list<>:...
+#include <typeindex>                    // for type_index
+#include <utility>                      // for pair
+#include <vector>                       // for vector
+
+#include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::const_it...
+#include "ResolvExpr/typeops.h"         // for flatten
+#include "SynTree/Constant.h"           // for Constant
+#include "SynTree/Expression.h"         // for Expression, TypeExpr, Constan...
+#include "SynTree/Type.h"               // for Type, StructInstType, UnionIn...
+#include "SynTree/TypeSubstitution.h"   // for TypeSubstitution
+
 using namespace std;
 
Index: src/GenPoly/GenPoly.h
===================================================================
--- src/GenPoly/GenPoly.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/GenPoly.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,15 +16,11 @@
 #pragma once
 
-#include <string>
-#include <iostream>
-#include <utility>
+#include <iostream>               // for ostream
+#include <string>                 // for string, allocator, operator+, basic...
 
-#include "ErasableScopedMap.h"
-
-#include "SymTab/Mangler.h"
-
-#include "SynTree/Declaration.h"
-#include "SynTree/Type.h"
-#include "SynTree/TypeSubstitution.h"
+#include "ErasableScopedMap.h"    // for ErasableScopedMap
+#include "SymTab/Mangler.h"       // for Mangler
+#include "SynTree/Declaration.h"  // for TypeDecl::Data, AggregateDecl, Type...
+#include "SynTree/SynTree.h"      // for Visitor Nodes
 
 namespace GenPoly {
@@ -66,9 +62,9 @@
 	Type *hasPolyBase( Type *type, const TyVarMap &tyVars, int *levels = 0, const TypeSubstitution *env = 0 );
 
-	/// true iff this type or some base of this type after dereferencing pointers is either polymorphic or a generic type with at least one 
+	/// true iff this type or some base of this type after dereferencing pointers is either polymorphic or a generic type with at least one
 	/// polymorphic parameter; will look up substitution in env if provided.
 	bool includesPolyType( Type *type, const TypeSubstitution *env = 0 );
 
-	/// true iff this type or some base of this type after dereferencing pointers is either polymorphic in tyVars, or a generic type with 
+	/// true iff this type or some base of this type after dereferencing pointers is either polymorphic in tyVars, or a generic type with
 	/// at least one polymorphic parameter in tyVars; will look up substitution in env if provided.
 	bool includesPolyType( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 );
Index: src/GenPoly/InstantiateGeneric.cc
===================================================================
--- src/GenPoly/InstantiateGeneric.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/InstantiateGeneric.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -13,30 +13,26 @@
 // Update Count     : 1
 //
-
-#include <cassert>
-#include <list>
-#include <unordered_map>
-#include <utility>
-#include <vector>
-
 #include "InstantiateGeneric.h"
 
-#include "GenPoly.h"
-#include "ScopedSet.h"
-#include "ScrubTyVars.h"
-
-#include "Common/PassVisitor.h"
-#include "Common/ScopedMap.h"
-#include "Common/UniqueName.h"
-#include "Common/utility.h"
-
-#include "ResolvExpr/typeops.h"
-
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Type.h"
-
-
-#include "InitTweak/InitTweak.h"
+#include <cassert>                     // for assertf, assert
+#include <iterator>                    // for back_inserter, inserter
+#include <list>                        // for list, _List_const_iterator
+#include <utility>                     // for move, pair
+#include <vector>                      // for vector
+
+#include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
+#include "Common/ScopedMap.h"          // for ScopedMap
+#include "Common/SemanticError.h"      // for SemanticError
+#include "Common/UniqueName.h"         // for UniqueName
+#include "Common/utility.h"            // for deleteAll, cloneAll
+#include "GenPoly.h"                   // for isPolyType, typesPolyCompatible
+#include "ScopedSet.h"                 // for ScopedSet, ScopedSet<>::iterator
+#include "ScrubTyVars.h"               // for ScrubTyVars
+#include "SynTree/Declaration.h"       // for StructDecl, UnionDecl, TypeDecl
+#include "SynTree/Expression.h"        // for TypeExpr, Expression
+#include "SynTree/Mutator.h"           // for mutateAll
+#include "SynTree/Type.h"              // for StructInstType, UnionInstType
+#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
+#include "SynTree/Visitor.h"           // for acceptAll
 
 
Index: src/GenPoly/InstantiateGeneric.h
===================================================================
--- src/GenPoly/InstantiateGeneric.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/InstantiateGeneric.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,5 +16,7 @@
 #pragma once
 
-#include "SynTree/SynTree.h"
+#include <list>  // for list
+
+class Declaration;
 
 namespace GenPoly {
Index: src/GenPoly/Lvalue.cc
===================================================================
--- src/GenPoly/Lvalue.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/Lvalue.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,29 +14,24 @@
 //
 
-#include <cassert>
-
+#include <cassert>                       // for safe_dynamic_cast
+#include <string>                        // for string
+
+#include "Common/PassVisitor.h"
+#include "Common/SemanticError.h"        // for SemanticError
+#include "GenPoly.h"                     // for isPolyType
 #include "Lvalue.h"
 
-#include "GenPoly.h"
-
-#include "SynTree/Declaration.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Visitor.h"
-#include "SynTree/Mutator.h"
-#include "SymTab/Indexer.h"
+#include "Parser/LinkageSpec.h"          // for Spec, isBuiltin, Intrinsic
+#include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
+#include "ResolvExpr/Unify.h"            // for unify
+#include "ResolvExpr/typeops.h"
 #include "SymTab/Autogen.h"
-
-#include "ResolvExpr/Resolver.h"
-#include "ResolvExpr/TypeEnvironment.h"
-#include "ResolvExpr/typeops.h"
-#include "ResolvExpr/Unify.h"
-
-#include "Common/UniqueName.h"
-#include "Common/utility.h"
-#include "Common/PassVisitor.h"
-
-#include "InitTweak/InitTweak.h"
+#include "SymTab/Indexer.h"              // for Indexer
+#include "SynTree/Declaration.h"         // for Declaration, FunctionDecl
+#include "SynTree/Expression.h"          // for Expression, ConditionalExpr
+#include "SynTree/Mutator.h"             // for mutateAll, Mutator
+#include "SynTree/Statement.h"           // for ReturnStmt, Statement (ptr o...
+#include "SynTree/Type.h"                // for PointerType, Type, FunctionType
+#include "SynTree/Visitor.h"             // for Visitor, acceptAll
 
 #if 0
@@ -223,5 +218,5 @@
 		// at inner &, record depth D of reference type
 		// at outer &, add D derefs.
-		void AddrRef::premutate( Expression * expr ) {
+		void AddrRef::premutate( Expression * ) {
 			GuardValue( current );
 			GuardValue( first );
@@ -230,5 +225,5 @@
 		}
 
-		void AddrRef::premutate( AddressExpr * addrExpr ) {
+		void AddrRef::premutate( AddressExpr * ) {
 			GuardValue( current );
 			GuardValue( first );
Index: src/GenPoly/Lvalue.h
===================================================================
--- src/GenPoly/Lvalue.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/Lvalue.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,7 +16,8 @@
 #pragma once
 
-#include <list>
+#include <list>  // for list
 
-#include "SynTree/SynTree.h"
+class Declaration;
+class Expression;
 
 namespace GenPoly {
Index: src/GenPoly/PolyMutator.cc
===================================================================
--- src/GenPoly/PolyMutator.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/PolyMutator.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,10 +15,15 @@
 
 #include "PolyMutator.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Mutator.h"
-#include "SynTree/Initializer.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 {
Index: src/GenPoly/PolyMutator.h
===================================================================
--- src/GenPoly/PolyMutator.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/PolyMutator.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,13 +16,9 @@
 #pragma once
 
-#include <map>
-#include <string>
-#include <list>
+#include <list>               // for list
 
-#include "GenPoly.h"
-
-#include "SynTree/SynTree.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Mutator.h"
+#include "GenPoly.h"          // for TyVarMap
+#include "SynTree/Mutator.h"  // for Mutator
+#include "SynTree/SynTree.h"  // for Visitor Nodes
 
 namespace GenPoly {
Index: src/GenPoly/ScrubTyVars.cc
===================================================================
--- src/GenPoly/ScrubTyVars.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/ScrubTyVars.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,13 +14,13 @@
 //
 
-#include <sstream>
-#include <string>
+#include <utility>                      // for pair
 
-#include "GenPoly.h"
+#include "GenPoly.h"                    // for mangleType, TyVarMap, alignof...
+#include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::const_it...
 #include "ScrubTyVars.h"
-
-#include "SynTree/Mutator.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
+#include "SynTree/Declaration.h"        // for TypeDecl, TypeDecl::Data, Typ...
+#include "SynTree/Expression.h"         // for Expression (ptr only), NameExpr
+#include "SynTree/Mutator.h"            // for Mutator
+#include "SynTree/Type.h"               // for PointerType, TypeInstType, Type
 
 namespace GenPoly {
Index: src/GenPoly/ScrubTyVars.h
===================================================================
--- src/GenPoly/ScrubTyVars.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/ScrubTyVars.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// ScrubTyVars.h -- 
+// ScrubTyVars.h --
 //
 // Author           : Richard C. Bilson
@@ -16,10 +16,13 @@
 #pragma once
 
-#include <string>
+#include <cassert>            // for assert
 
-#include "GenPoly.h"
+#include "GenPoly.h"          // for TyVarMap, isPolyType, isDynType
+#include "SynTree/Mutator.h"  // for Mutator
+#include "SynTree/Type.h"     // for Type (ptr only), PointerType (ptr only)
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Mutator.h"
+class AlignofExpr;
+class Expression;
+class SizeofExpr;
 
 namespace GenPoly {
@@ -66,8 +69,8 @@
 			// return dynamicOnly ? isDynType( ty, tyVars ) : isPolyType( ty, tyVars );
 		}
-		
+
 		/// Mutates (possibly generic) aggregate types appropriately
 		Type* mutateAggregateType( Type *ty );
-		
+
 		const TyVarMap *tyVars;  ///< Type variables to scrub
 		ScrubMode mode;          ///< which type variables to scrub? [FromMap]
Index: src/GenPoly/Specialize.cc
===================================================================
--- src/GenPoly/Specialize.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/Specialize.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,23 +14,31 @@
 //
 
-#include <cassert>
-
+#include <cassert>                       // for assert, assertf
+#include <iterator>                      // for back_insert_iterator, back_i...
+#include <map>                           // for _Rb_tree_iterator, _Rb_tree_...
+#include <memory>                        // for unique_ptr
+#include <string>                        // for string
+#include <tuple>                         // for get
+#include <utility>                       // for pair
+
+#include "Common/SemanticError.h"        // for SemanticError
+#include "Common/UniqueName.h"           // for UniqueName
+#include "Common/utility.h"              // for group_iterate
+#include "GenPoly.h"                     // for getFunctionType
+#include "InitTweak/InitTweak.h"         // for isIntrinsicCallExpr
+#include "Parser/LinkageSpec.h"          // for C
+#include "PolyMutator.h"                 // for PolyMutator
+#include "ResolvExpr/FindOpenVars.h"     // for findOpenVars
+#include "ResolvExpr/TypeEnvironment.h"  // for OpenVarSet, AssertionSet
 #include "Specialize.h"
-#include "GenPoly.h"
-#include "PolyMutator.h"
-
-#include "Parser/ParseNode.h"
-
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Type.h"
-#include "SynTree/Attribute.h"
-#include "SynTree/TypeSubstitution.h"
-#include "SynTree/Mutator.h"
-#include "ResolvExpr/FindOpenVars.h"
-#include "Common/UniqueName.h"
-#include "Common/utility.h"
-#include "InitTweak/InitTweak.h"
-#include "Tuples/Tuples.h"
+#include "SynTree/Attribute.h"           // for Attribute
+#include "SynTree/Declaration.h"         // for FunctionDecl, DeclarationWit...
+#include "SynTree/Expression.h"          // for ApplicationExpr, Expression
+#include "SynTree/Label.h"               // for Label, noLabels
+#include "SynTree/Mutator.h"             // for mutateAll
+#include "SynTree/Statement.h"           // for CompoundStmt, DeclStmt, Expr...
+#include "SynTree/Type.h"                // for FunctionType, TupleType, Type
+#include "SynTree/TypeSubstitution.h"    // for TypeSubstitution
+#include "SynTree/Visitor.h"             // for Visitor
 
 namespace GenPoly {
@@ -93,4 +101,26 @@
 	}
 
+	// walk into tuple type and find the number of components
+	size_t singleParameterSize( Type * type ) {
+		if ( TupleType * tt = dynamic_cast< TupleType * >( type ) ) {
+			size_t sz = 0;
+			for ( Type * t : *tt ) {
+				sz += singleParameterSize( t );
+			}
+			return sz;
+		} else {
+			return 1;
+		}
+	}
+
+	// find the total number of components in a parameter list
+	size_t functionParameterSize( FunctionType * ftype ) {
+		size_t sz = 0;
+		for ( DeclarationWithType * p : ftype->get_parameters() ) {
+			sz += singleParameterSize( p->get_type() );
+		}
+		return sz;
+	}
+
 	bool needsTupleSpecialization( Type *formalType, Type *actualType ) {
 		// Needs tuple specialization if the structure of the formal type and actual type do not match.
@@ -103,5 +133,9 @@
 			FunctionType * aftype = getFunctionType( actualType->stripReferences() );
 			assertf( aftype, "formal type is a function type, but actual type is not: %s", toString( actualType ).c_str() );
+			// Can't tuple specialize if parameter sizes deeply-differ.
+			if ( functionParameterSize( fftype ) != functionParameterSize( aftype ) ) return false;
+			// tuple-parameter sizes are the same, but actual parameter sizes differ - must tuple specialize
 			if ( fftype->get_parameters().size() != aftype->get_parameters().size() ) return true;
+			// total parameter size can be the same, while individual parameters can have different structure
 			for ( auto params : group_iterate( fftype->get_parameters(), aftype->get_parameters() ) ) {
 				DeclarationWithType * formal = std::get<0>(params);
Index: src/GenPoly/Specialize.h
===================================================================
--- src/GenPoly/Specialize.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/GenPoly/Specialize.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,7 +16,7 @@
 #pragma once
 
-#include <list>
+#include <list>  // for list
 
-#include "SynTree/SynTree.h"
+class Declaration;
 
 namespace GenPoly {
Index: src/InitTweak/FixGlobalInit.cc
===================================================================
--- src/InitTweak/FixGlobalInit.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/InitTweak/FixGlobalInit.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,13 +15,22 @@
 
 #include "FixGlobalInit.h"
-#include "InitTweak.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Visitor.h"
-#include "SynTree/Attribute.h"
-#include <algorithm>
+
+#include <cassert>                 // for assert
+#include <stddef.h>                // for NULL
+#include <algorithm>               // for replace_if
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/UniqueName.h"     // for UniqueName
+#include "InitTweak.h"             // for isIntrinsicSingleArgCallStmt
+#include "Parser/LinkageSpec.h"    // for C
+#include "SynTree/Attribute.h"     // for Attribute
+#include "SynTree/Constant.h"      // for Constant
+#include "SynTree/Declaration.h"   // for FunctionDecl, ObjectDecl, Declaration
+#include "SynTree/Expression.h"    // for ConstantExpr, Expression (ptr only)
+#include "SynTree/Initializer.h"   // for ConstructorInit, Initializer
+#include "SynTree/Label.h"         // for Label, noLabels
+#include "SynTree/Statement.h"     // for CompoundStmt, Statement (ptr only)
+#include "SynTree/Type.h"          // for Type, Type::StorageClasses, Functi...
+#include "SynTree/Visitor.h"       // for acceptAll, Visitor
 
 namespace InitTweak {
Index: src/InitTweak/FixGlobalInit.h
===================================================================
--- src/InitTweak/FixGlobalInit.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/InitTweak/FixGlobalInit.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,9 +16,8 @@
 #pragma once
 
-#include <string>
-#include <list>
+#include <list>    // for list
+#include <string>  // for string
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Declaration.h"
+class Declaration;
 
 namespace InitTweak {
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/InitTweak/FixInit.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -13,34 +13,50 @@
 // Update Count     : 74
 //
-
-#include <stack>
-#include <list>
-#include <iterator>
-#include <algorithm>
-#include <unordered_map>
-#include <unordered_set>
-
-#include "InitTweak.h"
-#include "GenInit.h"
 #include "FixInit.h"
-#include "FixGlobalInit.h"
-#include "CodeGen/GenType.h"  // for warning/error messages
+
+#include <stddef.h>                    // for NULL
+#include <algorithm>                   // for set_difference, copy_if
+#include <cassert>                     // for assert, safe_dynamic_cast
+#include <iostream>                    // for operator<<, ostream, basic_ost...
+#include <iterator>                    // for insert_iterator, back_inserter
+#include <list>                        // for _List_iterator, list, list<>::...
+#include <map>                         // for _Rb_tree_iterator, _Rb_tree_co...
+#include <memory>                      // for allocator_traits<>::value_type
+#include <set>                         // for set, set<>::value_type
+#include <unordered_map>               // for unordered_map, unordered_map<>...
+#include <unordered_set>               // for unordered_set
+#include <utility>                     // for pair
+
+#include "CodeGen/GenType.h"           // for genPrettyType
 #include "CodeGen/OperatorTable.h"
-#include "Common/PassVisitor.h"
-#include "GenPoly/DeclMutator.h"
-#include "GenPoly/PolyMutator.h"
-#include "ResolvExpr/Resolver.h"
-#include "ResolvExpr/typeops.h"
-#include "SymTab/Autogen.h"
-#include "SymTab/Indexer.h"
-#include "SynTree/AddStmtVisitor.h"
-#include "SynTree/Attribute.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Mutator.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Type.h"
-#include "Tuples/Tuples.h"
+#include "Common/PassVisitor.h"        // for PassVisitor, WithStmtsToAdd
+#include "Common/SemanticError.h"      // for SemanticError
+#include "Common/UniqueName.h"         // for UniqueName
+#include "Common/utility.h"            // for CodeLocation, ValueGuard, toSt...
+#include "FixGlobalInit.h"             // for fixGlobalInit
+#include "GenInit.h"                   // for genCtorDtor
+#include "GenPoly/DeclMutator.h"       // for DeclMutator
+#include "GenPoly/GenPoly.h"           // for getFunctionType
+#include "GenPoly/PolyMutator.h"       // for PolyMutator
+#include "InitTweak.h"                 // for getFunctionName, getCallArg
+#include "Parser/LinkageSpec.h"        // for C, Spec, Cforall, isBuiltin
+#include "ResolvExpr/Resolver.h"       // for findVoidExpression
+#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "SymTab/Autogen.h"            // for genImplicitCall
+#include "SymTab/Indexer.h"            // for Indexer
+#include "SymTab/Mangler.h"            // for Mangler
+#include "SynTree/AddStmtVisitor.h"    // for AddStmtVisitor
+#include "SynTree/Attribute.h"         // for Attribute
+#include "SynTree/Constant.h"          // for Constant
+#include "SynTree/Declaration.h"       // for ObjectDecl, FunctionDecl, Decl...
+#include "SynTree/Expression.h"        // for UniqueExpr, VariableExpr, Unty...
+#include "SynTree/Initializer.h"       // for ConstructorInit, SingleInit
+#include "SynTree/Label.h"             // for Label, noLabels, operator<
+#include "SynTree/Mutator.h"           // for mutateAll, Mutator, maybeMutate
+#include "SynTree/Statement.h"         // for ExprStmt, CompoundStmt, Branch...
+#include "SynTree/Type.h"              // for Type, Type::StorageClasses
+#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution, operator<<
+#include "SynTree/Visitor.h"           // for acceptAll, maybeAccept
+#include "Tuples/Tuples.h"             // for isTtype
 
 bool ctordtorp = false; // print all debug
Index: src/InitTweak/FixInit.h
===================================================================
--- src/InitTweak/FixInit.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/InitTweak/FixInit.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,10 +16,8 @@
 #pragma once
 
-#include <string>
-#include <list>
+#include <list>    // for list
+#include <string>  // for string
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Mutator.h"
+class Declaration;
 
 namespace InitTweak {
Index: src/InitTweak/GenInit.cc
===================================================================
--- src/InitTweak/GenInit.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/InitTweak/GenInit.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -13,29 +13,32 @@
 // Update Count     : 183
 //
-
-#include <stack>
-#include <list>
-
-#include "InitTweak.h"
 #include "GenInit.h"
 
-#include "Common/PassVisitor.h"
+#include <stddef.h>                // for NULL
+#include <algorithm>               // for any_of
+#include <cassert>                 // for assert, safe_dynamic_cast, assertf
+#include <iterator>                // for back_inserter, inserter, back_inse...
+#include <list>                    // for _List_iterator, list
+
 #include "CodeGen/OperatorTable.h"
-
-#include "GenPoly/DeclMutator.h"
-#include "GenPoly/PolyMutator.h"
-#include "GenPoly/ScopedSet.h"
-
-#include "ResolvExpr/typeops.h"
-
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Mutator.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Type.h"
-
-#include "SymTab/Autogen.h"
-#include "SymTab/Mangler.h"
+#include "Common/PassVisitor.h"    // for PassVisitor, WithGuards, WithShort...
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/UniqueName.h"     // for UniqueName
+#include "Common/utility.h"        // for ValueGuard, maybeClone
+#include "GenPoly/DeclMutator.h"   // for DeclMutator
+#include "GenPoly/GenPoly.h"       // for getFunctionType, isPolyType
+#include "GenPoly/ScopedSet.h"     // for ScopedSet, ScopedSet<>::const_iter...
+#include "InitTweak.h"             // for isConstExpr, InitExpander, checkIn...
+#include "Parser/LinkageSpec.h"    // for isOverridable, C
+#include "SymTab/Autogen.h"        // for genImplicitCall, SizeType
+#include "SymTab/Mangler.h"        // for Mangler
+#include "SynTree/Declaration.h"   // for ObjectDecl, DeclarationWithType
+#include "SynTree/Expression.h"    // for VariableExpr, UntypedExpr, Address...
+#include "SynTree/Initializer.h"   // for ConstructorInit, SingleInit, Initi...
+#include "SynTree/Label.h"         // for Label
+#include "SynTree/Mutator.h"       // for mutateAll
+#include "SynTree/Statement.h"     // for CompoundStmt, ImplicitCtorDtorStmt
+#include "SynTree/Type.h"          // for Type, ArrayType, Type::Qualifiers
+#include "SynTree/Visitor.h"       // for acceptAll, maybeAccept
 
 namespace InitTweak {
Index: src/InitTweak/GenInit.h
===================================================================
--- src/InitTweak/GenInit.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/InitTweak/GenInit.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,10 +16,8 @@
 #pragma once
 
-#include <string>
-#include <list>
+#include <list>               // for list
+#include <string>             // for string
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Mutator.h"
+#include "SynTree/SynTree.h"  // for Visitor Nodes
 
 namespace InitTweak {
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/InitTweak/InitTweak.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -1,11 +1,28 @@
-#include <algorithm>
+#include <stddef.h>                // for NULL
+#include <algorithm>               // for find, all_of
+#include <cassert>                 // for assertf, assert, safe_dynamic_cast
+#include <iostream>                // for ostream, cerr, endl
+#include <iterator>                // for back_insert_iterator, back_inserter
+#include <memory>                  // for __shared_ptr
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/UniqueName.h"     // for UniqueName
+#include "Common/utility.h"        // for toString, deleteAll, maybeClone
+#include "GenPoly/GenPoly.h"       // for getFunctionType
 #include "InitTweak.h"
-#include "SynTree/Visitor.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Attribute.h"
-#include "GenPoly/GenPoly.h"
-#include "ResolvExpr/typeops.h"
+#include "Parser/LinkageSpec.h"    // for Spec, isBuiltin, Intrinsic
+#include "ResolvExpr/typeops.h"    // for typesCompatibleIgnoreQualifiers
+#include "SymTab/Indexer.h"        // for Indexer
+#include "SynTree/Attribute.h"     // for Attribute
+#include "SynTree/Constant.h"      // for Constant
+#include "SynTree/Declaration.h"   // for ObjectDecl, DeclarationWithType
+#include "SynTree/Expression.h"    // for Expression, UntypedExpr, Applicati...
+#include "SynTree/Initializer.h"   // for Initializer, ListInit, Designation
+#include "SynTree/Label.h"         // for Label, noLabels
+#include "SynTree/Statement.h"     // for CompoundStmt, ExprStmt, BranchStmt
+#include "SynTree/Type.h"          // for FunctionType, ArrayType, PointerType
+#include "SynTree/Visitor.h"       // for Visitor, maybeAccept
+
+class UntypedValofExpr;
 
 namespace InitTweak {
Index: src/InitTweak/InitTweak.h
===================================================================
--- src/InitTweak/InitTweak.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/InitTweak/InitTweak.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,10 +16,9 @@
 #pragma once
 
-#include <string>
-#include <list>
+#include <list>               // for list
+#include <memory>             // for shared_ptr
+#include <string>             // for string, allocator
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Mutator.h"
+#include "SynTree/SynTree.h"  // for Visitor Nodes
 
 // helper functions for initialization
@@ -99,4 +98,5 @@
 
 		class ExpanderImpl;
+
 		typedef std::list< Expression * > IndexList;
 	private:
Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/DeclarationNode.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,17 +14,26 @@
 //
 
-#include <string>
-#include <list>
-#include <iterator>
-#include <algorithm>
-#include <cassert>
-
-#include "TypeData.h"
-
-#include "SynTree/Attribute.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-
-#include "TypedefTable.h"
+#include <cassert>                 // for assert, assertf, safe_dynamic_cast
+#include <iterator>                // for back_insert_iterator
+#include <list>                    // for list
+#include <memory>                  // for unique_ptr
+#include <ostream>                 // for operator<<, ostream, basic_ostream
+#include <string>                  // for string, operator+, allocator, char...
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/UniqueName.h"     // for UniqueName
+#include "Common/utility.h"        // for maybeClone, maybeBuild, CodeLocation
+#include "Parser/LinkageSpec.h"    // for Spec, linkageName, Cforall
+#include "Parser/ParseNode.h"      // for DeclarationNode, ExpressionNode
+#include "SynTree/Attribute.h"     // for Attribute
+#include "SynTree/Declaration.h"   // for TypeDecl, ObjectDecl, Declaration
+#include "SynTree/Expression.h"    // for Expression, ConstantExpr
+#include "SynTree/Statement.h"     // for AsmStmt
+#include "SynTree/Type.h"          // for Type, Type::StorageClasses, Type::...
+#include "TypeData.h"              // for TypeData, TypeData::Aggregate_t
+#include "TypedefTable.h"          // for TypedefTable, TypedefTable::kind_t...
+
+class Initializer;
+
 extern TypedefTable typedefTable;
 
Index: src/Parser/ExpressionNode.cc
===================================================================
--- src/Parser/ExpressionNode.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/ExpressionNode.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,13 +14,22 @@
 //
 
-#include <climits>										// access INT_MAX, UINT_MAX, LONG_MAX, ULONG_MAX, LLONG_MAX
-#include <sstream>
-
-#include "ParseNode.h"
-#include "TypeData.h"
-#include "SynTree/Constant.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Declaration.h"
-#include "parserutility.h"
+#include <cassert>                 // for assert
+#include <stdio.h>                 // for sscanf, size_t
+#include <climits>                 // for LLONG_MAX, LONG_MAX, INT_MAX, UINT...
+#include <list>                    // for list
+#include <sstream>                 // for basic_istream::operator>>, basic_i...
+#include <string>                  // for string, operator+, operator==
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/utility.h"        // for maybeMoveBuild, maybeBuild, CodeLo...
+#include "ParseNode.h"             // for ExpressionNode, maybeMoveBuildType
+#include "SynTree/Constant.h"      // for Constant
+#include "SynTree/Declaration.h"   // for EnumDecl, StructDecl, UnionDecl
+#include "SynTree/Expression.h"    // for Expression, ConstantExpr, NameExpr
+#include "SynTree/Statement.h"     // for CompoundStmt, Statement
+#include "SynTree/Type.h"          // for BasicType, Type, Type::Qualifiers
+#include "parserutility.h"         // for notZeroExpr
+
+class Initializer;
 
 using namespace std;
@@ -69,5 +78,5 @@
 		goto CLEANUP;
 	} // if
-	
+
 	if ( str[0] == '0' ) {								// octal/hex constant ?
 		dec = false;
Index: src/Parser/InitializerNode.cc
===================================================================
--- src/Parser/InitializerNode.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/InitializerNode.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,11 +14,15 @@
 //
 
-#include <cassert>
-#include <iostream>
+#include <iostream>                // for operator<<, ostream, basic_ostream
+#include <list>                    // for list
+#include <string>                  // for operator<<, string
+
 using namespace std;
 
-#include "ParseNode.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Initializer.h"
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/utility.h"        // for maybeBuild
+#include "ParseNode.h"             // for InitializerNode, ExpressionNode
+#include "SynTree/Expression.h"    // for Expression
+#include "SynTree/Initializer.h"   // for Initializer, ListInit, SingleInit
 
 InitializerNode::InitializerNode( ExpressionNode * _expr, bool aggrp, ExpressionNode * des )
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/ParseNode.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,29 +10,35 @@
 // Created On       : Sat May 16 13:28:16 2015
 // Last Modified By : Andrew Beach
-// Last Modified On : Thu Aug 10 16:54:00 2017
-// Update Count     : 789
+// Last Modified On : Thr Aug 17 13:46:00 2017
+// Update Count     : 795
 //
 
 #pragma once
 
-#include <string>
-#include <list>
-#include <iterator>
-#include <memory>
-
-#include "Parser/LinkageSpec.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Label.h"
-#include "Common/utility.h"
-#include "Common/UniqueName.h"
-
+#include <algorithm>               // for move
+#include <cassert>                 // for assert, assertf
+#include <iosfwd>                  // for ostream
+#include <iterator>                // for back_insert_iterator
+#include <list>                    // for list
+#include <memory>                  // for unique_ptr, pointer_traits
+#include <string>                  // for string
+
+#include "Common/CodeLocation.h"   // for CodeLocation
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/UniqueName.h"     // for UniqueName
+#include "Common/utility.h"        // for maybeClone, maybeBuild
+#include "Parser/LinkageSpec.h"    // for Spec
+#include "SynTree/Expression.h"    // for Expression, ConstantExpr (ptr only)
+#include "SynTree/Label.h"         // for Label
+#include "SynTree/Statement.h"     // for Statement, BranchStmt, BranchStmt:...
+#include "SynTree/Type.h"          // for Type, Type::FuncSpecifiers, Type::...
+
+class Attribute;
+class Declaration;
+class DeclarationNode;
+class DeclarationWithType;
+class ExpressionNode;
+class Initializer;
 class StatementNode;
-class CompoundStmtNode;
-class DeclarationNode;
-class ExpressionNode;
-class InitializerNode;
-class Attribute;
 
 //##############################################################################
@@ -371,4 +377,12 @@
 Statement * build_expr( ExpressionNode * ctl );
 
+struct IfCtl {
+	IfCtl( DeclarationNode * decl, ExpressionNode * condition ) :
+		init( decl ? new StatementNode( decl ) : nullptr ), condition( condition ) {}
+
+	StatementNode * init;
+	ExpressionNode * condition;
+};
+
 struct ForCtl {
 	ForCtl( ExpressionNode * expr, ExpressionNode * condition, ExpressionNode * change ) :
@@ -382,5 +396,5 @@
 };
 
-Statement * build_if( ExpressionNode * ctl, StatementNode * then_stmt, StatementNode * else_stmt );
+Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt );
 Statement * build_switch( ExpressionNode * ctl, StatementNode * stmt );
 Statement * build_case( ExpressionNode * ctl );
Index: src/Parser/StatementNode.cc
===================================================================
--- src/Parser/StatementNode.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/StatementNode.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,17 +10,23 @@
 // Created On       : Sat May 16 14:59:41 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jul 11 21:23:15 2017
-// Update Count     : 331
-//
-
-#include <list>
-#include <algorithm>
-#include <cassert>
-
-#include "ParseNode.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Expression.h"
-#include "parserutility.h"
-#include "Common/utility.h"
+// Last Modified On : Thu Aug 17 16:01:31 2017
+// Update Count     : 345
+//
+
+#include <cassert>                 // for assert, safe_dynamic_cast, assertf
+#include <list>                    // for list
+#include <memory>                  // for unique_ptr
+#include <string>                  // for string
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/utility.h"        // for maybeMoveBuild, maybeBuild
+#include "ParseNode.h"             // for StatementNode, ExpressionNode, bui...
+#include "SynTree/Expression.h"    // for Expression, ConstantExpr
+#include "SynTree/Label.h"         // for Label, noLabels
+#include "SynTree/Declaration.h"
+#include "SynTree/Statement.h"     // for Statement, BranchStmt, CaseStmt
+#include "parserutility.h"         // for notZeroExpr
+
+class Declaration;
 
 using namespace std;
@@ -74,5 +80,5 @@
 }
 
-Statement *build_if( ExpressionNode *ctl, StatementNode *then_stmt, StatementNode *else_stmt ) {
+Statement *build_if( IfCtl * ctl, StatementNode *then_stmt, StatementNode *else_stmt ) {
 	Statement *thenb, *elseb = 0;
 	std::list< Statement * > branches;
@@ -87,5 +93,13 @@
 		elseb = branches.front();
 	} // if
-	return new IfStmt( noLabels, notZeroExpr( maybeMoveBuild< Expression >(ctl) ), thenb, elseb );
+	
+	std::list< Statement * > init;
+	if ( ctl->init != 0 ) {
+		buildMoveList( ctl->init, init );
+	} // if
+
+	Expression * cond = ctl->condition ? maybeMoveBuild< Expression >(ctl->condition) : new VariableExpr( dynamic_cast<DeclarationWithType *>( dynamic_cast<DeclStmt *>( init.back() )->decl ) );
+	delete ctl;
+	return new IfStmt( noLabels, notZeroExpr( cond ), thenb, elseb, init );
 }
 
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/TypeData.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,14 +14,19 @@
 //
 
-#include <cassert>
-#include <algorithm>
-#include <iterator>
-#include "Common/utility.h"
+#include <cassert>                 // for assert
+#include <ostream>                 // for operator<<, ostream, basic_ostream
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/utility.h"        // for maybeClone, maybeBuild, maybeMoveB...
+#include "Parser/ParseNode.h"      // for DeclarationNode, ExpressionNode
+#include "SynTree/Declaration.h"   // for TypeDecl, ObjectDecl, FunctionDecl
+#include "SynTree/Expression.h"    // for Expression, ConstantExpr (ptr only)
+#include "SynTree/Initializer.h"   // for SingleInit, Initializer (ptr only)
+#include "SynTree/Statement.h"     // for CompoundStmt, Statement
+#include "SynTree/Type.h"          // for BasicType, Type, Type::ForallList
 #include "TypeData.h"
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Initializer.h"
+
+class Attribute;
+
 using namespace std;
 
Index: src/Parser/TypeData.h
===================================================================
--- src/Parser/TypeData.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/TypeData.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,12 @@
 #pragma once
 
-#include "ParseNode.h"
-#include "SynTree/Type.h"
+#include <iosfwd>                // for ostream
+#include <list>                  // for list
+#include <string>                // for string
+
+#include "ParseNode.h"           // for DeclarationNode, DeclarationNode::Ag...
+#include "Parser/LinkageSpec.h"  // for Spec
+#include "SynTree/Type.h"        // for Type, ReferenceToType (ptr only)
+#include "SynTree/SynTree.h"     // for Visitor Nodes
 
 struct TypeData {
Index: src/Parser/TypedefTable.cc
===================================================================
--- src/Parser/TypedefTable.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/TypedefTable.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,12 +14,20 @@
 //
 
-#include <map>
-#include <list>
-#include <cassert>
+#include <ext/alloc_traits.h>    // for __alloc_traits<>::value_type
+#include <cassert>               // for assert
+#include <list>                  // for list, _List_iterator, list<>::iterator
+#include <map>                   // for _Rb_tree_iterator, _Rb_tree_const_it...
+#include <memory>                // for allocator_traits<>::value_type
+#include <utility>               // for pair
+
+#include "Parser/ParserTypes.h"  // for typedefTable
+#include "Parser/parser.hh"      // for IDENTIFIER
 #include "TypedefTable.h"
+
 using namespace std;
 
 #if 0
 #include <iostream>
+
 #define debugPrint( x ) cerr << x
 #else
Index: src/Parser/TypedefTable.h
===================================================================
--- src/Parser/TypedefTable.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/TypedefTable.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// TypedefTable.h -- 
+// TypedefTable.h --
 //
 // Author           : Rodolfo G. Esteves
@@ -16,11 +16,11 @@
 #pragma once
 
-#include <map>
-#include <list>
-#include <string>
-#include <stack>
+#include <list>       // for list
+#include <map>        // for map, map<>::value_compare
+#include <stack>      // for stack
+#include <string>     // for string
 
 #include "ParserTypes.h"
-#include "parser.hh"
+#include "parser.hh"  // for IDENTIFIER, TYPEDEFname, TYPEGENname
 
 class TypedefTable {
@@ -32,5 +32,5 @@
 		kind_t kind;
 	};
-	
+
 	struct DeferredEntry {
 		std::string identifier;
@@ -44,9 +44,9 @@
 	std::string currentTrait;
 	int contextScope;
-	
+
 	typedef std::list< DeferredEntry > deferListType;
 	std::stack< deferListType > deferListStack;
 	std::map< std::string, deferListType > contexts;
-	
+
 	std::stack< std::string > nextIdentifiers;
 
@@ -70,16 +70,16 @@
 	void addToEnclosingScope( const std::string &identifier, kind_t kind );
 	void addToEnclosingScope( kind_t kind );		// use nextIdentifiers.top()
-	
+
 	// "addToEnclosingScope2" adds the identifier/type pair to the scope that encloses the scope enclosing the the
 	// current one.  This is the right way to handle assertion names
 	void addToEnclosingScope2( const std::string &identifier, kind_t kind );
 	void addToEnclosingScope2( kind_t kind );		// use nextIdentifiers.top()
-	
+
 	// set the next identifier to be used by an "add" operation without an identifier parameter within the current scope
 	void setNextIdentifier( const std::string &identifier );
-	
+
 	// dump the definitions from a pre-defined context into the current scope
 	void openTrait( const std::string &contextName );
-	
+
 	void enterScope();
 	void leaveScope();
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/parser.yy	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,7 +9,7 @@
 // Author           : Peter A. Buhr
 // Created On       : Sat Sep  1 20:22:55 2001
-// Last Modified By : Andrew Beach
-// Last Modified On : Wed Aug  4 13:33:00 2017
-// Update Count     : 2475
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun Aug 20 09:21:54 2017
+// Update Count     : 2573
 //
 
@@ -98,4 +98,5 @@
 	StatementNode * sn;
 	ConstantExpr * constant;
+	IfCtl * ifctl;
 	ForCtl * fctl;
 	LabelNode * label;
@@ -130,5 +131,5 @@
 %token ATTRIBUTE EXTENSION								// GCC
 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
-%token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH	// CFA
+%token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH // CFA
 %token ASM												// C99, extension ISO/IEC 9899:1999 Section J.5.10(1)
 %token ALIGNAS ALIGNOF GENERIC STATICASSERT				// C11
@@ -175,4 +176,5 @@
 %type<en> comma_expression				comma_expression_opt
 %type<en> argument_expression_list		argument_expression			default_initialize_opt
+%type<ifctl> if_control_expression
 %type<fctl> for_control_expression
 %type<en> subrange
@@ -794,10 +796,10 @@
 
 selection_statement:
-	IF '(' comma_expression ')' statement				%prec THEN
+	IF '(' push if_control_expression ')' statement				%prec THEN
 		// explicitly deal with the shift/reduce conflict on if/else
-		{ $$ = new StatementNode( build_if( $3, $5, nullptr ) ); }
-	| IF '(' comma_expression ')' statement ELSE statement
-		{ $$ = new StatementNode( build_if( $3, $5, $7 ) ); }
-	| SWITCH '(' comma_expression ')' case_clause		// CFA
+		{ $$ = new StatementNode( build_if( $4, $6, nullptr ) ); }
+	| IF '(' push if_control_expression ')' statement ELSE statement
+		{ $$ = new StatementNode( build_if( $4, $6, $8 ) ); }
+	| SWITCH '(' comma_expression ')' case_clause
 		{ $$ = new StatementNode( build_switch( $3, $5 ) ); }
 	| SWITCH '(' comma_expression ')' '{' push declaration_list_opt switch_clause_list_opt '}' // CFA
@@ -819,4 +821,15 @@
 		}
 	;
+
+if_control_expression:
+	comma_expression pop
+		{ $$ = new IfCtl( nullptr, $1 ); }
+	| c_declaration pop									// no semi-colon
+		{ $$ = new IfCtl( $1, nullptr ); }
+	| cfa_declaration pop								// no semi-colon
+		{ $$ = new IfCtl( $1, nullptr ); }
+	| declaration comma_expression						// semi-colon separated
+		{ $$ = new IfCtl( $1, $2 ); }
+ 	;
 
 // CASE and DEFAULT clauses are only allowed in the SWITCH statement, precluding Duff's device. In addition, a case
@@ -1091,5 +1104,5 @@
 
 KR_declaration_list_opt:								// used to declare parameter types in K&R style functions
-	pop
+	// empty
 		{ $$ = nullptr; }
 	| KR_declaration_list
@@ -1097,6 +1110,7 @@
 
 KR_declaration_list:
-	c_declaration
-	| KR_declaration_list push c_declaration
+	push c_declaration pop ';'
+		{ $$ = $2; }
+	| KR_declaration_list push c_declaration pop ';'
 		{ $$ = $1->appendList( $3 ); }
 	;
@@ -1117,7 +1131,7 @@
 	;
 
-declaration:											// CFA, new & old style declarations
-	cfa_declaration
-	| c_declaration
+declaration:											// old & new style declarations
+	c_declaration pop ';'
+	| cfa_declaration pop ';'							// CFA
 	;
 
@@ -1134,9 +1148,9 @@
 
 cfa_declaration:										// CFA
-	cfa_variable_declaration pop ';'
-	| cfa_typedef_declaration pop ';'
-	| cfa_function_declaration pop ';'
-	| type_declaring_list pop ';'
-	| trait_specifier pop ';'
+	cfa_variable_declaration
+	| cfa_typedef_declaration
+	| cfa_function_declaration
+	| type_declaring_list
+	| trait_specifier
 	;
 
@@ -1338,11 +1352,11 @@
 
 c_declaration:
-	declaration_specifier declaring_list pop ';'
+	declaration_specifier declaring_list
 		{
 			$$ = distAttr( $1, $2 );
 		}
-	| typedef_declaration pop ';'
-	| typedef_expression pop ';'						// GCC, naming expression type
-	| sue_declaration_specifier pop ';'
+	| typedef_declaration
+	| typedef_expression								// GCC, naming expression type
+	| sue_declaration_specifier
 	;
 
@@ -2215,9 +2229,9 @@
 			$$ = $1->addFunctionBody( $2 );
 		}
-	| KR_function_declarator push KR_declaration_list_opt compound_statement
+	| KR_function_declarator KR_declaration_list_opt compound_statement
 		{
 			typedefTable.addToEnclosingScope( TypedefTable::ID );
 			typedefTable.leaveScope();
-			$$ = $1->addOldDeclList( $3 )->addFunctionBody( $4 );
+			$$ = $1->addOldDeclList( $2 )->addFunctionBody( $3 );
 		}
 	;
@@ -2263,29 +2277,29 @@
 
 		// Old-style K&R function definition, OBSOLESCENT (see 4)
-	| declaration_specifier KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement
+	| declaration_specifier KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
 		{
 			typedefTable.addToEnclosingScope( TypedefTable::ID );
 			typedefTable.leaveScope();
-			$$ = $2->addOldDeclList( $4 )->addFunctionBody( $6 )->addType( $1 );
-		}
-	| type_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement
+			$$ = $2->addOldDeclList( $3 )->addFunctionBody( $5 )->addType( $1 );
+		}
+	| type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
 		{
 			typedefTable.addToEnclosingScope( TypedefTable::ID );
 			typedefTable.leaveScope();
-			$$ = $2->addOldDeclList( $4 )->addFunctionBody( $6 )->addQualifiers( $1 );
+			$$ = $2->addOldDeclList( $3 )->addFunctionBody( $5 )->addQualifiers( $1 );
 		}
 
 		// Old-style K&R function definition with "implicit int" type_specifier, OBSOLESCENT (see 4)
-	| declaration_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement
+	| declaration_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
 		{
 			typedefTable.addToEnclosingScope( TypedefTable::ID );
 			typedefTable.leaveScope();
-			$$ = $2->addOldDeclList( $4 )->addFunctionBody( $6 )->addQualifiers( $1 );
-		}
-	| declaration_qualifier_list type_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement
+			$$ = $2->addOldDeclList( $3 )->addFunctionBody( $5 )->addQualifiers( $1 );
+		}
+	| declaration_qualifier_list type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
 		{
 			typedefTable.addToEnclosingScope( TypedefTable::ID );
 			typedefTable.leaveScope();
-			$$ = $3->addOldDeclList( $5 )->addFunctionBody( $7 )->addQualifiers( $2 )->addQualifiers( $1 );
+			$$ = $3->addOldDeclList( $4 )->addFunctionBody( $6 )->addQualifiers( $2 )->addQualifiers( $1 );
 		}
 	;
Index: src/Parser/parserutility.cc
===================================================================
--- src/Parser/parserutility.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/parserutility.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,6 +15,11 @@
 
 #include "parserutility.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
+
+#include <list>                  // for list
+#include <string>                // for string
+
+#include "SynTree/Constant.h"    // for Constant
+#include "SynTree/Expression.h"  // for UntypedExpr, CastExpr, ConstantExpr
+#include "SynTree/Type.h"        // for BasicType, ZeroType, BasicType::Kind...
 
 // rewrite
Index: src/Parser/parserutility.h
===================================================================
--- src/Parser/parserutility.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Parser/parserutility.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,5 +16,5 @@
 #pragma once
 
-#include "SynTree/SynTree.h"
+class Expression;
 
 Expression *notZeroExpr( Expression *orig );
Index: src/ResolvExpr/AdjustExprType.cc
===================================================================
--- src/ResolvExpr/AdjustExprType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/AdjustExprType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,8 +14,9 @@
 //
 
-#include "typeops.h"
-#include "SynTree/Type.h"
-#include "TypeEnvironment.h"
-#include "SymTab/Indexer.h"
+#include "SymTab/Indexer.h"       // for Indexer
+#include "SynTree/Declaration.h"  // for TypeDecl, TypeDecl::Kind::Ftype
+#include "SynTree/Mutator.h"      // for Mutator
+#include "SynTree/Type.h"         // for PointerType, TypeInstType, Type
+#include "TypeEnvironment.h"      // for EqvClass, TypeEnvironment
 
 namespace ResolvExpr {
Index: src/ResolvExpr/Alternative.cc
===================================================================
--- src/ResolvExpr/Alternative.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/Alternative.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,7 +15,13 @@
 
 #include "Alternative.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
-#include "Common/utility.h"
+
+#include <ostream>                       // for operator<<, ostream, basic_o...
+#include <string>                        // for operator<<, char_traits, string
+
+#include "Common/utility.h"              // for maybeClone
+#include "ResolvExpr/Cost.h"             // for Cost, Cost::zero, operator<<
+#include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment
+#include "SynTree/Expression.h"          // for Expression
+#include "SynTree/Type.h"                // for Type
 
 namespace ResolvExpr {
Index: src/ResolvExpr/Alternative.h
===================================================================
--- src/ResolvExpr/Alternative.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/Alternative.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,11 +16,15 @@
 #pragma once
 
-#include <list>
-#include "SynTree/SynTree.h"
-#include "Cost.h"
-#include "TypeEnvironment.h"
+#include <iosfwd>             // for ostream
+#include <list>               // for list
+
+#include "Cost.h"             // for Cost
+#include "TypeEnvironment.h"  // for TypeEnvironment
+
+class Expression;
 
 namespace ResolvExpr {
 	struct Alternative;
+
 	typedef std::list< Alternative > AltList;
 
Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,35 +14,35 @@
 //
 
-#include <list>
-#include <iterator>
-#include <algorithm>
-#include <functional>
-#include <cassert>
-#include <unordered_map>
-#include <utility>
-#include <vector>
-
+#include <algorithm>               // for copy
+#include <cassert>                 // for safe_dynamic_cast, assert, assertf
+#include <iostream>                // for operator<<, cerr, ostream, endl
+#include <iterator>                // for back_insert_iterator, back_inserter
+#include <list>                    // for _List_iterator, list, _List_const_...
+#include <map>                     // for _Rb_tree_iterator, map, _Rb_tree_c...
+#include <memory>                  // for allocator_traits<>::value_type
+#include <utility>                 // for pair
+
+#include "Alternative.h"           // for AltList, Alternative
 #include "AlternativeFinder.h"
-#include "Alternative.h"
-#include "Cost.h"
-#include "typeops.h"
-#include "Unify.h"
-#include "RenameVars.h"
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Visitor.h"
-#include "SymTab/Indexer.h"
-#include "SymTab/Mangler.h"
-#include "SynTree/TypeSubstitution.h"
-#include "SymTab/Validate.h"
-#include "Tuples/Tuples.h"
-#include "Tuples/Explode.h"
-#include "Common/utility.h"
-#include "InitTweak/InitTweak.h"
-#include "InitTweak/GenInit.h"
-#include "ResolveTypeof.h"
-#include "Resolver.h"
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/utility.h"        // for deleteAll, printAll, CodeLocation
+#include "Cost.h"                  // for Cost, Cost::zero, operator<<, Cost...
+#include "InitTweak/InitTweak.h"   // for getFunctionName
+#include "RenameVars.h"            // for RenameVars, global_renamer
+#include "ResolveTypeof.h"         // for resolveTypeof
+#include "Resolver.h"              // for resolveStmtExpr
+#include "SymTab/Indexer.h"        // for Indexer
+#include "SymTab/Mangler.h"        // for Mangler
+#include "SymTab/Validate.h"       // for validateType
+#include "SynTree/Constant.h"      // for Constant
+#include "SynTree/Declaration.h"   // for DeclarationWithType, TypeDecl, Dec...
+#include "SynTree/Expression.h"    // for Expression, CastExpr, NameExpr
+#include "SynTree/Initializer.h"   // for SingleInit, operator<<, Designation
+#include "SynTree/SynTree.h"       // for UniqueId
+#include "SynTree/Type.h"          // for Type, FunctionType, PointerType
+#include "Tuples/Explode.h"        // for explode
+#include "Tuples/Tuples.h"         // for isTtype, handleTupleAssignment
+#include "Unify.h"                 // for unify
+#include "typeops.h"               // for adjustExprType, polyCost, castCost
 
 extern bool resolvep;
@@ -979,6 +979,6 @@
 	void AlternativeFinder::visit( SizeofExpr *sizeofExpr ) {
 		if ( sizeofExpr->get_isType() ) {
-			// xxx - resolveTypeof?
-			alternatives.push_back( Alternative( sizeofExpr->clone(), env, Cost::zero ) );
+			Type * newType = sizeofExpr->get_type()->clone();
+			alternatives.push_back( Alternative( new SizeofExpr( resolveTypeof( newType, indexer ) ), env, Cost::zero ) );
 		} else {
 			// find all alternatives for the argument to sizeof
@@ -1000,6 +1000,6 @@
 	void AlternativeFinder::visit( AlignofExpr *alignofExpr ) {
 		if ( alignofExpr->get_isType() ) {
-			// xxx - resolveTypeof?
-			alternatives.push_back( Alternative( alignofExpr->clone(), env, Cost::zero ) );
+			Type * newType = alignofExpr->get_type()->clone();
+			alternatives.push_back( Alternative( new AlignofExpr( resolveTypeof( newType, indexer ) ), env, Cost::zero ) );
 		} else {
 			// find all alternatives for the argument to sizeof
Index: src/ResolvExpr/AlternativeFinder.h
===================================================================
--- src/ResolvExpr/AlternativeFinder.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/AlternativeFinder.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,11 +16,17 @@
 #pragma once
 
-#include <set>
+#include <algorithm>                     // for copy
+#include <list>                          // for list
+#include <string>                        // for string
 
-#include "Alternative.h"
-#include "Unify.h"
-#include "SynTree/SynTree.h"
-#include "SymTab/Indexer.h"
-#include "SynTree/TypeSubstitution.h"
+#include "Alternative.h"                 // for AltList, Alternative
+#include "ResolvExpr/Cost.h"             // for Cost, Cost::infinity
+#include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
+#include "SynTree/Visitor.h"             // for Visitor
+#include "SynTree/SynTree.h"             // for Visitor Nodes
+
+namespace SymTab {
+class Indexer;
+}  // namespace SymTab
 
 namespace ResolvExpr {
Index: src/ResolvExpr/AlternativePrinter.cc
===================================================================
--- src/ResolvExpr/AlternativePrinter.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/AlternativePrinter.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,10 +15,13 @@
 
 #include "AlternativePrinter.h"
-#include "AlternativeFinder.h"
-#include "Alternative.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Type.h"
-#include "SynTree/Expression.h"
-#include "Common/utility.h"
+
+#include <list>                          // for _List_const_iterator, list<>...
+
+#include "Alternative.h"                 // for AltList, Alternative
+#include "AlternativeFinder.h"           // for AlternativeFinder
+#include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment
+#include "SynTree/Expression.h"          // for Expression
+#include "SynTree/Statement.h"           // for ExprStmt
+#include "SynTree/Type.h"                // for Type
 
 namespace ResolvExpr {
Index: src/ResolvExpr/AlternativePrinter.h
===================================================================
--- src/ResolvExpr/AlternativePrinter.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/AlternativePrinter.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,8 +16,9 @@
 #pragma once
 
-#include <iostream>
+#include <iostream>          // for ostream
 
-#include "Alternative.h"
-#include "SymTab/Indexer.h"
+#include "SymTab/Indexer.h"  // for Indexer
+
+class ExprStmt;
 
 namespace ResolvExpr {
Index: src/ResolvExpr/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/CastCost.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,10 +14,13 @@
 //
 
-#include "typeops.h"
-#include "Cost.h"
-#include "ConversionCost.h"
-#include "SynTree/Type.h"
-#include "SynTree/Visitor.h"
-#include "SymTab/Indexer.h"
+#include <cassert>                       // for assert
+
+#include "ConversionCost.h"              // for ConversionCost
+#include "Cost.h"                        // for Cost, Cost::infinity
+#include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment, EqvClass
+#include "SymTab/Indexer.h"              // for Indexer
+#include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
+#include "SynTree/Type.h"                // for PointerType, Type, TypeInstType
+#include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
 
 
Index: src/ResolvExpr/CommonType.cc
===================================================================
--- src/ResolvExpr/CommonType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/CommonType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,15 @@
 //
 
-#include "typeops.h"
-#include "SynTree/Type.h"
-#include "Unify.h"
+#include <cassert>                       // for safe_dynamic_cast
+#include <map>                           // for _Rb_tree_const_iterator
+#include <utility>                       // for pair
+
+#include "ResolvExpr/TypeEnvironment.h"  // for OpenVarSet, AssertionSet
+#include "SymTab/Indexer.h"              // for Indexer
+#include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl (ptr...
+#include "SynTree/Type.h"                // for BasicType, BasicType::Kind::...
+#include "SynTree/Visitor.h"             // for Visitor
+#include "Unify.h"                       // for unifyExact, bindVar, WidenMode
+#include "typeops.h"                     // for isFtype
 
 // #define DEBUG
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/ConversionCost.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,8 +15,15 @@
 
 #include "ConversionCost.h"
-#include "typeops.h"
-#include "SynTree/Type.h"
-#include "SynTree/Visitor.h"
-#include "SymTab/Indexer.h"
+
+#include <cassert>                       // for assert
+#include <list>                          // for list, list<>::const_iterator
+#include <string>                        // for operator==, string
+
+#include "ResolvExpr/Cost.h"             // for Cost
+#include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
+#include "SymTab/Indexer.h"              // for Indexer
+#include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
+#include "SynTree/Type.h"                // for Type, BasicType, TypeInstType
+#include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
 
 namespace ResolvExpr {
Index: src/ResolvExpr/ConversionCost.h
===================================================================
--- src/ResolvExpr/ConversionCost.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/ConversionCost.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,10 +16,15 @@
 #pragma once
 
-#include "SynTree/Visitor.h"
-#include "SymTab/Indexer.h"
-#include "Cost.h"
-#include "TypeEnvironment.h"
+#include "Cost.h"             // for Cost
+#include "SynTree/Visitor.h"  // for Visitor
+#include "SynTree/SynTree.h"  // for Visitor Nodes
+
+namespace SymTab {
+class Indexer;
+}  // namespace SymTab
 
 namespace ResolvExpr {
+class TypeEnvironment;
+
 	class ConversionCost : public Visitor {
 	  public:
Index: src/ResolvExpr/CurrentObject.cc
===================================================================
--- src/ResolvExpr/CurrentObject.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/CurrentObject.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,15 +14,20 @@
 //
 
-#include <stack>
-#include <iostream>
-
+#include <stddef.h>                    // for size_t
+#include <cassert>                     // for assertf, assert, safe_dynamic_...
+#include <iostream>                    // for ostream, operator<<, basic_ost...
+#include <stack>                       // for stack
+#include <string>                      // for string, operator<<, allocator
+
+#include "Common/Indenter.h"           // for Indenter, operator<<
+#include "Common/SemanticError.h"      // for SemanticError
+#include "Common/utility.h"            // for toString
 #include "CurrentObject.h"
-
-#include "Common/Indenter.h"
-
-#include "SynTree/Declaration.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Type.h"
-#include "SynTree/TypeSubstitution.h"
+#include "SynTree/Constant.h"          // for Constant
+#include "SynTree/Declaration.h"       // for ObjectDecl, Declaration, Struc...
+#include "SynTree/Expression.h"        // for InitAlternative, VariableExpr
+#include "SynTree/Initializer.h"       // for Designation, operator<<
+#include "SynTree/Type.h"              // for Type, StructInstType, UnionIns...
+#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
 
 #if 0
Index: src/ResolvExpr/CurrentObject.h
===================================================================
--- src/ResolvExpr/CurrentObject.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/CurrentObject.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,8 +16,10 @@
 #pragma once
 
-#include <stack>
+#include <list>   // for list
+#include <stack>  // for stack
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Expression.h"
+class Designation;
+class Type;
+struct InitAlternative;
 
 namespace ResolvExpr {
Index: src/ResolvExpr/FindOpenVars.cc
===================================================================
--- src/ResolvExpr/FindOpenVars.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/FindOpenVars.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,6 +15,11 @@
 
 #include "FindOpenVars.h"
-#include "SynTree/Type.h"
-#include "SynTree/Visitor.h"
+
+#include <list>                   // for _List_const_iterator, list<>::const...
+#include <map>                    // for map<>::mapped_type
+
+#include "SynTree/Declaration.h"  // for TypeDecl, DeclarationWithType (ptr ...
+#include "SynTree/Type.h"         // for Type, Type::ForallList, ArrayType
+#include "SynTree/Visitor.h"      // for Visitor
 
 namespace ResolvExpr {
Index: src/ResolvExpr/FindOpenVars.h
===================================================================
--- src/ResolvExpr/FindOpenVars.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/FindOpenVars.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,7 @@
 #pragma once
 
-#include "Unify.h"
-#include "SynTree/SynTree.h"
+#include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
+
+class Type;
 
 namespace ResolvExpr {
Index: src/ResolvExpr/Occurs.cc
===================================================================
--- src/ResolvExpr/Occurs.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/Occurs.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,10 +14,10 @@
 //
 
-#include <set>
-#include <algorithm>
-#include <iterator>
-#include "SynTree/Type.h"
-#include "SynTree/Visitor.h"
-#include "TypeEnvironment.h"
+#include <set>                // for set, _Rb_tree_const_iterator
+#include <string>             // for string
+
+#include "SynTree/Type.h"     // for TypeInstType, Type
+#include "SynTree/Visitor.h"  // for Visitor
+#include "TypeEnvironment.h"  // for EqvClass, TypeEnvironment
 
 namespace ResolvExpr {
Index: src/ResolvExpr/PolyCost.cc
===================================================================
--- src/ResolvExpr/PolyCost.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/PolyCost.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,9 +14,8 @@
 //
 
-#include "typeops.h"
-#include "SynTree/Type.h"
-#include "SynTree/Visitor.h"
-#include "SymTab/Indexer.h"
-#include "TypeEnvironment.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 {
Index: src/ResolvExpr/PtrsAssignable.cc
===================================================================
--- src/ResolvExpr/PtrsAssignable.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/PtrsAssignable.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,8 +14,7 @@
 //
 
-#include "typeops.h"
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Visitor.h"
+#include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
+#include "SynTree/Type.h"                // for TypeInstType, Type, BasicType
+#include "SynTree/Visitor.h"             // for Visitor
 
 
Index: src/ResolvExpr/PtrsCastable.cc
===================================================================
--- src/ResolvExpr/PtrsCastable.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/PtrsCastable.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,9 +14,10 @@
 //
 
-#include "typeops.h"
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Visitor.h"
-#include "SymTab/Indexer.h"
+#include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
+#include "SymTab/Indexer.h"              // for Indexer
+#include "SynTree/Declaration.h"         // for TypeDecl, TypeDecl::Kind::Ftype
+#include "SynTree/Type.h"                // for TypeInstType, Type, BasicType
+#include "SynTree/Visitor.h"             // for Visitor
+#include "typeops.h"                     // for ptrsAssignable
 
 
Index: src/ResolvExpr/RenameVars.cc
===================================================================
--- src/ResolvExpr/RenameVars.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/RenameVars.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,11 +14,15 @@
 //
 
-#include <sstream>
+#include <ext/alloc_traits.h>      // for __alloc_traits<>::value_type
+#include <memory>                  // for allocator_traits<>::value_type
+#include <sstream>                 // for operator<<, basic_ostream, ostring...
+#include <utility>                 // for pair
 
+#include "Common/SemanticError.h"  // for SemanticError
 #include "RenameVars.h"
-#include "SynTree/Visitor.h"
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
+#include "SynTree/Declaration.h"   // for DeclarationWithType, TypeDecl, Dec...
+#include "SynTree/Expression.h"    // for Expression
+#include "SynTree/Type.h"          // for Type, TypeInstType, TraitInstType
+#include "SynTree/Visitor.h"       // for acceptAll, maybeAccept
 
 namespace ResolvExpr {
Index: src/ResolvExpr/RenameVars.h
===================================================================
--- src/ResolvExpr/RenameVars.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/RenameVars.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// RenameVars.h -- 
+// RenameVars.h --
 //
 // Author           : Richard C. Bilson
@@ -16,10 +16,10 @@
 #pragma once
 
-#include <list>
-#include <map>
-#include <string>
+#include <list>               // for list
+#include <map>                // for map
+#include <string>             // for string
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Visitor.h"
+#include "SynTree/SynTree.h"  // for Visitor Nodes
+#include "SynTree/Visitor.h"  // for Visitor
 
 namespace ResolvExpr {
Index: src/ResolvExpr/ResolveTypeof.cc
===================================================================
--- src/ResolvExpr/ResolveTypeof.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/ResolveTypeof.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,10 +15,15 @@
 
 #include "ResolveTypeof.h"
-#include "Alternative.h"
-#include "AlternativeFinder.h"
-#include "Resolver.h"
-#include "TypeEnvironment.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Type.h"
+
+#include <cassert>               // for assert
+
+#include "Resolver.h"            // for resolveInVoidContext
+#include "SynTree/Expression.h"  // for Expression
+#include "SynTree/Mutator.h"     // for Mutator
+#include "SynTree/Type.h"        // for TypeofType, Type
+
+namespace SymTab {
+class Indexer;
+}  // namespace SymTab
 
 namespace ResolvExpr {
Index: src/ResolvExpr/ResolveTypeof.h
===================================================================
--- src/ResolvExpr/ResolveTypeof.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/ResolveTypeof.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,8 @@
 #pragma once
 
-#include "SynTree/SynTree.h"
-#include "SymTab/Indexer.h"
+class Type;
+namespace SymTab {
+class Indexer;
+}  // namespace SymTab
 
 namespace ResolvExpr {
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/Resolver.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,25 +14,29 @@
 //
 
-#include <iostream>
-
-#include "Alternative.h"
-#include "AlternativeFinder.h"
-#include "CurrentObject.h"
-#include "RenameVars.h"
+#include <stddef.h>                      // for NULL
+#include <cassert>                       // for safe_dynamic_cast, assert
+#include <memory>                        // for allocator, allocator_traits<...
+#include <tuple>                         // for get
+
+#include "Alternative.h"                 // for Alternative, AltList
+#include "AlternativeFinder.h"           // for AlternativeFinder, resolveIn...
+#include "Common/SemanticError.h"        // for SemanticError
+#include "Common/utility.h"              // for ValueGuard, group_iterate
+#include "CurrentObject.h"               // for CurrentObject
+#include "InitTweak/InitTweak.h"         // for isIntrinsicSingleArgCallStmt
+#include "RenameVars.h"                  // for RenameVars, global_renamer
+#include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment
+#include "ResolveTypeof.h"               // for resolveTypeof
 #include "Resolver.h"
-#include "ResolveTypeof.h"
-#include "typeops.h"
-
-#include "SynTree/Expression.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Type.h"
-
-#include "SymTab/Autogen.h"
-#include "SymTab/Indexer.h"
-
-#include "Common/utility.h"
-
-#include "InitTweak/InitTweak.h"
+#include "SymTab/Autogen.h"              // for SizeType
+#include "SymTab/Indexer.h"              // for Indexer
+#include "SynTree/Declaration.h"         // for ObjectDecl, TypeDecl, Declar...
+#include "SynTree/Expression.h"          // for Expression, CastExpr, InitExpr
+#include "SynTree/Initializer.h"         // for ConstructorInit, SingleInit
+#include "SynTree/Statement.h"           // for ForStmt, Statement, BranchStmt
+#include "SynTree/Type.h"                // for Type, BasicType, PointerType
+#include "SynTree/TypeSubstitution.h"    // for TypeSubstitution
+#include "SynTree/Visitor.h"             // for acceptAll, maybeAccept
+#include "typeops.h"                     // for extractResultType
 
 using namespace std;
@@ -390,4 +394,9 @@
 
 	void Resolver::visit( CatchStmt *catchStmt ) {
+		// inline Indexer::visit so that the exception variable is still in-scope for
+		// findSingleExpression() below
+		Parent::enterScope();
+		Visitor::visit( catchStmt );
+		
 		if ( catchStmt->get_cond() ) {
 			Expression * wrapped = new CastExpr(
@@ -397,4 +406,6 @@
 			catchStmt->set_cond( findSingleExpression( wrapped, *this ) );
 		}
+
+		Parent::leaveScope();
 	}
 
Index: src/ResolvExpr/Resolver.h
===================================================================
--- src/ResolvExpr/Resolver.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/Resolver.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,13 @@
 #pragma once
 
-#include "SynTree/SynTree.h"
-#include "SymTab/Indexer.h"
+#include <list>  // for list
+
+class ConstructorInit;
+class Declaration;
+class Expression;
+class StmtExpr;
+namespace SymTab {
+class Indexer;
+}  // namespace SymTab
 
 namespace ResolvExpr {
Index: src/ResolvExpr/TypeEnvironment.cc
===================================================================
--- src/ResolvExpr/TypeEnvironment.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/TypeEnvironment.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,11 +14,13 @@
 //
 
-#include <algorithm>
-#include <iterator>
-
+#include <cassert>                     // for assert
+#include <algorithm>                   // for copy, set_intersection
+#include <iterator>                    // for ostream_iterator, insert_iterator
+#include <utility>                     // for pair
+
+#include "Common/utility.h"            // for maybeClone
+#include "SynTree/Type.h"              // for Type, FunctionType, Type::Fora...
+#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
 #include "TypeEnvironment.h"
-#include "SynTree/Type.h"
-#include "SynTree/TypeSubstitution.h"
-#include "Common/utility.h"
 
 namespace ResolvExpr {
Index: src/ResolvExpr/TypeEnvironment.h
===================================================================
--- src/ResolvExpr/TypeEnvironment.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/TypeEnvironment.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,13 +16,14 @@
 #pragma once
 
-#include <string>
-#include <set>
-#include <list>
-#include <iostream>
+#include <iostream>                    // for ostream
+#include <list>                        // for list, list<>::iterator, list<>...
+#include <map>                         // for map, map<>::value_compare
+#include <set>                         // for set
+#include <string>                      // for string
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Type.h"
-#include "SynTree/TypeSubstitution.h"
-#include "SynTree/Declaration.h"
+#include "SynTree/Declaration.h"       // for TypeDecl::Data, DeclarationWit...
+#include "SynTree/SynTree.h"           // for UniqueId
+#include "SynTree/Type.h"              // for Type, Type::ForallList
+#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
 
 namespace ResolvExpr {
Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/Unify.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,17 +14,28 @@
 //
 
-#include <set>
-#include <memory>
-
+#include <cassert>                // for assertf, assert
+#include <iterator>               // for back_insert_iterator, back_inserter
+#include <map>                    // for _Rb_tree_const_iterator, _Rb_tree_i...
+#include <memory>                 // for unique_ptr, auto_ptr
+#include <set>                    // for set
+#include <string>                 // for string, operator==, operator!=, bas...
+#include <utility>                // for pair
+
+#include "FindOpenVars.h"         // for findOpenVars
+#include "Parser/LinkageSpec.h"   // for C
+#include "SynTree/Constant.h"     // for Constant
+#include "SynTree/Declaration.h"  // for TypeDecl, TypeDecl::Data, Declarati...
+#include "SynTree/Expression.h"   // for TypeExpr, Expression, ConstantExpr
+#include "SynTree/Mutator.h"      // for Mutator
+#include "SynTree/Type.h"         // for Type, TypeInstType, FunctionType
+#include "SynTree/Visitor.h"      // for Visitor
+#include "Tuples/Tuples.h"        // for isTtype
+#include "TypeEnvironment.h"      // for EqvClass, AssertionSet, OpenVarSet
 #include "Unify.h"
-#include "TypeEnvironment.h"
-#include "typeops.h"
-#include "FindOpenVars.h"
-#include "SynTree/Visitor.h"
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SymTab/Indexer.h"
-#include "Common/utility.h"
-#include "Tuples/Tuples.h"
+#include "typeops.h"              // for flatten, occurs, commonType
+
+namespace SymTab {
+class Indexer;
+}  // namespace SymTab
 
 // #define DEBUG
Index: src/ResolvExpr/Unify.h
===================================================================
--- src/ResolvExpr/Unify.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/ResolvExpr/Unify.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,12 +16,15 @@
 #pragma once
 
-#include <map>
-#include <list>
-#include "SynTree/SynTree.h"
-#include "SynTree/Type.h"
-#include "SynTree/Declaration.h"
-#include "SymTab/Indexer.h"
-#include "TypeEnvironment.h"
-#include "Common/utility.h"
+#include <list>                   // for list
+
+#include "Common/utility.h"       // for deleteAll
+#include "SynTree/Declaration.h"  // for TypeDecl, TypeDecl::Data
+#include "TypeEnvironment.h"      // for AssertionSet, OpenVarSet
+
+class Type;
+class TypeInstType;
+namespace SymTab {
+class Indexer;
+}  // namespace SymTab
 
 namespace ResolvExpr {
Index: src/SymTab/Autogen.cc
===================================================================
--- src/SymTab/Autogen.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SymTab/Autogen.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,4 +16,5 @@
 #include "Autogen.h"
 
+#include <cstddef>                 // for NULL
 #include <algorithm>               // for count_if
 #include <cassert>                 // for safe_dynamic_cast, assert, assertf
@@ -21,4 +22,5 @@
 #include <list>                    // for list, _List_iterator, list<>::iter...
 #include <set>                     // for set, _Rb_tree_const_iterator
+#include <utility>                 // for pair
 #include <vector>                  // for vector
 
Index: src/SymTab/Autogen.h
===================================================================
--- src/SymTab/Autogen.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SymTab/Autogen.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -17,18 +17,15 @@
 
 #include <cassert>                // for assert
-#include <iterator>               // for back_insert_iterator, back_inserter
-#include <list>                   // for list
-#include <string>                 // for string, operator==
+#include <string>                 // for string
 
 #include "Common/UniqueName.h"    // for UniqueName
 #include "InitTweak/InitTweak.h"  // for InitExpander
-#include "Parser/LinkageSpec.h"   // for C
 #include "SynTree/Constant.h"     // for Constant
-#include "SynTree/Declaration.h"  // for ObjectDecl, Declaration (ptr only)
-#include "SynTree/Expression.h"   // for UntypedExpr, NameExpr, VariableExpr
-#include "SynTree/Initializer.h"  // for SingleInit
-#include "SynTree/Label.h"        // for Label, noLabels
-#include "SynTree/Statement.h"    // for Statement (ptr only), CompoundStmt
+#include "SynTree/Declaration.h"  // for DeclarationWithType, ObjectDecl
+#include "SynTree/Expression.h"   // for NameExpr, ConstantExpr, UntypedExpr...
 #include "SynTree/Type.h"         // for Type, ArrayType, Type::Qualifiers
+
+class CompoundStmt;
+class Statement;
 
 namespace SymTab {
Index: src/SymTab/FixFunction.cc
===================================================================
--- src/SymTab/FixFunction.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SymTab/FixFunction.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -20,4 +20,5 @@
 #include "Common/utility.h"       // for maybeClone
 #include "SynTree/Declaration.h"  // for FunctionDecl, ObjectDecl, Declarati...
+#include "SynTree/Expression.h"   // for Expression
 #include "SynTree/Type.h"         // for ArrayType, PointerType, Type, Basic...
 
Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SymTab/Indexer.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 21:37:33 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Mar 30 16:38:47 2017
-// Update Count     : 19
+// Last Modified On : Thu Aug 17 16:08:40 2017
+// Update Count     : 20
 //
 
@@ -355,4 +355,24 @@
 	}
 
+	void Indexer::visit( IfStmt *ifStmt ) {
+	    // for statements introduce a level of scope
+	    enterScope();
+	    Visitor::visit( ifStmt );
+	    leaveScope();
+	}
+
+	void Indexer::visit( ForStmt *forStmt ) {
+	    // for statements introduce a level of scope
+	    enterScope();
+	    Visitor::visit( forStmt );
+	    leaveScope();
+	}
+
+	void Indexer::visit( CatchStmt *catchStmt ) {
+		// catch statements introduce a level of scope (for the caught exception)
+		enterScope();
+		Visitor::visit( catchStmt );
+		leaveScope();
+	}
 
 	void Indexer::visit( ApplicationExpr *applicationExpr ) {
@@ -558,13 +578,4 @@
 		leaveScope();
 	}
-
-	void Indexer::visit( ForStmt *forStmt ) {
-	    // for statements introduce a level of scope
-	    enterScope();
-	    Visitor::visit( forStmt );
-	    leaveScope();
-	}
-
-
 
 	void Indexer::lookupId( const std::string &id, std::list< DeclarationWithType* > &out ) const {
Index: src/SymTab/Indexer.h
===================================================================
--- src/SymTab/Indexer.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SymTab/Indexer.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 21:38:55 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 22 09:46:34 2017
-// Update Count     : 7
+// Last Modified On : Thu Aug 17 16:09:12 2017
+// Update Count     : 8
 //
 
@@ -45,4 +45,7 @@
 
 		virtual void visit( CompoundStmt *compoundStmt );
+		virtual void visit( IfStmt *ifStmt );
+		virtual void visit( ForStmt *forStmt );
+		virtual void visit( CatchStmt *catchStmt );
 
 		virtual void visit( ApplicationExpr *applicationExpr );
@@ -81,6 +84,4 @@
 		virtual void visit( StructInstType *contextInst );
 		virtual void visit( UnionInstType *contextInst );
-
-		virtual void visit( ForStmt *forStmt );
 
 		// when using an indexer manually (e.g., within a mutator traversal), it is necessary to tell the indexer
Index: src/SymTab/Mangler.cc
===================================================================
--- src/SymTab/Mangler.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SymTab/Mangler.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -20,7 +20,8 @@
 #include <iterator>                 // for ostream_iterator, back_insert_ite...
 #include <list>                     // for _List_iterator, list, _List_const...
-#include <string>                   // for string, operator<<, basic_string
+#include <string>                   // for string, char_traits, operator<<
 
 #include "CodeGen/OperatorTable.h"  // for OperatorInfo, operatorLookup
+#include "Common/SemanticError.h"   // for SemanticError
 #include "Common/utility.h"         // for toString
 #include "Parser/LinkageSpec.h"     // for Spec, isOverridable, AutoGen, Int...
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SymTab/Validate.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -40,40 +40,40 @@
 #include "Validate.h"
 
+#include <cassert>                     // for assertf, assert
 #include <cstddef>                     // for size_t
-#include <algorithm>                   // for move, transform
-#include <cassert>                     // for safe_dynamic_cast, assertf
-#include <iterator>                    // for back_inserter, inserter, back_...
-#include <list>                        // for list, _List_iterator, list<>::...
-#include <map>                         // for _Rb_tree_iterator, map, map<>:...
-#include <memory>                      // for unique_ptr, allocator
-#include <string>                      // for string, operator+, operator==
-#include <tuple>                       // for get
-#include <utility>                     // for pair, make_pair
-
-#include "AddVisit.h"                  // for addVisit
-#include "Autogen.h"                   // for SizeType, autogenerateRoutines
+#include <list>                        // for list
+#include <string>                      // for string
+#include <utility>                     // for pair
+
 #include "CodeGen/CodeGenerator.h"     // for genName
 #include "CodeGen/OperatorTable.h"     // for isCtorDtor, isCtorDtorAssign
 #include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
-#include "Common/ScopedMap.h"          // for ScopedMap<>::const_iterator
+#include "Common/ScopedMap.h"          // for ScopedMap
 #include "Common/SemanticError.h"      // for SemanticError
 #include "Common/UniqueName.h"         // for UniqueName
 #include "Common/utility.h"            // for operator+, cloneAll, deleteAll
-#include "Concurrency/Keywords.h"      // for applyKeywords, implementMutexF...
+#include "Concurrency/Keywords.h"      // for applyKeywords
 #include "FixFunction.h"               // for FixFunction
 #include "Indexer.h"                   // for Indexer
-#include "InitTweak/InitTweak.h"       // for isCtorDtor, isCtorDtorAssign
-#include "Parser/LinkageSpec.h"        // for C, Cforall
-#include "ResolvExpr/typeops.h"        // for extractResultType, typesCompat...
-#include "SynTree/Attribute.h"         // for Attribute
+#include "InitTweak/InitTweak.h"       // for isCtorDtorAssign
+#include "Parser/LinkageSpec.h"        // for C
+#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "SymTab/AddVisit.h"           // for addVisit
+#include "SymTab/Autogen.h"            // for SizeType
+#include "SynTree/Attribute.h"         // for noAttributes, Attribute
 #include "SynTree/Constant.h"          // for Constant
-#include "SynTree/Declaration.h"       // for EnumDecl, StructDecl, UnionDecl
-#include "SynTree/Expression.h"        // for TypeExpr, CompoundLiteralExpr
-#include "SynTree/Initializer.h"       // for ListInit, Initializer, noDesig...
-#include "SynTree/Mutator.h"           // for mutateAll, Mutator
-#include "SynTree/Statement.h"         // for CompoundStmt, DeclStmt, Return...
-#include "SynTree/Type.h"              // for Type, TypeInstType, TraitInstType
-#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution, applySubstit...
-#include "SynTree/Visitor.h"           // for acceptAll, Visitor
+#include "SynTree/Declaration.h"       // for ObjectDecl, DeclarationWithType
+#include "SynTree/Expression.h"        // for CompoundLiteralExpr, Expressio...
+#include "SynTree/Initializer.h"       // for ListInit, Initializer
+#include "SynTree/Label.h"             // for operator==, Label
+#include "SynTree/Mutator.h"           // for Mutator
+#include "SynTree/Type.h"              // for Type, TypeInstType, EnumInstType
+#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
+#include "SynTree/Visitor.h"           // for Visitor
+
+class CompoundStmt;
+class ReturnStmt;
+class SwitchStmt;
+
 
 #define debugPrint( x ) if ( doDebug ) { std::cout << x; }
Index: src/SynTree/AddStmtVisitor.cc
===================================================================
--- src/SynTree/AddStmtVisitor.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/AddStmtVisitor.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,8 +15,10 @@
 
 #include "AddStmtVisitor.h"
-#include "Statement.h"
-#include "Declaration.h"
-#include "Expression.h"
-#include "Common/utility.h"
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Declaration.h"           // for Declaration
+#include "Expression.h"            // for Expression
+#include "Statement.h"             // for CompoundStmt, ForStmt, IfStmt, Sta...
+#include "SynTree/Label.h"         // for Label, noLabels
 
 void AddStmtVisitor::visitStatementList( std::list< Statement* > &statements ) {
Index: src/SynTree/AddStmtVisitor.h
===================================================================
--- src/SynTree/AddStmtVisitor.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/AddStmtVisitor.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,8 +16,8 @@
 #pragma once
 
-#include <list>
+#include <list>               // for list
 
-#include "SynTree/SynTree.h"
-#include "SynTree/Visitor.h"
+#include "SynTree/SynTree.h"  // for Visitor Nodes
+#include "SynTree/Visitor.h"  // for Visitor
 
 class AddStmtVisitor : public Visitor {
Index: src/SynTree/AddressExpr.cc
===================================================================
--- src/SynTree/AddressExpr.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/AddressExpr.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,10 @@
 //
 
-#include "Expression.h"
-#include "Type.h"
-#include "Common/utility.h"
+#include <ostream>           // for ostream, operator<<, basic_ostream, endl
+#include <string>            // for operator<<, string
+
+#include "Common/utility.h"  // for maybeClone
+#include "Expression.h"      // for AddressExpr, Expression
+#include "Type.h"            // for PointerType, Type, Type::Qualifiers
 
 // Address expressions are typed based on the following inference rules:
Index: src/SynTree/AggregateDecl.cc
===================================================================
--- src/SynTree/AggregateDecl.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/AggregateDecl.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,8 +14,13 @@
 //
 
-#include "Declaration.h"
-#include "Attribute.h"
-#include "Type.h"
-#include "Common/utility.h"
+#include <list>                  // for list
+#include <ostream>               // for operator<<, basic_ostream, ostream
+#include <string>                // for operator<<, string, char_traits
+
+#include "Attribute.h"           // for Attribute
+#include "Common/utility.h"      // for printAll, cloneAll, deleteAll
+#include "Declaration.h"         // for AggregateDecl, TypeDecl, Declaration
+#include "Parser/LinkageSpec.h"  // for Spec, linkageName, Cforall
+#include "Type.h"                // for Type, Type::StorageClasses
 
 
Index: src/SynTree/ApplicationExpr.cc
===================================================================
--- src/SynTree/ApplicationExpr.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/ApplicationExpr.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,12 +14,17 @@
 //
 
-#include <cassert>
+#include <cassert>               // for safe_dynamic_cast, assert
+#include <list>                  // for list
+#include <map>                   // for _Rb_tree_const_iterator, map, map<>:...
+#include <memory>                // for unique_ptr
+#include <ostream>               // for operator<<, ostream, basic_ostream
+#include <string>                // for operator<<, string, char_traits
+#include <utility>               // for pair
 
-#include "Expression.h"
-#include "Declaration.h"
-#include "Type.h"
-#include "TypeSubstitution.h"
-#include "Common/utility.h"
-#include "ResolvExpr/typeops.h"
+#include "Common/utility.h"      // for maybeClone, cloneAll, deleteAll, pri...
+#include "Declaration.h"         // for Declaration
+#include "Expression.h"          // for ParamEntry, ApplicationExpr, Expression
+#include "ResolvExpr/typeops.h"  // for extractResultType
+#include "Type.h"                // for Type, PointerType, FunctionType
 
 ParamEntry::ParamEntry( const ParamEntry &other ) :
Index: src/SynTree/ArrayType.cc
===================================================================
--- src/SynTree/ArrayType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/ArrayType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,12 @@
 //
 
-#include "Type.h"
-#include "Expression.h"
-#include "Common/utility.h"
+#include <list>              // for list
+#include <ostream>           // for operator<<, ostream
+
+#include "Common/utility.h"  // for maybeClone
+#include "Expression.h"      // for Expression
+#include "Type.h"            // for ArrayType, Type, Type::Qualifiers
+
+class Attribute;
 
 
Index: src/SynTree/AttrType.cc
===================================================================
--- src/SynTree/AttrType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/AttrType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,13 @@
 //
 
-#include "Type.h"
-#include "Expression.h"
-#include "Common/utility.h"
+#include <list>              // for list
+#include <ostream>           // for operator<<, ostream, basic_ostream
+#include <string>            // for char_traits, operator<<, string
+
+#include "Common/utility.h"  // for maybeClone
+#include "Expression.h"      // for Expression
+#include "Type.h"            // for AttrType, Type, Type::Qualifiers
+
+class Attribute;
 
 
Index: src/SynTree/Attribute.cc
===================================================================
--- src/SynTree/Attribute.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Attribute.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,9 +14,9 @@
 //
 
-#include <cassert>
+#include <ostream>           // for operator<<, ostream, basic_ostream, endl
 
-#include "Common/utility.h"
 #include "Attribute.h"
-#include "Expression.h"
+#include "Common/utility.h"  // for cloneAll, deleteAll, printAll
+#include "Expression.h"      // for Expression
 
 Attribute::Attribute( const Attribute &other ) : name( other.name ) {
Index: src/SynTree/Attribute.h
===================================================================
--- src/SynTree/Attribute.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Attribute.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,5 +16,9 @@
 #pragma once
 
-#include "SynTree.h"
+#include <iosfwd>  // for ostream
+#include <list>    // for list
+#include <string>  // for string, operator==
+
+class Expression;
 
 // GCC attribute
Index: src/SynTree/BaseSyntaxNode.h
===================================================================
--- src/SynTree/BaseSyntaxNode.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/BaseSyntaxNode.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,13 +9,13 @@
 // Author           : Thierry Delisle
 // Created On       : Tue Feb 14 07:44:20 2017
-// Last Modified By :
-// Last Modified On :
-// Update Count     :
+// Last Modified By : Andrew Beach
+// Last Modified On : Thr Aug 17 13:44:00
+// Update Count     : 1
 //
 
 #pragma once
 
-#include "Common/utility.h"
-#include "Visitor.h"
+#include "Common/CodeLocation.h"
+class Visitor;
 
 class BaseSyntaxNode {
Index: src/SynTree/BasicType.cc
===================================================================
--- src/SynTree/BasicType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/BasicType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,6 +14,11 @@
 //
 
-#include <cassert>
-#include "Type.h"
+#include <cassert>  // for assert
+#include <list>     // for list
+#include <ostream>  // for operator<<, ostream
+
+#include "Type.h"   // for BasicType, Type, BasicType::Kind, BasicType::Kind...
+
+class Attribute;
 
 BasicType::BasicType( const Type::Qualifiers &tq, Kind bt, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), kind( bt ) {}
Index: src/SynTree/CommaExpr.cc
===================================================================
--- src/SynTree/CommaExpr.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/CommaExpr.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,10 @@
 //
 
-#include "Expression.h"
-#include "Type.h"
-#include "Common/utility.h"
+#include <ostream>           // for ostream, endl, operator<<, basic_ostream
+#include <string>            // for operator<<, string
+
+#include "Common/utility.h"  // for maybeClone
+#include "Expression.h"      // for CommaExpr, Expression
+#include "Type.h"            // for Type
 
 CommaExpr::CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname )
Index: src/SynTree/CompoundStmt.cc
===================================================================
--- src/SynTree/CompoundStmt.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/CompoundStmt.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,11 +14,14 @@
 //
 
-#include "Statement.h"
-#include "Common/utility.h"
-#include <algorithm>
-#include <functional>
-#include "Expression.h"
-#include "Declaration.h"
-#include "SynTree/VarExprReplacer.h"
+#include <cassert>                    // for assert, safe_dynamic_cast
+#include <list>                       // for list, _List_const_iterator, lis...
+#include <ostream>                    // for operator<<, ostream, basic_ostream
+#include <string>                     // for operator==, string
+
+#include "Common/utility.h"           // for cloneAll, deleteAll, printAll
+#include "Declaration.h"              // for DeclarationWithType, Declaration
+#include "Statement.h"                // for CompoundStmt, Statement, DeclStmt
+#include "SynTree/Label.h"            // for Label
+#include "SynTree/VarExprReplacer.h"  // for VarExprReplacer, VarExprReplace...
 
 using std::string;
Index: src/SynTree/Constant.cc
===================================================================
--- src/SynTree/Constant.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Constant.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,10 +14,10 @@
 //
 
-#include <iostream>
-#include <list>
-#include <string>
+#include <cassert>   // for safe_dynamic_cast, assertf
+#include <iostream>  // for operator<<, ostream, basic_ostream
+#include <string>    // for to_string, string, char_traits, operator<<
 
 #include "Constant.h"
-#include "Type.h"
+#include "Type.h"    // for BasicType, Type, Type::Qualifiers, PointerType
 
 Constant::Constant( Type * type, std::string rep, unsigned long long val ) : type( type ), rep( rep ), val( val ) {}
Index: src/SynTree/Constant.h
===================================================================
--- src/SynTree/Constant.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Constant.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,7 +16,11 @@
 #pragma once
 
-#include "SynTree.h"
-#include "Visitor.h"
-#include "Mutator.h"
+#include <iosfwd>     // for ostream
+#include <string>     // for string
+
+#include "Mutator.h"  // for Mutator
+#include "Visitor.h"  // for Visitor
+
+class Type;
 
 class Constant {
Index: src/SynTree/DeclStmt.cc
===================================================================
--- src/SynTree/DeclStmt.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/DeclStmt.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// DeclStmt.cc -- 
+// DeclStmt.cc --
 //
 // Author           : Richard C. Bilson
@@ -14,7 +14,12 @@
 //
 
-#include "Statement.h"
-#include "Declaration.h"
-#include "Common/utility.h"
+#include <cassert>           // for assert
+#include <list>              // for list
+#include <ostream>           // for operator<<, ostream
+
+#include "Common/utility.h"  // for maybeClone
+#include "Declaration.h"     // for Declaration
+#include "Statement.h"       // for DeclStmt, Statement
+#include "SynTree/Label.h"   // for Label
 
 DeclStmt::DeclStmt( std::list<Label> labels, Declaration *decl ) : Statement( labels ), decl( decl ) {
Index: src/SynTree/Declaration.cc
===================================================================
--- src/SynTree/Declaration.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Declaration.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,12 +14,15 @@
 //
 
-#include <string>
-#include <map>
+#include <map>                       // for _Rb_tree_const_iterator, map<>::...
+#include <ostream>                   // for ostream, operator<<, basic_ostre...
+#include <string>                    // for string
+#include <utility>                   // for pair
+
+#include "Common/utility.h"          // for maybeClone
 #include "Declaration.h"
-#include "Expression.h"
-#include "Initializer.h"
-#include "Type.h"
-#include "Attribute.h"
-#include "Common/utility.h"
+#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
+#include "SynTree/Statement.h"       // for AsmStmt
+#include "SynTree/SynTree.h"         // for UniqueId
+#include "Type.h"                    // for Type, Type::StorageClasses
 
 static UniqueId lastUniqueId = 0;
Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Declaration.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,12 +16,24 @@
 #pragma once
 
-#include <string>
-
-#include "BaseSyntaxNode.h"
-#include "Mutator.h"
-#include "Visitor.h"
-#include "SynTree.h"
-#include "Parser/LinkageSpec.h"
-#include "Parser/ParseNode.h"
+#include <cassert>               // for assertf
+#include <iosfwd>                // for ostream
+#include <list>                  // for list
+#include <string>                // for string, operator+, allocator, to_string
+
+#include "BaseSyntaxNode.h"      // for BaseSyntaxNode
+#include "Mutator.h"             // for Mutator
+#include "Parser/LinkageSpec.h"  // for Spec, Cforall
+#include "Parser/ParseNode.h"    // for DeclarationNode, DeclarationNode::Ag...
+#include "SynTree.h"             // for UniqueId
+#include "SynTree/Type.h"        // for Type, Type::StorageClasses, Type::Fu...
+#include "Visitor.h"             // for Visitor
+
+class AsmStmt;
+class Attribute;
+class CompoundStmt;
+class ConstantExpr;
+class Expression;
+class Initializer;
+class TypeDecl;
 
 class Declaration : public BaseSyntaxNode {
Index: src/SynTree/DeclarationWithType.cc
===================================================================
--- src/SynTree/DeclarationWithType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/DeclarationWithType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,8 +14,13 @@
 //
 
-#include "Declaration.h"
-#include "Type.h"
-#include "Attribute.h"
-#include "Common/utility.h"
+#include <list>                  // for list
+#include <string>                // for string
+
+#include "Attribute.h"           // for Attribute
+#include "Common/utility.h"      // for cloneAll, deleteAll, maybeClone
+#include "Declaration.h"         // for DeclarationWithType, Declaration
+#include "Parser/LinkageSpec.h"  // for Spec
+#include "SynTree/Expression.h"  // for ConstantExpr
+#include "Type.h"                // for Type, Type::FuncSpecifiers, Type::St...
 
 DeclarationWithType::DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs )
Index: src/SynTree/Expression.cc
===================================================================
--- src/SynTree/Expression.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Expression.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,23 +14,20 @@
 //
 
-#include <iostream>
-#include <cassert>
-#include <list>
-#include <algorithm>
-
-#include <iterator>
-
-#include "Declaration.h"
-#include "Expression.h"
-#include "Initializer.h"
-#include "Statement.h"
-#include "Type.h"
-#include "TypeSubstitution.h"
-#include "VarExprReplacer.h"
-
-#include "Common/utility.h"
-#include "Common/PassVisitor.h"
-
-#include "InitTweak/InitTweak.h"
+#include "SynTree/Expression.h"
+
+#include <cassert>                   // for assert, assertf
+#include <iostream>                  // for ostream, operator<<, basic_ostream
+#include <list>                      // for list, _List_iterator, list<>::co...
+
+#include "Common/utility.h"          // for maybeClone, cloneAll, deleteAll
+#include "Declaration.h"             // for ObjectDecl, DeclarationWithType
+#include "Expression.h"              // for Expression, ImplicitCopyCtorExpr
+#include "InitTweak/InitTweak.h"     // for getCallArg, getPointerBase
+#include "Initializer.h"             // for Designation, Initializer
+#include "Statement.h"               // for CompoundStmt, ExprStmt, Statement
+#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
+#include "SynTree/Constant.h"        // for Constant
+#include "Type.h"                    // for Type, BasicType, Type::Qualifiers
+#include "TypeSubstitution.h"        // for TypeSubstitution
 
 #include "GenPoly/Lvalue.h"
Index: src/SynTree/Expression.h
===================================================================
--- src/SynTree/Expression.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Expression.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -13,16 +13,19 @@
 // Update Count     : 44
 //
-
 #pragma once
 
-#include <map>
-#include <memory>
-
-#include "BaseSyntaxNode.h"
-#include "Constant.h"
-#include "Mutator.h"
-#include "SynTree.h"
-#include "Visitor.h"
-#include "Common/UniqueName.h"
+#include <iosfwd>                 // for ostream
+#include <list>                   // for list, list<>::iterator
+#include <map>                    // for map, map<>::value_compare
+#include <memory>                 // for allocator, unique_ptr
+#include <string>                 // for string
+
+#include "BaseSyntaxNode.h"       // for BaseSyntaxNode
+#include "Constant.h"             // for Constant
+#include "Initializer.h"          // for Designation (ptr only), Initializer
+#include "Mutator.h"              // for Mutator
+#include "SynTree.h"              // for UniqueId
+#include "Visitor.h"              // for Visitor
+
 
 /// Expression is the root type for all expressions
@@ -57,4 +60,5 @@
 
 struct ParamEntry;
+
 typedef std::map< UniqueId, ParamEntry > InferredParams;
 
Index: src/SynTree/FunctionDecl.cc
===================================================================
--- src/SynTree/FunctionDecl.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/FunctionDecl.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,13 +14,16 @@
 //
 
-#include <cassert>
+#include <cassert>               // for assert
+#include <list>                  // for list
+#include <ostream>               // for operator<<, ostream, basic_ostream
+#include <string>                // for operator<<, string, char_traits, ope...
 
-#include "Declaration.h"
-#include "Statement.h"
-#include "Type.h"
-#include "Attribute.h"
-#include "Common/utility.h"
-#include "InitTweak/InitTweak.h"
-#include "CodeGen/FixMain.h"
+#include "Attribute.h"           // for Attribute
+#include "CodeGen/FixMain.h"     // for FixMain
+#include "Common/utility.h"      // for maybeClone, printAll
+#include "Declaration.h"         // for FunctionDecl, FunctionDecl::Parent
+#include "Parser/LinkageSpec.h"  // for Spec, linkageName, Cforall
+#include "Statement.h"           // for CompoundStmt
+#include "Type.h"                // for Type, FunctionType, Type::FuncSpecif...
 
 extern bool translation_unit_nomain;
Index: src/SynTree/FunctionType.cc
===================================================================
--- src/SynTree/FunctionType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/FunctionType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,10 +14,14 @@
 //
 
-#include <algorithm>
+#include <list>              // for list
+#include <ostream>           // for operator<<, basic_ostream, ostream, endl
+#include <string>            // for operator<<, char_traits, string
 
-#include "Type.h"
-#include "Declaration.h"
-#include "Common/utility.h"
-#include "Tuples/Tuples.h"
+#include "Common/utility.h"  // for cloneAll, deleteAll, printAll
+#include "Declaration.h"     // for DeclarationWithType
+#include "Tuples/Tuples.h"   // for isTtype
+#include "Type.h"            // for FunctionType, Type, Type::Qualifiers
+
+class Attribute;
 
 FunctionType::FunctionType( const Type::Qualifiers &tq, bool isVarArgs, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), isVarArgs( isVarArgs ) {
Index: src/SynTree/Initializer.cc
===================================================================
--- src/SynTree/Initializer.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Initializer.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,13 +9,19 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Thr Aug  3 11:33:00 2016
-// Update Count     : 29
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Aug 21 09:53:15 2017
+// Update Count     : 30
 //
 
 #include "Initializer.h"
-#include "Expression.h"
-#include "Statement.h"
-#include "Common/utility.h"
+
+#include <cassert>                   // for assertf
+#include <ostream>                   // for ostream, operator<<, basic_ostream
+#include <string>                    // for operator<<, string, char_traits
+
+#include "Common/utility.h"          // for maybeClone, cloneAll, deleteAll
+#include "Expression.h"              // for Expression
+#include "Statement.h"               // for Statement
+#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
 
 Designation::Designation( const std::list< Expression * > & designators ) : designators( designators ) {}
@@ -74,5 +80,5 @@
 			}
 		}
-		assertf( initializers.size() == designations.size(), "Created ListInit with mismatching initializers (%lu) and designations (%lu)", initializers.size(), designations.size() );
+		assertf( initializers.size() == designations.size(), "Created ListInit with mismatching initializers (%zd) and designations (%zd)", initializers.size(), designations.size() );
 }
 
Index: src/SynTree/Initializer.h
===================================================================
--- src/SynTree/Initializer.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Initializer.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,11 +16,13 @@
 #pragma once
 
-#include <cassert>
+#include <iosfwd>            // for ostream
+#include <list>              // for list, list<>::const_iterator, list<>::it...
 
-#include "BaseSyntaxNode.h"
-#include "Mutator.h"
-#include "SynTree.h"
-#include "Type.h"
-#include "Visitor.h"
+#include "BaseSyntaxNode.h"  // for BaseSyntaxNode
+#include "Mutator.h"         // for Mutator
+#include "Visitor.h"         // for Visitor
+
+class Expression;
+class Statement;
 
 // Designation: list of designator (NameExpr, VariableExpr, and ConstantExpr) expressions that specify an object being initialized.
Index: src/SynTree/Mutator.cc
===================================================================
--- src/SynTree/Mutator.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Mutator.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,19 +9,22 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Mon Jul 24 16:32:00 2017
-// Update Count     : 25
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug 17 15:39:37 2017
+// Update Count     : 27
 //
 
-#include <cassert>
+#include <cassert>             // for assert
+#include <list>                // for list
+
+#include "Declaration.h"       // for ObjectDecl, Declaration, DeclarationWi...
+#include "Expression.h"        // for Expression, ConstantExpr, ConditionalExpr
+#include "Initializer.h"       // for ConstructorInit, Initializer, Designation
 #include "Mutator.h"
-#include "Initializer.h"
-#include "Statement.h"
-#include "Type.h"
-#include "Declaration.h"
-#include "Expression.h"
-#include "Constant.h"
-#include "Common/utility.h"
-#include "TypeSubstitution.h"
+#include "Statement.h"         // for Statement, CatchStmt, AsmStmt, ForStmt
+#include "Type.h"              // for Type, Type::ForallList, AttrType, Arra...
+#include "TypeSubstitution.h"  // for TypeSubstitution
+
+class Constant;
+class Subrange;
 
 Mutator::Mutator() {}
@@ -111,4 +114,5 @@
 
 Statement *Mutator::mutate( IfStmt *ifStmt ) {
+	mutateAll( ifStmt->get_initialization(), *this );
 	ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) );
 	ifStmt->set_thenPart( maybeMutate( ifStmt->get_thenPart(), *this ) );
Index: src/SynTree/Mutator.h
===================================================================
--- src/SynTree/Mutator.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Mutator.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -13,10 +13,10 @@
 // Update Count     : 16
 //
-#include <cassert>
+#pragma once
 
-#include "SynTree.h"
-#include "Common/SemanticError.h"
+#include <cassert>                 // for assert
 
-#pragma once
+#include "Common/SemanticError.h"  // for SemanticError
+#include "SynTree/SynTree.h"       // for AST nodes
 
 class Mutator {
Index: src/SynTree/NamedTypeDecl.cc
===================================================================
--- src/SynTree/NamedTypeDecl.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/NamedTypeDecl.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,12 @@
 //
 
-#include "Declaration.h"
-#include "Type.h"
-#include "Common/utility.h"
+#include <list>                  // for list
+#include <ostream>               // for operator<<, ostream, basic_ostream
+#include <string>                // for operator<<, string, char_traits, ope...
+
+#include "Common/utility.h"      // for printAll, cloneAll, deleteAll, maybe...
+#include "Declaration.h"         // for NamedTypeDecl, DeclarationWithType
+#include "Parser/LinkageSpec.h"  // for Spec, Cforall, linkageName
+#include "Type.h"                // for Type, Type::StorageClasses
 
 NamedTypeDecl::NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *base )
Index: src/SynTree/ObjectDecl.cc
===================================================================
--- src/SynTree/ObjectDecl.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/ObjectDecl.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,11 +14,15 @@
 //
 
-#include "Declaration.h"
-#include "Type.h"
-#include "Initializer.h"
-#include "Expression.h"
-#include "Attribute.h"
-#include "Common/utility.h"
-#include "Statement.h"
+#include <list>                  // for list
+#include <ostream>               // for operator<<, ostream, basic_ostream
+#include <string>                // for operator<<, string, char_traits, ope...
+
+#include "Attribute.h"           // for Attribute
+#include "Common/utility.h"      // for maybeClone, printAll
+#include "Declaration.h"         // for ObjectDecl, ObjectDecl::Parent
+#include "Expression.h"          // for Expression
+#include "Initializer.h"         // for Initializer
+#include "Parser/LinkageSpec.h"  // for Spec, linkageName, Cforall
+#include "Type.h"                // for Type, Type::StorageClasses, Type::Fu...
 
 ObjectDecl::ObjectDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, Type::FuncSpecifiers fs )
Index: src/SynTree/PointerType.cc
===================================================================
--- src/SynTree/PointerType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/PointerType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,12 @@
 //
 
-#include "Type.h"
-#include "Expression.h"
-#include "Common/utility.h"
+#include <list>              // for list
+#include <ostream>           // for operator<<, ostream
+
+#include "Common/utility.h"  // for maybeClone
+#include "Expression.h"      // for Expression
+#include "Type.h"            // for PointerType, Type, Type::Qualifiers
+
+class Attribute;
 
 PointerType::PointerType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes )
Index: src/SynTree/ReferenceToType.cc
===================================================================
--- src/SynTree/ReferenceToType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/ReferenceToType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,12 +14,16 @@
 //
 
-#include <string>
-#include <cassert>
+#include <stddef.h>          // for NULL
+#include <cassert>           // for assert
+#include <list>              // for list, _List_const_iterator, list<>::cons...
+#include <ostream>           // for operator<<, basic_ostream, ostream, endl
+#include <string>            // for string, operator<<, char_traits, operator==
 
-#include "Type.h"
-#include "Declaration.h"
-#include "Expression.h"
-#include "TypeSubstitution.h"
-#include "Common/utility.h"
+#include "Common/utility.h"  // for printAll, cloneAll, deleteAll
+#include "Declaration.h"     // for StructDecl, UnionDecl, EnumDecl, Declara...
+#include "Expression.h"      // for Expression
+#include "Type.h"            // for TypeInstType, StructInstType, UnionInstType
+
+class Attribute;
 
 ReferenceToType::ReferenceToType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), name( name ), hoistType( false ) {
Index: src/SynTree/Statement.cc
===================================================================
--- src/SynTree/Statement.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Statement.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,24 +9,28 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Mon Jun 12 10:37:00 2017
-// Update Count     : 64
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug 17 16:17:20 2017
+// Update Count     : 67
 //
 
-#include <functional>
-#include <algorithm>
-#include <iostream>
-#include <list>
-#include <cassert>
-
-#include "Statement.h"
-#include "Expression.h"
-#include "Declaration.h"
-#include "Common/SemanticError.h"
+#include "SynTree/Statement.h"
+
+#include <stddef.h>                // for NULL
+#include <cassert>                 // for assert, assertf
+#include <iostream>                // for operator<<, basic_ostream, endl
+#include <list>                    // for list, list<>::const_iterator, _Lis...
+#include <string>                  // for operator<<, string, char_traits
+
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/utility.h"        // for maybeClone, cloneAll, deleteAll
+#include "Declaration.h"           // for Declaration
+#include "Expression.h"            // for Expression, ConstantExpr
+#include "Statement.h"             // for Statement, ForStmt, AsmStmt, Catch...
+#include "SynTree/Label.h"         // for Label, operator<<
 
 using std::string;
 using std::endl;
 
-Statement::Statement( std::list<Label> _labels ) : labels( _labels ) {}
+Statement::Statement( std::list<Label> labels ) : labels( labels ) {}
 
 void Statement::print( __attribute__((unused)) std::ostream &, __attribute__((unused)) int indent ) const {}
@@ -34,5 +38,5 @@
 Statement::~Statement() {}
 
-ExprStmt::ExprStmt( std::list<Label> _labels, Expression *_expr ) : Statement( _labels ), expr( _expr ) {}
+ExprStmt::ExprStmt( std::list<Label> labels, Expression *expr ) : Statement( labels ), expr( expr ) {}
 
 ExprStmt::ExprStmt( const ExprStmt &other ) : Statement( other ), expr( maybeClone( other.expr ) ) {}
@@ -84,6 +88,6 @@
 const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" };
 
-BranchStmt::BranchStmt( std::list<Label> labels, Label _target, Type _type ) throw ( SemanticError ) :
-	Statement( labels ), originalTarget( _target ), target( _target ), computedTarget( NULL ), type( _type ) {
+BranchStmt::BranchStmt( std::list<Label> labels, Label target, Type type ) throw ( SemanticError ) :
+	Statement( labels ), originalTarget( target ), target( target ), computedTarget( NULL ), type( type ) {
 	//actually this is a syntactic error signaled by the parser
 	if ( type == BranchStmt::Goto && target.empty() )
@@ -91,6 +95,6 @@
 }
 
-BranchStmt::BranchStmt( std::list<Label> labels, Expression *_computedTarget, Type _type ) throw ( SemanticError ) :
-	Statement( labels ), computedTarget( _computedTarget ), type( _type ) {
+BranchStmt::BranchStmt( std::list<Label> labels, Expression *computedTarget, Type type ) throw ( SemanticError ) :
+	Statement( labels ), computedTarget( computedTarget ), type( type ) {
 	if ( type != BranchStmt::Goto || computedTarget == 0 )
 		throw SemanticError("Computed target not valid in branch statement");
@@ -101,5 +105,5 @@
 }
 
-ReturnStmt::ReturnStmt( std::list<Label> labels, Expression *_expr ) : Statement( labels ), expr( _expr ) {}
+ReturnStmt::ReturnStmt( std::list<Label> labels, Expression *expr ) : Statement( labels ), expr( expr ) {}
 
 ReturnStmt::ReturnStmt( const ReturnStmt & other ) : Statement( other ), expr( maybeClone( other.expr ) ) {}
@@ -118,11 +122,14 @@
 }
 
-IfStmt::IfStmt( std::list<Label> _labels, Expression *_condition, Statement *_thenPart, Statement *_elsePart ):
-	Statement( _labels ), condition( _condition ), thenPart( _thenPart ), elsePart( _elsePart ) {}
+IfStmt::IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart, std::list<Statement *> initialization ):
+	Statement( labels ), condition( condition ), thenPart( thenPart ), elsePart( elsePart ), initialization( initialization ) {}
 
 IfStmt::IfStmt( const IfStmt & other ) :
-	Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) {}
+	Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) {
+	cloneAll( other.initialization, initialization );
+}
 
 IfStmt::~IfStmt() {
+	deleteAll( initialization );
 	delete condition;
 	delete thenPart;
@@ -135,4 +142,13 @@
 	condition->print( os, indent + 4 );
 
+	if ( !initialization.empty() ) {
+		os << string( indent + 2, ' ' ) << "initialization: \n";
+		for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) {
+			os << string( indent + 4, ' ' );
+			(*it)->print( os, indent + 4 );
+		}
+		os << endl;
+	}
+
 	os << string( indent+2, ' ' ) << "... then: " << endl;
 
@@ -147,6 +163,6 @@
 }
 
-SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_statements ):
-	Statement( _labels ), condition( _condition ), statements( _statements ) {
+SwitchStmt::SwitchStmt( std::list<Label> labels, Expression * condition, std::list<Statement *> &statements ):
+	Statement( labels ), condition( condition ), statements( statements ) {
 }
 
@@ -175,6 +191,6 @@
 }
 
-CaseStmt::CaseStmt( std::list<Label> _labels, Expression *_condition, std::list<Statement *> &_statements, bool deflt ) throw ( SemanticError ) :
-	Statement( _labels ), condition( _condition ), stmts( _statements ), _isDefault( deflt ) {
+CaseStmt::CaseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :
+	Statement( labels ), condition( condition ), stmts( statements ), _isDefault( deflt ) {
 	if ( isDefault() && condition != 0 )
 		throw SemanticError("default with conditions");
@@ -212,6 +228,6 @@
 }
 
-WhileStmt::WhileStmt( std::list<Label> labels, Expression *condition_, Statement *body_, bool isDoWhile_ ):
-	Statement( labels ), condition( condition_), body( body_), isDoWhile( isDoWhile_) {
+WhileStmt::WhileStmt( std::list<Label> labels, Expression *condition, Statement *body, bool isDoWhile ):
+	Statement( labels ), condition( condition), body( body), isDoWhile( isDoWhile) {
 }
 
@@ -234,6 +250,6 @@
 }
 
-ForStmt::ForStmt( std::list<Label> labels, std::list<Statement *> initialization_, Expression *condition_, Expression *increment_, Statement *body_ ):
-	Statement( labels ), initialization( initialization_ ), condition( condition_ ), increment( increment_ ), body( body_ ) {
+ForStmt::ForStmt( std::list<Label> labels, std::list<Statement *> initialization, Expression *condition, Expression *increment, Statement *body ):
+	Statement( labels ), initialization( initialization ), condition( condition ), increment( increment ), body( body ) {
 }
 
@@ -313,6 +329,6 @@
 }
 
-TryStmt::TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &_handlers, FinallyStmt *_finallyBlock ) :
-	Statement( labels ), block( tryBlock ),  handlers( _handlers ), finallyBlock( _finallyBlock ) {
+TryStmt::TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock ) :
+	Statement( labels ), block( tryBlock ),  handlers( handlers ), finallyBlock( finallyBlock ) {
 }
 
@@ -329,21 +345,24 @@
 void TryStmt::print( std::ostream &os, int indent ) const {
 	os << "Try Statement" << endl;
-	os << string( indent + 2, ' ' ) << "with block: " << endl;
+	os << string( indent + 2, ' ' ) << "with block:" << endl;
+	os << string( indent + 4, ' ' );
 	block->print( os, indent + 4 );
 
 	// handlers
-	os << string( indent + 2, ' ' ) << "and handlers: " << endl;
-	for ( std::list<CatchStmt *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
+	os << string( indent + 2, ' ' ) << "and handlers:" << endl;
+	for ( std::list<CatchStmt *>::const_iterator i = handlers.begin(); i != handlers.end(); i++) {
+		os << string( indent + 4, ' ' );
 		(*i )->print( os, indent + 4 );
+	}
 
 	// finally block
 	if ( finallyBlock != 0 ) {
-		os << string( indent + 2, ' ' ) << "Finally block: " << endl;
+		os << string( indent + 2, ' ' ) << "and finally:" << endl;
 		finallyBlock->print( os, indent + 4 );
 	} // if
 }
 
-CatchStmt::CatchStmt( std::list<Label> labels, Kind _kind, Declaration *_decl, Expression *_cond, Statement *_body ) :
-	Statement( labels ), kind ( _kind ), decl ( _decl ), cond ( _cond ), body( _body ) {
+CatchStmt::CatchStmt( std::list<Label> labels, Kind kind, Declaration *decl, Expression *cond, Statement *body ) :
+	Statement( labels ), kind ( kind ), decl ( decl ), cond ( cond ), body( body ) {
 }
 
@@ -360,5 +379,5 @@
 	os << "Catch " << ((Terminate == kind) ? "Terminate" : "Resume") << " Statement" << endl;
 
-	os << string( indent, ' ' ) << "... catching" << endl;
+	os << string( indent + 2, ' ' ) << "... catching: ";
 	if ( decl ) {
 		decl->printShort( os, indent + 4 );
@@ -367,8 +386,20 @@
 	else
 		os << string( indent + 4 , ' ' ) << ">>> Error:  this catch clause must have a declaration <<<" << endl;
-}
-
-
-FinallyStmt::FinallyStmt( std::list<Label> labels, CompoundStmt *_block ) : Statement( labels ), block( _block ) {
+
+	if ( cond ) {
+		os << string( indent + 2, ' ' ) << "with conditional:" << endl;
+		os << string( indent + 4, ' ' );
+		cond->print( os, indent + 4 );
+	}
+	else
+		os << string( indent + 2, ' ' ) << "with no conditional" << endl;
+
+	os << string( indent + 2, ' ' ) << "with block:" << endl;
+	os << string( indent + 4, ' ' );
+	body->print( os, indent + 4 );
+}
+
+
+FinallyStmt::FinallyStmt( std::list<Label> labels, CompoundStmt *block ) : Statement( labels ), block( block ) {
 	assert( labels.empty() ); // finally statement cannot be labeled
 }
@@ -383,5 +414,6 @@
 void FinallyStmt::print( std::ostream &os, int indent ) const {
 	os << "Finally Statement" << endl;
-	os << string( indent + 2, ' ' ) << "with block: " << endl;
+	os << string( indent + 2, ' ' ) << "with block:" << endl;
+	os << string( indent + 4, ' ' );
 	block->print( os, indent + 4 );
 }
Index: src/SynTree/Statement.h
===================================================================
--- src/SynTree/Statement.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Statement.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,18 +9,26 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Thr Aug  3 14:08:00 2017
-// Update Count     : 69
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug 17 15:37:53 2017
+// Update Count     : 72
 //
 
 #pragma once
 
-#include "BaseSyntaxNode.h"
-#include "Label.h"
-#include "Mutator.h"
-#include "SynTree.h"
-#include "Type.h"
-#include "Visitor.h"
-#include "Common/SemanticError.h"
+#include <iosfwd>                  // for ostream
+#include <list>                    // for list
+#include <memory>                  // for allocator
+
+#include "BaseSyntaxNode.h"        // for BaseSyntaxNode
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Label.h"                 // for Label
+#include "Mutator.h"               // for Mutator
+#include "Visitor.h"               // for Visitor
+
+class CatchStmt;
+class ConstantExpr;
+class Declaration;
+class Expression;
+class FinallyStmt;
 
 class Statement : public BaseSyntaxNode {
@@ -122,9 +130,12 @@
 	Statement *thenPart;
 	Statement *elsePart;
-
-	IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart );
+	std::list<Statement *> initialization;
+
+	IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart,
+			std::list<Statement *> initialization = std::list<Statement *>() );
 	IfStmt( const IfStmt &other );
 	virtual ~IfStmt();
 
+	std::list<Statement *> &get_initialization() { return initialization; }
 	Expression *get_condition() { return condition; }
 	void set_condition( Expression *newValue ) { condition = newValue; }
@@ -228,5 +239,4 @@
 
 	std::list<Statement *> &get_initialization() { return initialization; }
-	void set_initialization( std::list<Statement *> newValue ) { initialization = newValue; }
 	Expression *get_condition() { return condition; }
 	void set_condition( Expression *newValue ) { condition = newValue; }
Index: src/SynTree/TupleExpr.cc
===================================================================
--- src/SynTree/TupleExpr.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/TupleExpr.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,10 +14,17 @@
 //
 
-#include "Expression.h"
-#include "Common/utility.h"
-#include "Type.h"
-#include "Declaration.h"
-#include "Tuples/Tuples.h"
-#include "VarExprReplacer.h"
+#include <cassert>              // for assert, safe_dynamic_cast, assertf
+#include <iterator>             // for next
+#include <list>                 // for list, _List_iterator
+#include <ostream>              // for ostream, operator<<, basic_ostream, endl
+#include <string>               // for operator<<, string, char_traits
+
+#include "Common/utility.h"     // for cloneAll, deleteAll, printAll, toString
+#include "Declaration.h"        // for ObjectDecl
+#include "Expression.h"         // for Expression, TupleExpr, TupleIndexExpr
+#include "SynTree/Label.h"      // for Label, noLabels
+#include "SynTree/Statement.h"  // for CompoundStmt, DeclStmt, ExprStmt, Sta...
+#include "Tuples/Tuples.h"      // for makeTupleType
+#include "Type.h"               // for TupleType, Type
 
 UntypedTupleExpr::UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname ) : Expression( _aname ), exprs( exprs ) {
Index: src/SynTree/TupleType.cc
===================================================================
--- src/SynTree/TupleType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/TupleType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,9 +14,14 @@
 //
 
-#include "Declaration.h"
-#include "Initializer.h"
-#include "Type.h"
-#include "Common/utility.h"
-#include "Parser/LinkageSpec.h"
+#include <list>                  // for list
+#include <ostream>               // for operator<<, ostream, basic_ostream
+
+#include "Common/utility.h"      // for cloneAll, deleteAll, printAll
+#include "Declaration.h"         // for Declaration, ObjectDecl
+#include "Initializer.h"         // for ListInit
+#include "Parser/LinkageSpec.h"  // for Cforall
+#include "Type.h"                // for TupleType, Type, Type::Qualifiers
+
+class Attribute;
 
 TupleType::TupleType( const Type::Qualifiers &tq, const std::list< Type * > & types, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), types( types ) {
Index: src/SynTree/Type.cc
===================================================================
--- src/SynTree/Type.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Type.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -13,12 +13,11 @@
 // Update Count     : 29
 //
+#include "Type.h"
 
-#include "SynTree.h"
-#include "Visitor.h"
-#include "Type.h"
-#include "Declaration.h"
-#include "Attribute.h"
-#include "InitTweak/InitTweak.h"
-#include "Common/utility.h"
+#include "Attribute.h"               // for Attribute
+#include "Common/utility.h"          // for cloneAll, deleteAll, printAll
+#include "InitTweak/InitTweak.h"     // for getPointerBase
+#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
+#include "SynTree/Declaration.h"     // for TypeDecl
 
 using namespace std;
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Type.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,9 +16,15 @@
 #pragma once
 
-#include "BaseSyntaxNode.h"
-#include "Mutator.h"
-#include "SynTree.h"
-#include "Visitor.h"
-#include <strings.h>									// ffs
+#include <strings.h>         // for ffs
+#include <cassert>           // for assert, assertf
+#include <list>              // for list, _List_iterator
+#include <ostream>           // for ostream, operator<<, basic_ostream
+#include <string>            // for string
+
+#include "BaseSyntaxNode.h"  // for BaseSyntaxNode
+#include "Common/utility.h"  // for operator+
+#include "Mutator.h"         // for Mutator
+#include "SynTree.h"         // for AST nodes
+#include "Visitor.h"         // for Visitor
 
 class Type : public BaseSyntaxNode {
Index: src/SynTree/TypeDecl.cc
===================================================================
--- src/SynTree/TypeDecl.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/TypeDecl.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,10 @@
 //
 
-#include "Declaration.h"
-#include "Type.h"
-#include "Common/utility.h"
+#include <ostream>           // for ostream, operator<<, basic_ostream, basi...
+#include <string>            // for string, char_traits, operator+, operator<<
+
+#include "Common/utility.h"  // for maybeClone
+#include "Declaration.h"     // for TypeDecl, TypeDecl::Data, TypeDecl::Kind...
+#include "Type.h"            // for Type, Type::StorageClasses
 
 TypeDecl::TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init ) : Parent( name, scs, type ), init( init ), sized( kind == Any || kind == Ttype ), kind( kind ) {
Index: src/SynTree/TypeExpr.cc
===================================================================
--- src/SynTree/TypeExpr.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/TypeExpr.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,9 @@
 //
 
-#include "Expression.h"
-#include "Type.h"
-#include "Common/utility.h"
+#include <iosfwd>            // for ostream
+
+#include "Common/utility.h"  // for maybeClone
+#include "Expression.h"      // for TypeExpr, Expression
+#include "Type.h"            // for Type
 
 TypeExpr::TypeExpr( Type *type ) : type( type ) {
Index: src/SynTree/TypeSubstitution.cc
===================================================================
--- src/SynTree/TypeSubstitution.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/TypeSubstitution.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,5 +14,7 @@
 //
 
-#include "Type.h"
+#include <ostream>  // for ostream, basic_ostream, operator<<, endl
+
+#include "Type.h"   // for TypeInstType, Type, StructInstType, UnionInstType
 #include "TypeSubstitution.h"
 
Index: src/SynTree/TypeSubstitution.h
===================================================================
--- src/SynTree/TypeSubstitution.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/TypeSubstitution.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,11 +16,17 @@
 #pragma once
 
-#include <map>
-#include <set>
-#include <cassert>
+#include <cassert>                 // for assert
+#include <iosfwd>                  // for ostream
+#include <list>                    // for list<>::iterator, _List_iterator
+#include <map>                     // for _Rb_tree_iterator, map, map<>::val...
+#include <set>                     // for set
+#include <string>                  // for string, operator!=
+#include <utility>                 // for pair
 
-#include "SynTree/Mutator.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
+#include "Common/SemanticError.h"  // for SemanticError
+#include "SynTree/Declaration.h"   // for TypeDecl, Declaration (ptr only)
+#include "SynTree/Expression.h"    // for Expression (ptr only), NameExpr (p...
+#include "SynTree/Mutator.h"       // for Mutator
+#include "SynTree/Type.h"          // for Type, ArrayType (ptr only), BasicT...
 
 class TypeSubstitution : public Mutator {
Index: src/SynTree/TypeofType.cc
===================================================================
--- src/SynTree/TypeofType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/TypeofType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,7 +14,12 @@
 //
 
-#include "Type.h"
-#include "Expression.h"
-#include "Common/utility.h"
+#include <list>              // for list
+#include <ostream>           // for operator<<, ostream
+
+#include "Common/utility.h"  // for maybeClone
+#include "Expression.h"      // for Expression
+#include "Type.h"            // for TypeofType, Type, Type::Qualifiers
+
+class Attribute;
 
 TypeofType::TypeofType( const Type::Qualifiers &tq, Expression *expr, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), expr( expr ) {
Index: src/SynTree/VarArgsType.cc
===================================================================
--- src/SynTree/VarArgsType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/VarArgsType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,5 +14,10 @@
 //
 
-#include "Type.h"
+#include <list>     // for list
+#include <ostream>  // for operator<<, ostream
+
+#include "Type.h"   // for Type, VarArgsType, Type::Qualifiers
+
+class Attribute;
 
 VarArgsType::VarArgsType() : Type( Type::Qualifiers(), std::list< Attribute * >() ) {}
Index: src/SynTree/VarExprReplacer.cc
===================================================================
--- src/SynTree/VarExprReplacer.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/VarExprReplacer.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,6 +14,8 @@
 //
 
-#include "Declaration.h"
-#include "Expression.h"
+#include <iostream>       // for operator<<, basic_ostream, ostream, basic_o...
+
+#include "Declaration.h"  // for operator<<, DeclarationWithType
+#include "Expression.h"   // for VariableExpr
 #include "VarExprReplacer.h"
 
Index: src/SynTree/VarExprReplacer.h
===================================================================
--- src/SynTree/VarExprReplacer.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/VarExprReplacer.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,7 +16,10 @@
 #pragma once
 
-#include <map>
+#include <map>                // for map, map<>::value_compare
 
-#include "SynTree/SynTree.h"
+#include "SynTree/Visitor.h"  // for Visitor
+
+class DeclarationWithType;
+class VariableExpr;
 
 /// Visitor that replaces the declarations that VariableExprs refer to, according to the supplied mapping
Index: src/SynTree/Visitor.cc
===================================================================
--- src/SynTree/Visitor.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Visitor.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,17 +9,21 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Mon Jul 24 16:30:00 2017
-// Update Count     : 27
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug 17 15:39:38 2017
+// Update Count     : 29
 //
 
-#include <cassert>
+#include <cassert>        // for assert
+#include <list>           // for list
+
+#include "Constant.h"     // for Constant
+#include "Declaration.h"  // for DeclarationWithType, ObjectDecl, Declaration
+#include "Expression.h"   // for Expression, ConstantExpr, ImplicitCopyCtorExpr
+#include "Initializer.h"  // for Initializer, Designation, ConstructorInit
+#include "Statement.h"    // for Statement, CatchStmt, AsmStmt, CompoundStmt
+#include "Type.h"         // for Type, Type::ForallList, AttrType, FunctionType
 #include "Visitor.h"
-#include "Initializer.h"
-#include "Statement.h"
-#include "Type.h"
-#include "Declaration.h"
-#include "Expression.h"
-#include "Constant.h"
+
+class Subrange;
 
 Visitor::Visitor() {}
@@ -95,4 +99,5 @@
 
 void Visitor::visit( IfStmt *ifStmt ) {
+	acceptAll( ifStmt->get_initialization(), *this );
 	maybeAccept( ifStmt->get_condition(), *this );
 	maybeAccept( ifStmt->get_thenPart(), *this );
Index: src/SynTree/Visitor.h
===================================================================
--- src/SynTree/Visitor.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/Visitor.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,7 +16,6 @@
 #pragma once
 
-#include "SynTree.h"
-#include "Common/SemanticError.h"
-#include "Common/CompilerError.h"
+#include "Common/SemanticError.h"  // for SemanticError
+#include "SynTree.h"               // for AST nodes
 
 class Visitor {
Index: src/SynTree/VoidType.cc
===================================================================
--- src/SynTree/VoidType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/VoidType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,5 +14,10 @@
 //
 
-#include "Type.h"
+#include <list>     // for list
+#include <ostream>  // for operator<<, ostream
+
+#include "Type.h"   // for VoidType, Type, Type::Qualifiers
+
+class Attribute;
 
 VoidType::VoidType( const Type::Qualifiers &tq, const std::list< Attribute * > & attributes ) : Type( tq, attributes ) {
Index: src/SynTree/ZeroOneType.cc
===================================================================
--- src/SynTree/ZeroOneType.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/SynTree/ZeroOneType.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,5 +14,10 @@
 //
 
-#include "Type.h"
+#include <list>     // for list
+#include <ostream>  // for operator<<, ostream
+
+#include "Type.h"   // for Type, Type::Qualifiers, OneType, ZeroType
+
+class Attribute;
 
 ZeroType::ZeroType() : Type( Type::Qualifiers(), std::list< Attribute * >() ) {}
Index: src/Tuples/Explode.cc
===================================================================
--- src/Tuples/Explode.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Tuples/Explode.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,6 +15,8 @@
 
 #include "Explode.h"
-#include "SynTree/Mutator.h"
-#include "Common/PassVisitor.h"
+#include <list>                  // for list
+
+#include "SynTree/Mutator.h"     // for Mutator
+#include "Common/PassVisitor.h"  // for PassVisitor
 
 namespace Tuples {
Index: src/Tuples/Explode.h
===================================================================
--- src/Tuples/Explode.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Tuples/Explode.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,12 +16,14 @@
 #pragma once
 
-#include "ResolvExpr/AlternativeFinder.h"
-#include "ResolvExpr/Resolver.h"
+#include <iterator>                  // for back_inserter, back_insert_iterator
 
-#include "SynTree/Expression.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Type.h"
+#include "ResolvExpr/Alternative.h"  // for Alternative, AltList
+#include "SynTree/Expression.h"      // for Expression, UniqueExpr, AddressExpr
+#include "SynTree/Type.h"            // for TupleType, Type
+#include "Tuples.h"                  // for maybeImpure
 
-#include "Tuples.h"
+namespace SymTab {
+class Indexer;
+}  // namespace SymTab
 
 namespace Tuples {
Index: src/Tuples/TupleAssignment.cc
===================================================================
--- src/Tuples/TupleAssignment.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Tuples/TupleAssignment.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,23 +14,30 @@
 //
 
-#include "ResolvExpr/AlternativeFinder.h"
-#include "ResolvExpr/Alternative.h"
-#include "ResolvExpr/typeops.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Initializer.h"
-#include "Tuples.h"
-#include "Explode.h"
-#include "Common/SemanticError.h"
+#include <algorithm>                       // for transform
+#include <cassert>                         // for assert
+#include <iterator>                        // for back_insert_iterator, back...
+#include <list>                            // for _List_const_iterator, _Lis...
+#include <memory>                          // for unique_ptr, allocator_trai...
+#include <string>                          // for string
+
 #include "CodeGen/OperatorTable.h"
-#include "InitTweak/InitTweak.h"
-#include "InitTweak/GenInit.h"
-
-#include <functional>
-#include <algorithm>
-#include <iterator>
-#include <iostream>
-#include <cassert>
-#include <set>
-#include <unordered_set>
+#include "Common/UniqueName.h"             // for UniqueName
+#include "Common/utility.h"                // for zipWith
+#include "Explode.h"                       // for explode
+#include "InitTweak/GenInit.h"             // for genCtorInit
+#include "InitTweak/InitTweak.h"           // for getPointerBase, isAssignment
+#include "Parser/LinkageSpec.h"            // for Cforall
+#include "ResolvExpr/Alternative.h"        // for AltList, Alternative
+#include "ResolvExpr/AlternativeFinder.h"  // for AlternativeFinder, simpleC...
+#include "ResolvExpr/Cost.h"               // for Cost
+#include "ResolvExpr/Resolver.h"           // for resolveCtorInit
+#include "ResolvExpr/TypeEnvironment.h"    // for TypeEnvironment
+#include "SynTree/Declaration.h"           // for ObjectDecl
+#include "SynTree/Expression.h"            // for Expression, CastExpr, Name...
+#include "SynTree/Initializer.h"           // for ConstructorInit, SingleInit
+#include "SynTree/Statement.h"             // for ExprStmt
+#include "SynTree/Type.h"                  // for Type, Type::Qualifiers
+#include "SynTree/TypeSubstitution.h"      // for TypeSubstitution
+#include "SynTree/Visitor.h"               // for Visitor
 
 namespace Tuples {
Index: src/Tuples/TupleExpansion.cc
===================================================================
--- src/Tuples/TupleExpansion.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Tuples/TupleExpansion.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -14,21 +14,24 @@
 //
 
-#include <iterator>
-#include <iostream>
-#include <cassert>
-#include "Tuples.h"
-#include "Common/PassVisitor.h"
-#include "Common/ScopedMap.h"
-#include "GenPoly/DeclMutator.h"
-#include "InitTweak/GenInit.h"
-#include "InitTweak/InitTweak.h"
-#include "ResolvExpr/typeops.h"
-#include "SymTab/Mangler.h"
-#include "SynTree/Declaration.h"
-#include "SynTree/Expression.h"
-#include "SynTree/Initializer.h"
-#include "SynTree/Mutator.h"
-#include "SynTree/Statement.h"
-#include "SynTree/Type.h"
+#include <stddef.h>               // for size_t
+#include <cassert>                // for assert
+#include <list>                   // for list
+
+#include "Common/PassVisitor.h"   // for PassVisitor, WithDeclsToAdd, WithGu...
+#include "Common/ScopedMap.h"     // for ScopedMap
+#include "Common/utility.h"       // for CodeLocation
+#include "GenPoly/DeclMutator.h"  // for DeclMutator
+#include "InitTweak/InitTweak.h"  // for getFunction
+#include "Parser/LinkageSpec.h"   // for Spec, C, Intrinsic
+#include "SynTree/Constant.h"     // for Constant
+#include "SynTree/Declaration.h"  // for StructDecl, DeclarationWithType
+#include "SynTree/Expression.h"   // for UntypedMemberExpr, Expression, Uniq...
+#include "SynTree/Label.h"        // for operator==, Label
+#include "SynTree/Mutator.h"      // for Mutator
+#include "SynTree/Type.h"         // for Type, Type::Qualifiers, TupleType
+#include "SynTree/Visitor.h"      // for Visitor
+
+class CompoundStmt;
+class TypeSubstitution;
 
 namespace Tuples {
Index: src/Virtual/ExpandCasts.cc
===================================================================
--- src/Virtual/ExpandCasts.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Virtual/ExpandCasts.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,5 +15,18 @@
 
 #include "ExpandCasts.h"
-#include "Common/PassVisitor.h"
+
+#include <cassert>                 // for assert, assertf
+#include <iterator>                // for back_inserter, inserter
+#include <map>                     // for map, _Rb_tree_iterator, map<>::ite...
+#include <string>                  // for string, allocator, operator==, ope...
+#include <utility>                 // for pair
+
+#include "Common/PassVisitor.h"    // for PassVisitor
+#include "Common/SemanticError.h"  // for SemanticError
+#include "SynTree/Declaration.h"   // for ObjectDecl, StructDecl, FunctionDecl
+#include "SynTree/Expression.h"    // for VirtualCastExpr, CastExpr, Address...
+#include "SynTree/Mutator.h"       // for mutateAll
+#include "SynTree/Type.h"          // for Type, PointerType, StructInstType
+#include "SynTree/Visitor.h"       // for acceptAll
 
 namespace Virtual {
Index: src/Virtual/ExpandCasts.h
===================================================================
--- src/Virtual/ExpandCasts.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/Virtual/ExpandCasts.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,6 +16,7 @@
 #pragma once
 
-#include <list>
-#include "SynTree/SynTree.h"
+#include <list>  // for list
+
+class Declaration;
 
 namespace Virtual {
Index: src/driver/cfa.cc
===================================================================
--- src/driver/cfa.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/driver/cfa.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -9,7 +9,7 @@
 // Author           : Peter A. Buhr
 // Created On       : Tue Aug 20 13:44:49 2002
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jan 20 14:38:45 2017
-// Update Count     : 155
+// Last Modified By : Andrew Beach
+// Last Modified On : Thr Aug 17 15:24:00 2017
+// Update Count     : 156
 //
 
@@ -281,4 +281,8 @@
 #endif //HAVE_LIBCFA
 
+	// Add exception flags (unconditionally)
+	args[nargs] = "-fexceptions";
+	nargs += 1;
+
 	// add the correct set of flags based on the type of compile this is
 
Index: src/libcfa/Makefile.am
===================================================================
--- src/libcfa/Makefile.am	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/libcfa/Makefile.am	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -36,5 +36,5 @@
 	 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -O0 -c -o $@ $<
 
-EXTRA_FLAGS = -g -Wall -Werror -Wno-unused-function -I${abs_top_srcdir}/src/libcfa/libhdr -imacros libcfa-prelude.c @CFA_FLAGS@
+EXTRA_FLAGS = -g -Wall -Werror -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@
 
 AM_CCASFLAGS = @CFA_FLAGS@
Index: src/libcfa/Makefile.in
===================================================================
--- src/libcfa/Makefile.in	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/libcfa/Makefile.in	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -416,5 +416,5 @@
 ARFLAGS = cr
 lib_LIBRARIES = $(am__append_1) $(am__append_2)
-EXTRA_FLAGS = -g -Wall -Werror -Wno-unused-function -I${abs_top_srcdir}/src/libcfa/libhdr -imacros libcfa-prelude.c @CFA_FLAGS@
+EXTRA_FLAGS = -g -Wall -Werror -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@
 AM_CCASFLAGS = @CFA_FLAGS@
 headers = fstream iostream iterator limits rational stdlib \
Index: src/libcfa/exception.c
===================================================================
--- src/libcfa/exception.c	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/libcfa/exception.c	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,6 +10,6 @@
 // Created On       : Mon Jun 26 15:13:00 2017
 // Last Modified By : Andrew Beach
-// Last Modified On : Fri Aug  4 15:20:00 2017
-// Update Count     : 6
+// Last Modified On : Thr Aug 17 15:45:00 2017
+// Update Count     : 7
 //
 
@@ -23,4 +23,5 @@
 #include <stdio.h>
 #include <unwind.h>
+#include <libhdr/libdebug.h>
 
 // FIX ME: temporary hack to keep ARM build working
@@ -79,6 +80,5 @@
 void __cfaehm__throw_resume(exception * except) {
 
-	// DEBUG
-	printf("Throwing resumption exception\n");
+	LIB_DEBUG_PRINT_SAFE("Throwing resumption exception\n");
 
 	struct __cfaehm__try_resume_node * original_head = shared_stack.current_resume;
@@ -94,5 +94,5 @@
 	}
 
-	printf("Unhandled exception\n");
+	LIB_DEBUG_PRINT_SAFE("Unhandled exception\n");
 	shared_stack.current_resume = original_head;
 
@@ -106,5 +106,5 @@
 
 void __cfaehm__try_resume_setup(struct __cfaehm__try_resume_node * node,
-                        int (*handler)(exception * except)) {
+                        _Bool (*handler)(exception * except)) {
 	node->next = shared_stack.top_resume;
 	node->handler = handler;
@@ -154,6 +154,5 @@
 	struct exception_context_t * context = this_exception_context();
 
-	// DEBUG
-	printf( "Deleting Exception\n");
+	LIB_DEBUG_PRINT_SAFE("Deleting Exception\n");
 
 	// Remove the exception from the list.
@@ -235,6 +234,5 @@
 
 void __cfaehm__throw_terminate( exception * val ) {
-	// DEBUG
-	printf("Throwing termination exception\n");
+	LIB_DEBUG_PRINT_SAFE("Throwing termination exception\n");
 
 	__cfaehm__allocate_exception( val );
@@ -243,6 +241,5 @@
 
 void __cfaehm__rethrow_terminate(void) {
-	// DEBUG
-	printf("Rethrowing termination exception\n");
+	LIB_DEBUG_PRINT_SAFE("Rethrowing termination exception\n");
 
 	__cfaehm__begin_unwind();
@@ -257,18 +254,15 @@
 {
 
-	// DEBUG
-	//printf("CFA: 0x%lx\n", _Unwind_GetCFA(context));
-	printf("Personality function (%d, %x, %llu, %p, %p):", version, actions, exceptionClass, unwind_exception, context);
+	//LIB_DEBUG_PRINT_SAFE("CFA: 0x%lx\n", _Unwind_GetCFA(context));
+	LIB_DEBUG_PRINT_SAFE("Personality function (%d, %x, %llu, %p, %p):", version, actions, exceptionClass, unwind_exception, context);
 
 	// If we've reached the end of the stack then there is nothing much we can do...
 	if( actions & _UA_END_OF_STACK ) return _URC_END_OF_STACK;
 
-	// DEBUG
 	if (actions & _UA_SEARCH_PHASE) {
-		printf(" lookup phase");
-	}
-	// DEBUG
+		LIB_DEBUG_PRINT_SAFE(" lookup phase");
+	}
 	else if (actions & _UA_CLEANUP_PHASE) {
-		printf(" cleanup phase");
+		LIB_DEBUG_PRINT_SAFE(" cleanup phase");
 	}
 	// Just in case, probably can't actually happen
@@ -306,5 +300,5 @@
 		// Have we reach the correct frame info yet?
 		if( lsd_info.Start + callsite_start + callsite_len < instruction_ptr ) {
-			//DEBUG BEGIN
+#ifdef __CFA_DEBUG_PRINT__
 			void * ls = (void*)lsd_info.Start;
 			void * cs = (void*)callsite_start;
@@ -313,6 +307,6 @@
 			void * ep = (void*)lsd_info.Start + callsite_start + callsite_len;
 			void * ip = (void*)instruction_ptr;
-			printf("\nfound %p - %p (%p, %p, %p), looking for %p\n", bp, ep, ls, cs, cl, ip);
-			//DEBUG END
+			LIB_DEBUG_PRINT_SAFE("\nfound %p - %p (%p, %p, %p), looking for %p\n", bp, ep, ls, cs, cl, ip);
+#endif // __CFA_DEBUG_PRINT__
 			continue;
 		}
@@ -362,11 +356,14 @@
 
 					// Based on the return value, check if we matched the exception
-					if( ret == _URC_HANDLER_FOUND) printf(" handler found\n");
-					else printf(" no handler\n");
+					if( ret == _URC_HANDLER_FOUND) {
+						LIB_DEBUG_PRINT_SAFE(" handler found\n");
+					} else {
+						LIB_DEBUG_PRINT_SAFE(" no handler\n");
+					}
 					return ret;
 				}
 
 				// This is only a cleanup handler, ignore it
-				printf(" no action");
+				LIB_DEBUG_PRINT_SAFE(" no action");
 			}
 			else if (actions & _UA_CLEANUP_PHASE) {
@@ -388,6 +385,5 @@
 				_Unwind_SetIP( context, ((lsd_info.LPStart) + (callsite_landing_pad)) );
 
-				// DEBUG
-				printf(" action\n");
+				LIB_DEBUG_PRINT_SAFE(" action\n");
 
 				// Return have some action to run
@@ -397,12 +393,11 @@
 
 		// Nothing to do, move along
-		printf(" no landing pad");
+		LIB_DEBUG_PRINT_SAFE(" no landing pad");
 	}
 	// No handling found
-	printf(" table end reached\n");
-
-	// DEBUG
+	LIB_DEBUG_PRINT_SAFE(" table end reached\n");
+
 	UNWIND:
-	printf(" unwind\n");
+	LIB_DEBUG_PRINT_SAFE(" unwind\n");
 
 	// Keep unwinding the stack
Index: src/libcfa/exception.h
===================================================================
--- src/libcfa/exception.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/libcfa/exception.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,6 +10,6 @@
 // Created On       : Mon Jun 26 15:11:00 2017
 // Last Modified By : Andrew Beach
-// Last Modified On : Fri Aug  4 15:20:00 2017
-// Update Count     : 5
+// Last Modified On : Thr Aug 17 15:44:00 2017
+// Update Count     : 6
 //
 
@@ -55,5 +55,5 @@
 struct __cfaehm__try_resume_node {
     struct __cfaehm__try_resume_node * next;
-    int (*handler)(exception * except);
+    _Bool (*handler)(exception * except);
 };
 
@@ -61,5 +61,5 @@
 void __cfaehm__try_resume_setup(
     struct __cfaehm__try_resume_node * node,
-    int (*handler)(exception * except));
+    _Bool (*handler)(exception * except));
 void __cfaehm__try_resume_cleanup(
     struct __cfaehm__try_resume_node * node);
Index: src/libcfa/libhdr.h
===================================================================
--- src/libcfa/libhdr.h	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/libcfa/libhdr.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -16,7 +16,7 @@
 #pragma once
 
-#include "libalign.h"
-#include "libdebug.h"
-#include "libtools.h"
+#include "libhdr/libalign.h"
+#include "libhdr/libdebug.h"
+#include "libhdr/libtools.h"
 
 // Local Variables: //
Index: src/main.cc
===================================================================
--- src/main.cc	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/main.cc	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,9 +15,9 @@
 //
 
-#include <cassert>                          // for assertf
 #include <cxxabi.h>                         // for __cxa_demangle
 #include <execinfo.h>                       // for backtrace, backtrace_symbols
 #include <getopt.h>                         // for no_argument, optind, geto...
 #include <signal.h>                         // for signal, SIGABRT, SIGSEGV
+#include <cassert>                          // for assertf
 #include <cstdio>                           // for fopen, FILE, fclose, stdin
 #include <cstdlib>                          // for exit, free, abort, EXIT_F...
@@ -27,5 +27,5 @@
 #include <iterator>                         // for back_inserter
 #include <list>                             // for list
-#include <string>                           // for operator<<, allocator
+#include <string>                           // for char_traits, operator<<
 
 #include "../config.h"                      // for CFA_LIBDIR
Index: src/tests/.expect/32/KRfunctions.txt
===================================================================
--- src/tests/.expect/32/KRfunctions.txt	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/tests/.expect/32/KRfunctions.txt	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -15,5 +15,5 @@
 }
 struct S {
-    int __i__i_1;
+int __i__i_1;
 };
 static inline void ___constructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1);
@@ -79,4 +79,7 @@
     __attribute__ ((unused)) int (*___retval_f14__PA0A0i_1)[][((unsigned int )10)];
 }
+int __f15__Fi_iii__1(int __a__i_1, int __b__i_1, int __c__i_1){
+    __attribute__ ((unused)) int ___retval_f15__i_1;
+}
 const int __fred__FCi___1(){
     __attribute__ ((unused)) const int ___retval_fred__Ci_1;
Index: src/tests/.expect/64/KRfunctions.txt
===================================================================
--- src/tests/.expect/64/KRfunctions.txt	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/tests/.expect/64/KRfunctions.txt	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -79,4 +79,7 @@
     __attribute__ ((unused)) int (*___retval_f14__PA0A0i_1)[][((long unsigned int )10)];
 }
+int __f15__Fi_iii__1(int __a__i_1, int __b__i_1, int __c__i_1){
+    __attribute__ ((unused)) int ___retval_f15__i_1;
+}
 const int __fred__FCi___1(){
     __attribute__ ((unused)) const int ___retval_fred__Ci_1;
Index: src/tests/KRfunctions.c
===================================================================
--- src/tests/KRfunctions.c	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/tests/KRfunctions.c	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -10,6 +10,6 @@
 // Created On       : Thu Feb 16 15:23:17 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 24 22:05:00 2017
-// Update Count     : 3
+// Last Modified On : Sun Aug 20 07:34:17 2017
+// Update Count     : 7
 // 
 
@@ -37,4 +37,5 @@
 int ((* f13( a, b, c ))[])[10] int a, * b, c[]; {}
 int (((* f14( a, b, c ))[])[10]) int a, * b, c[]; {}
+f15( a, b, c ) {}
 
 const fred() {
Index: src/tests/except-0.c
===================================================================
--- src/tests/except-0.c	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/tests/except-0.c	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -1,3 +1,5 @@
 // Draft of tests for exception handling.
+// Outdated: The integer constant exceptions need to be replaced with virtual
+// exceptions for the new system.
 
 // ERROR: exceptions do not interact with ^?{} properly.
@@ -5,4 +7,10 @@
 #include <stdio.h>
 #include <stdbool.h>
+
+#include "except-mac.h"
+TRIVIAL_EXCEPTION(yin)
+TRIVIAL_EXCEPTION(yang)
+TRIVIAL_EXCEPTION(zen)
+
 
 // Local type to mark exits from scopes. (see ERROR)
@@ -21,34 +29,16 @@
 
 
-// Local Exception Types and manual vtable types.
-//#define TRIVIAL_EXCEPTION(name) //TRIVAL_EXCEPTION(yin)
-struct yin;
-struct yin_vtable {
-	struct exception_t_vtable const * parent;
-	size_t size;
-    void (*copy)(yin *this, yin * other);
-    void (*free)(yin *this);
-    const char (*msg)(yin *this);
-};
-struct yin {
-	struct yin_vtable const * parent;
-};
-void yin_msg(yin) {
-	return "in";
-}
-yin_vtable _yin_vtable_instance = {
-	&_exception_t_vtable_instance, sizeof(yin), ?{}, ^?{}, yin_msg
-}
-
-
-void terminate(exception * except_value) {
+// Mark throws: make sure to only pass in exception types.
+forall(dtype T)
+void terminate(T * except_value) {
 	signal_exit a = {"terminate function"};
-	throw except_value;
+	THROW(except_value);
 	printf("terminate returned\n");
 }
 
-void resume(exception * except_value) {
+forall(dtype T)
+void resume(T * except_value) {
 	signal_exit a = {"resume function"};
-	throwResume except_value;
+	THROW_RESUME(except_value);
 	printf("resume returned\n");
 }
@@ -58,7 +48,7 @@
 	signal_exit a = {"bar function"};
 	try {
-		terminate(4);
-	} catch (3) {
-		printf("bar caught exception 3.\n");
+		terminate(&(zen){});
+	} catch (yin * error) {
+		printf("bar caught exception yin.\n");
 	}
 }
@@ -68,8 +58,8 @@
 	try {
 		bar();
-	} catch (4) {
-		printf("foo caught exception 4.\n");
-	} catch (2) {
-		printf("foo caught exception 2.\n");
+	} catch (yang * error) {
+		printf("foo caught exception yang.\n");
+	} catch (zen * error) {
+		printf("foo caught exception zen.\n");
 	}
 }
@@ -79,7 +69,8 @@
 	signal_exit a = {"beta function"};
 	try {
-		resume(4);
-	} catchResume (3) {
-		printf("beta caught exception 3\n");
+		zen x;
+		resume(&x);
+	} catchResume (yin * error) {
+		printf("beta caught exception yin\n");
 	}
 }
@@ -89,8 +80,8 @@
 	try {
 		beta();
-	} catchResume (2) {
-		printf("alpha caught exception 2\n");
-	} catchResume (4) {
-		printf("alpha caught exception 4\n");
+	} catchResume (yang * error) {
+		printf("alpha caught exception yang\n");
+	} catchResume (zen * error) {
+		printf("alpha caught exception zen\n");
 	}
 }
@@ -115,7 +106,8 @@
 void fallback() {
 	try {
-		resume(2);
-	} catch (2) {
-		printf("fallback caught termination 2\n");
+		zen x;
+		resume(&x);
+	} catch (zen * error) {
+		printf("fallback caught termination zen\n");
 	}
 }
@@ -125,7 +117,9 @@
 	signal_exit a = {"terminate_swap"};
 	try {
-		terminate(2);
-	} catch (2) {
-		terminate(3);
+		yin x;
+		terminate(&x);
+	} catch (yin * error) {
+		yang y;
+		terminate(&y);
 	}
 }
@@ -135,6 +129,6 @@
 	try {
 		terminate_swap();
-	} catch (3) {
-		printf("terminate_swapped caught exception 3\n");
+	} catch (yang * error) {
+		printf("terminate_swapped caught exception yang\n");
 	}
 }
@@ -144,7 +138,9 @@
 	signal_exit a = {"resume_swap"};
 	try {
-		resume(2);
-	} catchResume (2) {
-		resume(3);
+		yin x;
+		resume(&x);
+	} catchResume (yin * error) {
+		yang y;
+		resume(&y);
 	}
 }
@@ -153,6 +149,6 @@
 	try {
 		resume_swap();
-	} catchResume (3) {
-		printf("resume_swapped caught exception 3\n");
+	} catchResume (yang * error) {
+		printf("resume_swapped caught exception yang\n");
 	}
 }
@@ -162,12 +158,13 @@
 	try {
 		try {
-			terminate(2);
-		} catch (2) {
-			printf("reterminate 2 caught and "
-			       "will rethrow exception 2\n");
+			zen x;
+			terminate(&x);
+		} catch (zen * error) {
+			printf("reterminate zen caught and "
+			       "will rethrow exception zen\n");
 			throw;
 		}
-	} catch (2) {
-		printf("reterminate 1 caught exception 2\n");
+	} catch (zen * error) {
+		printf("reterminate 1 caught exception zen\n");
 	}
 }
@@ -177,11 +174,12 @@
 	try {
 		try {
-			resume(2);
-		} catchResume (2) {
-			printf("reresume 2 caught and rethrows exception 2\n");
+			zen x;
+			resume(&x);
+		} catchResume (zen * error) {
+			printf("reresume zen caught and rethrows exception zen\n");
 			throwResume;
 		}
-	} catchResume (2) {
-		printf("reresume 1 caught exception 2\n");
+	} catchResume (zen * error) {
+		printf("reresume 1 caught exception zen\n");
 	}
 }
@@ -191,7 +189,8 @@
 	// terminate block, call resume
 	try {
-		resume(3);
-	} catch (3) {
-		printf("fum caught exception 3\n");
+		zen x;
+		resume(&x);
+	} catch (zen * error) {
+		printf("fum caught exception zen\n");
 	}
 }
@@ -200,7 +199,8 @@
 	// resume block, call terminate
 	try {
-		terminate(3);
-	} catchResume (3) {
-		printf("foe caught exception 3\n");
+		zen y;
+		terminate(&y);
+	} catchResume (zen * error) {
+		printf("foe caught exception zen\n");
 	}
 }
@@ -210,6 +210,6 @@
 	try {
 		foe();
-	} catch (3) {
-		printf("fy caught exception 3\n");
+	} catch (zen * error) {
+		printf("fy caught exception zen\n");
 		fum();
 	}
@@ -220,6 +220,6 @@
 	try {
 		fy();
-	} catchResume (3) {
-		printf("fee caught exception 3\n");
+	} catchResume (zen * error) {
+		printf("fee caught exception zen\n");
 	}
 }
@@ -240,5 +240,8 @@
 	reresume(); printf("\n");
 	fee(); printf("\n");
+
 	// Uncaught termination test.
-	terminate(7);
-}
+	printf("Throw uncaught.\n");
+	yang z;
+	terminate(&z);
+}
Index: src/tests/except-1.c
===================================================================
--- src/tests/except-1.c	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/tests/except-1.c	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -1,17 +1,25 @@
 // Draft memory management test. (remember -fexceptions)
+// Outdated: The integer constant exceptions need to be replaced with virtual
+// exceptions for the new system.
 
 #include <stdio.h>
+
+#include "except-mac.h"
+TRIVIAL_EXCEPTION(yin)
+TRIVIAL_EXCEPTION(yang)
 
 int main()
 {
 	try {
-		throw 3;
+		yin a;
+		THROW(&a);
 	}
-	catch( 3 ) {
+	catch( yin * err ) {
 		printf("First Caught\n");
 		try {
-			throw 4;
+			yang b;
+			THROW(&b);
 		}
-		catch( 4 ) {
+		catch( yang * err ) {
 			printf("Both Caught\n");
 		}
@@ -21,12 +29,13 @@
 	try {
 		try {
-			throw 2;
+			yang c;
+			THROW(&c);
 		}
-		catch( 2 ) {
+		catch( yang * err ) {
 			printf("First Catch and rethrow\n");
 			throw;
 		}
 	}
-	catch( 2 ) {
+	catch( yang * err ) {
 		printf("Second Catch\n");
 	}
@@ -35,12 +44,14 @@
 	try {
 		try {
-			throw 5;
+			yin d;
+			THROW(&d);
 		}
-		catch( 5 ) {
+		catch( yin * err ) {
 			printf("Throw before cleanup\n");
-			throw 6;
+			yang e;
+			THROW(&e);
 		}
 	}
-	catch( 6 ) {
+	catch( yang * err ) {
 		printf("Catch after cleanup\n");
 	}
@@ -49,12 +60,14 @@
 	try {
 		try {
-			throw 7;
+			yin f;
+			THROW(&f);
 		}
-		catch( 7 ) {
+		catch( yin * err ) {
 			printf("Caught initial throw.\n");
 			try {
-				throw 8;
+				yang g;
+				THROW(&g);
 			}
-			catch( 8 ) {
+			catch( yang * err ) {
 				printf("Caught intermediate throw.\n");
 			}
@@ -62,5 +75,5 @@
 		}
 	}
-	catch( 7 ) {
+	catch( yin * err ) {
 		printf("Caught final throw.\n");
 	}
Index: src/tests/except-2.c
===================================================================
--- src/tests/except-2.c	(revision fc56cdbf036d8e5a6b7f729bba6c22479005dd12)
+++ src/tests/except-2.c	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -2,37 +2,7 @@
 
 
-#include <string.h>
+#include <stdlib>
+#include "except-mac.h"
 
-// Local Exception Types and manual vtable types.
-#define BASE_EXCEPT __cfaehm__base_exception_t
-#define TABLE(name) name##_vtable
-#define INSTANCE(name) _##name##_vtable_instance
-#define TRIVIAL_EXCEPTION(name) \
-struct name; \
-struct TABLE(name) { \
-	struct __cfaehm__base_exception_t_vtable const * parent; \
-	size_t size; \
-	void (*copy)(name *this, name * other); \
-	void (*free)(name *this); \
-	const char * (*msg)(name *this); \
-}; \
-extern TABLE(name) INSTANCE(name); \
-struct name { \
-	struct TABLE(name) const * virtual_table; \
-}; \
-const char * name##_msg(name * this) { \
-	return #name; \
-} \
-void name##_copy(name * this, name * other) { \
-	this->virtual_table = other->virtual_table; \
-} \
-TABLE(name) INSTANCE(name) @= { \
-	.parent : &INSTANCE(__cfaehm__base_exception_t), \
-	.size : sizeof(name), .copy : name##_copy, \
-	.free : ^?{}, .msg : name##_msg \
-}; \
-void ?{}(name * this) { \
-	this->virtual_table = &INSTANCE(name); \
-}
 TRIVIAL_EXCEPTION(yin)
 TRIVIAL_EXCEPTION(yang)
@@ -40,5 +10,5 @@
 struct num_error;
 struct num_error_vtable {
-	struct exception_t_vtable const * parent;
+	struct TABLE(BASE_EXCEPT) const * parent;
 	size_t size;
 	void (*copy)(num_error *this, num_error * other);
@@ -48,4 +18,5 @@
 };
 extern num_error_vtable INSTANCE(num_error);
+
 struct num_error {
 	struct num_error_vtable const * virtual_table;
@@ -53,8 +24,10 @@
 	int num;
 };
+
 void num_error_msg(num_error * this) {
 	if ( ! this->msg ) {
-		const char * base = "Num Error with code: X";
-		this->msg = strdup( base );
+		static const char * base = "Num Error with code: X";
+		this->msg = malloc(22);
+		for (int i = 0 ; (this->msg[i] = base[i]) ; ++i);
 	}
 	this->msg[21] = '0' + this->num;
@@ -62,5 +35,5 @@
 }
 void ?{}(num_error * this, int num) {
-	this->virtual_table = &_num_error_vtable_instance;
+	this->virtual_table = &INSTANCE(num_error);
 	this->msg = 0;
 	this->num = num;
@@ -78,5 +51,5 @@
 }
 num_error_vtable _num_error_vtable_instance @= {
-	&___cfaehm__base_exception_t_vtable_instance,
+	&INSTANCE(BASE_EXCEPT),
 	sizeof(num_error), ?{}, ^?{},
 	num_error_msg, num_error_code
@@ -88,6 +61,6 @@
 	try {
 		yin black;
-		throw (BASE_EXCEPT *)&black;
-	} catch( yin * error ) {
+		THROW(&black);
+	} catch ( yin * error ) {
 		printf("throw yin caught.\n");
 	}
@@ -95,22 +68,21 @@
 	try {
 		yang white;
-		throwResume (BASE_EXCEPT *)&white;
+		THROW_RESUME(&white);
 		printf("> throwResume returned.\n");
-	} catchResume( yang * error ) {
+	} catchResume ( yang * error ) {
 		printf("throwResume yang caught <");
 	}
 
-	/* Conditional catches are still a work in progress.
 	try {
 		num_error x = { 2 };
-		throw (struct exception_t *)&x;
+		THROW(&x);
 	}
-	catch (num_error * error0 ; 3 == error0->virtual_table->code( error0 ) ) {
-		printf("exception at %p\n", error0 );
+	catch (num_error * error ; 3 == error->virtual_table->code( error ) ) {
+		printf("exception at %p\n", error );
 		printf("Should not be printed.\n");
 	}
-	catch (num_error * error1 ; 2 == error1->virtual_table->code( error1 ) ) {
+	catch (num_error * error ; 2 == error->virtual_table->code( error ) ) {
 		printf("Should be printed.\n");
-	}*/
+	}
 }
 
Index: src/tests/except-3.c
===================================================================
--- src/tests/except-3.c	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
+++ src/tests/except-3.c	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -0,0 +1,18 @@
+// Test that __attribute__((cleanup(...))) is working.
+
+#include <stdio.h>
+#include "except-mac.h"
+TRIVIAL_EXCEPTION(myth)
+
+int main (int argc, char * argv[]) {
+	try {
+		try {
+			printf("throw [");
+			THROW(&(myth){});
+		} finally {
+			printf("] unwind <");
+		}
+	} catch (myth * error) {
+		printf("> catch\n");
+	}
+}
Index: src/tests/except-mac.h
===================================================================
--- src/tests/except-mac.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
+++ src/tests/except-mac.h	(revision 8135d4c79504a6c3047246007261186efa5ba4c9)
@@ -0,0 +1,78 @@
+// Macros to try and make declaring and using exceptions easier
+// No, these are not part of the language, they replace the virtual system.
+
+// Internal use:
+#define GLUE2(left, right) left##right
+#define GLUE3(left, middle, right) left##middle##right
+
+// The fully (perhaps overly) qualified name of the base exception type:
+#define BASE_EXCEPT __cfaehm__base_exception_t
+
+// Get the name of the vtable type and vtable instance for an exception type:
+#define TABLE(name) GLUE2(name,_vtable)
+#define INSTANCE(name) GLUE3(_,name,_vtable_instance)
+
+// Throws and the bit of overhead:
+#define THROW(expr) throw ((BASE_EXCEPT *)(expr))
+#define THROW_RESUME(expr) throwResume ((BASE_EXCEPT *)(expr))
+
+
+
+// The following macros are for defining your own new exception types.
+
+// Declare vtable and forward declare the exception type and vtable instance.
+// This should start a new exception declaration.
+// ... argument is the additional vtable fields.
+#define DECLARE_EXCEPT(except_name,parent_name,...) \
+struct except_name; \
+struct TABLE(except_name) { \
+	struct TABLE(parent_name) const * parent; \
+	size_t size; \
+	void (*copy)(except_name *this, except_name * other); \
+	void (*free)(except_name *this); \
+	const char * (*msg)(except_name *this); \
+	__VA_ARGS__ \
+}; \
+extern TABLE(except_name) INSTANCE(except_name);
+
+// The first field of the exception structure should be created with this.
+#define VTABLE_FIELD(except_name) \
+struct TABLE(except_name) const * virtual_table
+
+// In each constructor the vtable must be initialized.
+#define VTABLE_INIT(this_name,except_name) \
+this_name->virtual_table = &INSTANCE(except_name)
+
+// Declare the vtable instance. This should end an exception declaration.
+// ... argument is the remaining vtable field values.
+#define VTABLE_INSTANCE(except_name,parent_name,copy,free,msg,...) \
+TABLE(except_name) INSTANCE(except_name) @= { \
+	&INSTANCE(parent_name), sizeof(except_name), \
+	copy, free, msg, ## __VA_ARGS__ \
+};
+
+// Same, but used declarators for arguments.
+#define VTABLE_INSTANCE_KEY(except_name,parent_name,copy,free,msg,...) \
+TABLE(except_name) INSTANCE(except_name) @= { \
+	.parent : &INSTANCE(parent_name), .size : sizeof(except_name), \
+	.copy : copy, .free : free, .msg : msg, ## __VA_ARGS__ \
+};
+
+
+
+// Declare a trivial exception, one that adds no features:
+#define TRIVIAL_EXCEPTION(name) \
+DECLARE_EXCEPT(name,BASE_EXCEPT,) \
+struct name { \
+	VTABLE_FIELD(name); \
+}; \
+const char * GLUE2(name,_msg)(name * this) { \
+    return #name; \
+} \
+void GLUE2(name,_copy)(name * this, name * other) { \
+    this->virtual_table = other->virtual_table; \
+} \
+void ?{}(name * this) { \
+	VTABLE_INIT(this,name); \
+} \
+VTABLE_INSTANCE(name,BASE_EXCEPT,GLUE2(name,_copy),^?{},GLUE2(name,_msg),)
