Index: src/ControlStruct/ChooseMutator.cc
===================================================================
--- src/ControlStruct/ChooseMutator.cc	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/ChooseMutator.cc	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Wed Jun 03 15:30:20 2015
-// Update Count     : 5
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue May 19 15:31:39 2015
+// Update Count     : 2
 //
 
@@ -44,9 +44,4 @@
 		std::list< Statement * > &stmts = caseStmt->get_statements();
 
-		// the difference between switch and choose is that switch has an implicit fallthrough
-		// to the next case, whereas choose has an implicit break at the end of the current case.
-		// thus to transform a choose statement into a switch, we only need to insert breaks at the
-		// end of any case that doesn't already end in a break and that doesn't end in a fallthru
-
 		if ( insideChoose ) {
 			BranchStmt *posBrk;
Index: src/ControlStruct/LabelFixer.cc
===================================================================
--- src/ControlStruct/LabelFixer.cc	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/LabelFixer.cc	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Wed Jun 24 16:24:34 2015
-// Update Count     : 141
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue May 19 15:25:59 2015
+// Update Count     : 1
 //
 
@@ -19,38 +19,17 @@
 #include "LabelFixer.h"
 #include "MLEMutator.h"
-#include "SynTree/Expression.h"
 #include "SynTree/Statement.h"
 #include "SynTree/Declaration.h"
 #include "utility.h"
 
-#include <iostream>
-
 namespace ControlStruct {
 	LabelFixer::Entry::Entry( Statement *to, Statement *from ) : definition ( to ) {
-		if ( from != 0 ) {
-			UsageLoc loc; loc.stmt = from;
-			usage.push_back( loc );
-		}
+		if ( from != 0 )
+			usage.push_back( from );
 	}
-
-	LabelFixer::Entry::Entry( Statement *to, Expression *from ) : definition ( to ) {
-		if ( from != 0 ) {
-			UsageLoc loc; loc.expr = from;
-			usage.push_back( loc );
-		}
-	}
-
 
 	bool LabelFixer::Entry::insideLoop() {
 		return ( dynamic_cast< ForStmt * > ( definition ) ||
-			dynamic_cast< WhileStmt * > ( definition )  );
-	}
-
-	void LabelFixer::Entry::UsageLoc::accept( Visitor & visitor ) {
-		if ( dynamic_cast< Statement * >( stmt ) ) {
-			stmt->accept( visitor );
-		} else {
-			expr->accept( visitor );
-		}
+				 dynamic_cast< WhileStmt * > ( definition )  );
 	}
 
@@ -61,5 +40,6 @@
 
 	void LabelFixer::visit( FunctionDecl *functionDecl ) {
-		maybeAccept( functionDecl->get_statements(), *this );
+		if ( functionDecl->get_statements() != 0 )
+			functionDecl->get_statements()->accept( *this );
 
 		MLEMutator mlemut( resolveJumps(), generator );
@@ -67,11 +47,8 @@
 	}
 
-	// prune to at most one label definition for each statement
 	void LabelFixer::visit( Statement *stmt ) {
-		currentStatement = stmt;
 		std::list< Label > &labels = stmt->get_labels();
 
 		if ( ! labels.empty() ) {
-			// only remember one label for each statement
 			Label current = setLabelsDef( labels, stmt );
 			labels.clear();
@@ -81,166 +58,84 @@
 
 	void LabelFixer::visit( BranchStmt *branchStmt ) {
-		visit ( ( Statement * )branchStmt );
+		visit ( ( Statement * )branchStmt );  // the labels this statement might have
 
-		// for labeled branches, add an entry to the label table
-		Label target = branchStmt->get_target();
-		if ( target != "" ) {
+		Label target;
+		if ( (target = branchStmt->get_target()) != "" ) {
 			setLabelsUsg( target, branchStmt );
-		}
+		} //else       /* computed goto or normal exit-loop statements */
 	}
 
-	void LabelFixer::visit( UntypedExpr *untyped ) {
-		if ( NameExpr * func = dynamic_cast< NameExpr * >( untyped->get_function() ) ) {
-			if ( func->get_name() == "&&" ) {
-				NameExpr * arg = dynamic_cast< NameExpr * >( untyped->get_args().front() );
-				Label target = arg->get_name();
-				assert( target != "" );
-				setLabelsUsg( target, untyped );
-			} else {
-				Visitor::visit( untyped );
-			}
-		}
+	Label LabelFixer::setLabelsDef( std::list< Label > &llabel, Statement *definition ) {
+		assert( definition != 0 );
+		Entry *entry = new Entry( definition );
+		bool used = false;
+
+		for ( std::list< Label >::iterator i = llabel.begin(); i != llabel.end(); i++ )
+			if ( labelTable.find( *i ) == labelTable.end() )
+				{ used = true; labelTable[ *i ] = entry; } // undefined and unused
+			else
+				if ( labelTable[ *i ]->defined() )
+					throw SemanticError( "Duplicate definition of label: " + *i );
+				else
+					labelTable[ *i ]->set_definition( definition );
+
+		if ( ! used ) delete entry;
+
+		return labelTable[ llabel.front() ]->get_label();  // this *must* exist
 	}
 
+	Label LabelFixer::setLabelsUsg( Label orgValue, Statement *use ) {
+		assert( use != 0 );
 
-	// sets the definition of the labelTable entry to be the provided 
-	// statement for every label in the list parameter. Happens for every kind of statement
-	Label LabelFixer::setLabelsDef( std::list< Label > &llabel, Statement *definition ) {
-		assert( definition != 0 );
-		assert( llabel.size() > 0 );
+		if ( labelTable.find( orgValue ) != labelTable.end() )
+			labelTable[ orgValue ]->add_use( use );         // the label has been defined or used before
+		else
+			labelTable[ orgValue ] = new Entry( 0, use );
 
-		Entry * e = new Entry( definition );
-
-		for ( std::list< Label >::iterator i = llabel.begin(); i != llabel.end(); i++ ) {
-			if ( labelTable.find( *i ) == labelTable.end() ) {
-				// all labels on this statement need to use the same entry, so this should only be created once
-				// undefined and unused until now, add an entry
-				labelTable[ *i ] =  e;
-			} else if ( labelTable[ *i ]->defined() ) {
-				// defined twice, error
-				throw SemanticError( "Duplicate definition of label: " + *i );
-			}	else {
-				// used previously, but undefined until now -> link with this entry
-				Entry * oldEntry = labelTable[ *i ];
-				e->add_uses( *oldEntry );
-				labelTable[ *i ] = e;
-			} // if
-		} // for
-
-		// produce one of the labels attached to this statement to be 
-		// temporarily used as the canonical label
-		return labelTable[ llabel.front() ]->get_label();
+		return labelTable[ orgValue ]->get_label();
 	}
 
-	// Remember all uses of a label.
-	template< typename UsageNode >
-	void LabelFixer::setLabelsUsg( Label orgValue, UsageNode *use ) {
-		assert( use != 0 );
-
-		if ( labelTable.find( orgValue ) != labelTable.end() ) {
-			// the label has been defined or used before
-			labelTable[ orgValue ]->add_use( use );
-		} else {
-			labelTable[ orgValue ] = new Entry( 0, use );
-		}
-	}
-
-	class LabelGetter : public Visitor {
-		public:
-		LabelGetter( Label &label ) : label( label ) {}
-
-		virtual void visit( BranchStmt * branchStmt ) {
-			label = branchStmt->get_target();
-		}
-
-		virtual void visit( UntypedExpr * untyped ) {
-			NameExpr * name = dynamic_cast< NameExpr * >( untyped->get_function() );
-			assert( name );
-			assert( name->get_name() == "&&" );
-			NameExpr * arg = dynamic_cast< NameExpr * >( untyped->get_args().front() );
-			assert( arg );
-			label = arg->get_name();
-		}		
-
-		private:
-			Label &label;
-	};
-
-	class LabelSetter : public Visitor {
-		public:
-		LabelSetter( Label label ) : label( label ) {}
-
-		virtual void visit( BranchStmt * branchStmt ) {
-			branchStmt->set_target( label );
-		}
-
-		virtual void visit( UntypedExpr * untyped ) {
-			NameExpr * name = dynamic_cast< NameExpr * >( untyped->get_function() );
-			assert( name );
-			assert( name->get_name() == "&&" );
-			NameExpr * arg = dynamic_cast< NameExpr * >( untyped->get_args().front() );
-			assert( arg );
-			arg->set_name( label );
-		}
-
-	private:
-		Label label;
-	};
-
-	// Ultimately builds a table that maps a label to its defining statement.
-	// In the process, 
 	std::map<Label, Statement * > *LabelFixer::resolveJumps() throw ( SemanticError ) {
 		std::map< Statement *, Entry * > def_us;
 
-		// combine the entries for all labels that target the same location
-		for ( std::map< Label, Entry *>::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) {
+		for ( std::map< Label, Entry *>::iterator i = labelTable.begin(); i != labelTable.end(); i++ ) {
 			Entry *e = i->second;
 
-			if ( def_us.find ( e->get_definition() ) == def_us.end() ) {
+			if ( def_us.find ( e->get_definition() ) == def_us.end() )
 				def_us[ e->get_definition() ] = e;
-			} else if ( e->used() ) {
-				def_us[ e->get_definition() ]->add_uses( *e );
-			}
+			else
+				if ( e->used() )
+					def_us[ e->get_definition() ]->add_uses( e->get_uses() );
 		}
 
-		// create a unique label for each target location. 
-		for ( std::map< Statement *, Entry * >::iterator i = def_us.begin(); i != def_us.end(); ++i ) {
+		// get rid of labelTable
+		for ( std::map< Statement *, Entry * >::iterator i = def_us.begin(); i != def_us.end(); i++ ) {
 			Statement *to = (*i).first;
-			Entry * entry = (*i).second;
-			std::list< Entry::UsageLoc > &from = entry->get_uses();
+			std::list< Statement *> &from = (*i).second->get_uses();
+			Label finalLabel = generator->newLabel();
+			(*i).second->set_label( finalLabel );
 
-			// no label definition found
 			if ( to == 0 ) {
-				Label undef;
-				LabelGetter getLabel( undef );
-				from.back().accept( getLabel );
-				// Label undef = getLabel( from.back()->get_target() );
+				BranchStmt *first_use = dynamic_cast<BranchStmt *>(from.back());
+				Label undef("");
+				if ( first_use != 0 )
+					undef = first_use->get_target();
 				throw SemanticError ( "'" + undef + "' label not defined");
-			} // if
-
-			// generate a new label, and attach it to its defining statement as the only label on that statement
-			Label finalLabel = generator->newLabel( to->get_labels().back() );
-			entry->set_label( finalLabel );
+			}
 
 			to->get_labels().clear();
 			to->get_labels().push_back( finalLabel );
 
-			// redirect each of the source branch statements to the new target label
-			for ( std::list< Entry::UsageLoc >::iterator j = from.begin(); j != from.end(); ++j ) {
-				LabelSetter setLabel( finalLabel );
-				(*j).accept( setLabel );
-				// setLabel( *j, finalLabel );
-
-				// BranchStmt *jump = *j;
-				// assert( jump != 0 );
-				// jump->set_target( finalLabel );
+			for ( std::list< Statement *>::iterator j = from.begin(); j != from.end(); j++ ) {
+				BranchStmt *jumpTo = dynamic_cast< BranchStmt * > ( *j );
+				assert( jumpTo != 0 );
+				jumpTo->set_target( finalLabel );
 			} // for
 		} // for
 
-		// create a table where each label maps to its defining statement
+		// reverse table
 		std::map< Label, Statement * > *ret = new std::map< Label, Statement * >();
-		for ( std::map< Statement *, Entry * >::iterator i = def_us.begin(); i != def_us.end(); ++i ) {
+		for ( std::map< Statement *, Entry * >::iterator i = def_us.begin(); i != def_us.end(); i++ ) 
 			(*ret)[ (*i).second->get_label() ] = (*i).first;
-		}
 
 		return ret;
Index: src/ControlStruct/LabelFixer.h
===================================================================
--- src/ControlStruct/LabelFixer.h	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/LabelFixer.h	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Tue Jun 23 15:47:25 2015
-// Update Count     : 28
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue May 19 15:31:55 2015
+// Update Count     : 3
 //
 
@@ -53,23 +53,12 @@
 		virtual void visit( DeclStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
 		virtual void visit( BranchStmt *branchStmt );
-		virtual void visit( UntypedExpr *untyped );
 
 		Label setLabelsDef( std::list< Label > &, Statement *definition );
-		template< typename UsageNode >
-		void setLabelsUsg( Label, UsageNode *usage = 0 );
+		Label setLabelsUsg( Label, Statement *usage = 0 );
 
 	  private:
 		class Entry {
-			public:
-			union UsageLoc {
-				Statement * stmt;
-				Expression * expr;
-
-				void accept( Visitor &visitor );
-			};
-
-			Entry( Statement *to ) : definition( to ) {}
-			Entry( Statement *to, Statement *from );
-			Entry( Statement *to, Expression *from );
+		  public:
+			Entry( Statement *to = 0, Statement *from = 0 );
 			bool used() { return ( usage.empty() ); }
 			bool defined() { return ( definition != 0 ); }
@@ -77,31 +66,21 @@
 
 			Label get_label() const { return label; }
-			void set_label( Label lab ) { label = lab; }
+			Statement *get_definition() const { return definition; }
+			std::list< Statement *> &get_uses() { return usage; }
 
-			Statement *get_definition() const { return definition; }
+			void add_use ( Statement *use ) { usage.push_back( use ); }
+			void add_uses ( std::list<Statement *> uses ) { usage.insert( usage.end(), uses.begin(), uses.end() ); }
 			void set_definition( Statement *def ) { definition = def; }
 
-			std::list< UsageLoc > &get_uses() { return usage; }
-			void add_use( Statement *use ) {
-				UsageLoc loc;
-				loc.stmt = use;
-				usage.push_back( loc ); 
-			}
-			void add_use( Expression *use ) {
-				UsageLoc loc;
-				loc.expr = use;
-				usage.push_back( loc ); 				
-			}
-
-			void add_uses ( Entry &other ) { usage.insert( usage.end(), other.usage.begin(), usage.end() ); }
+			void set_label( Label lab ) { label = lab; }
+			Label gset_label() const { return label; }
 		  private:
 			Label label;  
 			Statement *definition;
-			std::list<UsageLoc> usage;
+			std::list<Statement *> usage;
 		};
 	          
 		std::map < Label, Entry *> labelTable;
 		LabelGenerator *generator;
-		Statement * currentStatement;
 	};
 } // namespace ControlStruct
Index: src/ControlStruct/LabelGenerator.cc
===================================================================
--- src/ControlStruct/LabelGenerator.cc	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/LabelGenerator.cc	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -10,10 +10,10 @@
 // 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 On : Tue May 19 15:32:04 2015
+// Update Count     : 2
 //
 
 #include <iostream>
-#include <sstream>
+#include <strstream>
 
 #include "LabelGenerator.h"
@@ -29,8 +29,9 @@
 	}
 
-	Label LabelGenerator::newLabel( std::string suffix ) {
-		std::ostringstream os;
-		os << "__L" << current++ << "__" << suffix;
-		std::string ret = os.str();
+	Label LabelGenerator::newLabel() {
+		std::ostrstream os;
+		os << "__L" << current++ << "__";// << std::ends;
+		os.freeze( false );
+		std::string ret = std::string (os.str(), os.pcount());
 		return Label( ret );
 	}
Index: src/ControlStruct/LabelGenerator.h
===================================================================
--- src/ControlStruct/LabelGenerator.h	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/LabelGenerator.h	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Wed Jun 03 14:16:26 2015
-// Update Count     : 5
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue May 19 15:33:20 2015
+// Update Count     : 3
 //
 
@@ -18,5 +18,4 @@
 
 #include "SynTree/SynTree.h"
-#include <string>
 
 namespace ControlStruct {
@@ -24,5 +23,5 @@
 	  public:
 		static LabelGenerator *getGenerator();
-		Label newLabel(std::string suffix = "");
+		Label newLabel();
 		void reset() { current = 0; }
 		void rewind() { current--; }
Index: src/ControlStruct/LabelTypeChecker.cc
===================================================================
--- src/ControlStruct/LabelTypeChecker.cc	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/LabelTypeChecker.cc	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Wed Jun 24 16:24:48 2015
-// Update Count     : 3
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue May 19 15:32:15 2015
+// Update Count     : 2
 //
 
@@ -29,5 +29,5 @@
 		NameExpr *fname;
 		if ( ((fname = dynamic_cast<NameExpr *>(untypedExpr->get_function())) != 0) 
-			 && fname->get_name() == std::string("&&") )
+			 && fname->get_name() == std::string("LabAddress") )
 			std::cerr << "Taking the label of an address." << std::endl;
 		else {
Index: src/ControlStruct/MLEMutator.cc
===================================================================
--- src/ControlStruct/MLEMutator.cc	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/MLEMutator.cc	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Thu Jun 04 15:12:33 2015
-// Update Count     : 173
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue May 19 15:32:26 2015
+// Update Count     : 2
 //
 
@@ -19,5 +19,4 @@
 #include "MLEMutator.h"
 #include "SynTree/Statement.h"
-#include "SynTree/Expression.h"
 
 namespace ControlStruct {
@@ -27,124 +26,69 @@
 	}
 
-	// break labels have to come after the statement they break out of, 
-	// so mutate a statement, then if they inform us through the breakLabel field
-	// tha they need a place to jump to on a break statement, add the break label 
-	// to the body of statements
-	void MLEMutator::fixBlock( std::list< Statement * > &kids ) {
+	CompoundStmt* MLEMutator::mutate( CompoundStmt *cmpndStmt ) {
+		bool labeledBlock = false;
+		if ( !((cmpndStmt->get_labels()).empty()) ) {
+			labeledBlock = true;
+			enclosingBlocks.push_back( Entry( cmpndStmt ) );
+		} // if
+
+		std::list< Statement * > &kids = cmpndStmt->get_kids();
 		for ( std::list< Statement * >::iterator k = kids.begin(); k != kids.end(); k++ ) {
 			*k = (*k)->acceptMutator(*this);
 
 			if ( ! get_breakLabel().empty() ) {
-				std::list< Statement * >::iterator next = k+1;
+				std::list< Statement * >::iterator next = k; next++;
 				if ( next == kids.end() ) {
 					std::list<Label> ls; ls.push_back( get_breakLabel() );
 					kids.push_back( new NullStmt( ls ) );
-				} else {
+				} else
 					(*next)->get_labels().push_back( get_breakLabel() );
-				}
 
 				set_breakLabel("");
 			} // if
 		} // for
-	}
-
-	CompoundStmt* MLEMutator::mutate( CompoundStmt *cmpndStmt ) {
-		bool labeledBlock = !(cmpndStmt->get_labels().empty());
-		if ( labeledBlock ) {
-			Label brkLabel = generator->newLabel("blockBreak");
-			enclosingBlocks.push_back( Entry( cmpndStmt, brkLabel ) );
-		} // if
-
-		// a child statement may set the break label
-		// - if they do, attach it to the next statement
-		std::list< Statement * > &kids = cmpndStmt->get_kids();
-		fixBlock( kids );
 
 		if ( labeledBlock ) {
 			assert( ! enclosingBlocks.empty() );
-			if ( ! enclosingBlocks.back().useBreakExit().empty() ) {
-				set_breakLabel( enclosingBlocks.back().useBreakExit() );
-			}
+			if ( ! enclosingBlocks.back().get_breakExit().empty() )
+				set_breakLabel( enclosingBlocks.back().get_breakExit() );
 			enclosingBlocks.pop_back();
 		} // if
 
+		//mutateAll( cmpndStmt->get_kids(), *this );
 		return cmpndStmt;
 	}
 
-	template< typename LoopClass >
-	Statement *MLEMutator::handleLoopStmt( LoopClass *loopStmt ) {
-		// remember this as the most recent enclosing loop, then mutate 
-		// the body of the loop -- this will determine whether brkLabel
-		// and contLabel are used with branch statements
-		// and will recursively do the same to nested loops
-		Label brkLabel = generator->newLabel("loopBreak");
-		Label contLabel = generator->newLabel("loopContinue");
-		enclosingLoops.push_back( Entry( loopStmt, brkLabel, contLabel ) );
-		loopStmt->set_body ( loopStmt->get_body()->acceptMutator( *this ) );
-
-		// sanity check that the enclosing loops have been popped correctly
+	Statement *MLEMutator::mutate( WhileStmt *whileStmt ) {
+		enclosingLoops.push_back( Entry( whileStmt ) );
+		whileStmt->set_body ( whileStmt->get_body()->acceptMutator( *this ) );
+
 		Entry &e = enclosingLoops.back();
-		assert ( e == loopStmt );
-
-		// this will take the necessary steps to add definitions of the previous
-		// two labels, if they are used.
-		loopStmt->set_body( mutateLoop( loopStmt->get_body(), e ) );
+		assert ( e == whileStmt );
+		whileStmt->set_body( mutateLoop( whileStmt->get_body(), e ) );
 		enclosingLoops.pop_back();
 
-		return loopStmt;
-	}
-
-	Statement *MLEMutator::mutate( CaseStmt *caseStmt ) {
-		caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) );
-		fixBlock( caseStmt->get_statements() );
-
-		return caseStmt;
-	}
-
-	template< typename SwitchClass >
-	Statement *MLEMutator::handleSwitchStmt( SwitchClass *switchStmt ) {
-		// generate a label for breaking out of a labeled switch 
-		Label brkLabel = generator->newLabel("switchBreak");
-		enclosingSwitches.push_back( Entry(switchStmt, brkLabel) );
-		mutateAll( switchStmt->get_branches(), *this ); 
-
-		Entry &e = enclosingSwitches.back();
-		assert ( e == switchStmt );
-
-		// only generate break label if labeled break is used
-		if (e.isBreakUsed()) {
-			// for the purposes of keeping switch statements uniform (i.e. all statements that are 
-			// direct children of a switch should be CastStmts), append the exit label + break to the 
-			// last case statement; create a default case if there are no cases
-			std::list< Statement * > &branches = switchStmt->get_branches();
-			if ( branches.empty() ) {
-				branches.push_back( CaseStmt::makeDefault() );
-			}
-
-			if ( CaseStmt * c = dynamic_cast< CaseStmt * >( branches.back() ) ) {
-				std::list<Label> temp; temp.push_back( brkLabel );
-				c->get_statements().push_back( new BranchStmt( temp, Label(""), BranchStmt::Break ) );
-			} else assert(0); // as of this point, all branches of a switch are still CaseStmts
-		}
-
-		assert ( enclosingSwitches.back() == switchStmt );
-		enclosingSwitches.pop_back();
-		return switchStmt;
+		return whileStmt;
+	}
+
+	Statement *MLEMutator::mutate( ForStmt *forStmt ) {
+		enclosingLoops.push_back( Entry( forStmt ) );
+		maybeMutate( forStmt->get_body(), *this );
+
+		Entry &e = enclosingLoops.back();
+		assert ( e == forStmt );
+		forStmt->set_body( mutateLoop( forStmt->get_body(), e ) );
+		enclosingLoops.pop_back();
+
+		return forStmt;
 	}
 
 	Statement *MLEMutator::mutate( BranchStmt *branchStmt ) throw ( SemanticError ) {
-		std::string originalTarget = branchStmt->get_originalTarget();
-
 		if ( branchStmt->get_type() == BranchStmt::Goto )
 			return branchStmt;
 
 		// test if continue target is a loop
-		if ( branchStmt->get_type() == BranchStmt::Continue) {
-			if ( enclosingLoops.empty() ) {
-				throw SemanticError( "'continue' outside a loop" );
-			} else if ( std::find( enclosingLoops.begin(), enclosingLoops.end(), (*targetTable)[branchStmt->get_target()] ) == enclosingLoops.end() ) {
-				throw SemanticError( "'continue' target label must be an enclosing loop: " + originalTarget );
-			}
-		}
+		if ( branchStmt->get_type() == BranchStmt::Continue && enclosingLoops.empty() )
+			throw SemanticError( "'continue' outside a loop" );
 
 		if ( branchStmt->get_type() == BranchStmt::Break && (enclosingLoops.empty() && enclosingSwitches.empty() && enclosingBlocks.empty() ) )
@@ -154,5 +98,5 @@
 
 		if ( targetTable->find( branchStmt->get_target() ) == targetTable->end() )
-			throw SemanticError("The label defined in the exit loop statement does not exist: " + originalTarget );  // shouldn't happen (since that's already checked)
+			throw SemanticError("The label defined in the exit loop statement does not exist." );  // shouldn't happen (since that's already checked)
 
 		std::list< Entry >::iterator check;
@@ -162,30 +106,62 @@
 				// neither in loop nor in block, checking if in switch/choose
 				if ( (check = std::find( enclosingSwitches.begin(), enclosingSwitches.end(), (*targetTable)[branchStmt->get_target()] )) == enclosingSwitches.end() )
-					throw SemanticError("The target specified in the exit loop statement does not correspond to an enclosing control structure: " + originalTarget );
-
-		// what about exiting innermost block or switch???
+					throw SemanticError("The target specified in the exit loop statement does not correspond to an enclosing loop.");
+
 		if ( enclosingLoops.back() == (*check) )
 			return branchStmt;				// exit the innermost loop (labels unnecessary)
 
-		// branch error checks, get the appropriate label name and create a goto
-		Label exitLabel;
+		Label newLabel;
 		switch ( branchStmt->get_type() ) {
 		  case BranchStmt::Break:
-				assert( check->useBreakExit() != "");
-				exitLabel = check->useBreakExit();
-				break;
+			if ( check->get_breakExit() != "" )
+				newLabel = check->get_breakExit();
+			else {
+				newLabel = generator->newLabel();
+				check->set_breakExit( newLabel );
+			} // if
+			break;
 		  case BranchStmt::Continue:
-				assert( check->useContExit() != "");
-				exitLabel = check->useContExit();
-				break;
+			if ( check->get_contExit() != "" )
+				newLabel = check->get_contExit();
+			else {
+				newLabel = generator->newLabel();
+				check->set_contExit( newLabel );
+			} // if
+			break;
 		  default:
-				assert(0);					// shouldn't be here
+			return 0;					// shouldn't be here
 		} // switch
 
-		return new BranchStmt( std::list<Label>(), exitLabel, BranchStmt::Goto );
+		return new BranchStmt( std::list<Label>(), newLabel, BranchStmt::Goto );
+	}
+
+
+	Statement *MLEMutator::mutate( SwitchStmt *switchStmt ) {
+		Label brkLabel = generator->newLabel();
+		enclosingSwitches.push_back( Entry(switchStmt, "", brkLabel) );
+		mutateAll( switchStmt->get_branches(), *this ); {
+			// check if this is necessary (if there is a break to this point, otherwise do not generate
+			std::list<Label> temp; temp.push_back( brkLabel );
+			switchStmt->get_branches().push_back( new BranchStmt( temp, Label(""), BranchStmt::Break ) );
+		}
+		assert ( enclosingSwitches.back() == switchStmt );
+		enclosingSwitches.pop_back();
+		return switchStmt;
+	}
+
+	Statement *MLEMutator::mutate( ChooseStmt *switchStmt ) {
+		Label brkLabel = generator->newLabel();
+		enclosingSwitches.push_back( Entry(switchStmt,"", brkLabel) );
+		mutateAll( switchStmt->get_branches(), *this ); {
+			// check if this is necessary (if there is a break to this point, otherwise do not generate
+			std::list<Label> temp; temp.push_back( brkLabel );
+			switchStmt->get_branches().push_back( new BranchStmt( temp, Label(""), BranchStmt::Break ) );
+		}
+		assert ( enclosingSwitches.back() == switchStmt );
+		enclosingSwitches.pop_back();
+		return switchStmt;
 	}
 
 	Statement *MLEMutator::mutateLoop( Statement *bodyLoop, Entry &e ) {
-		// ensure loop body is a block
 		CompoundStmt *newBody;
 		if ( ! (newBody = dynamic_cast<CompoundStmt *>( bodyLoop )) ) {
@@ -194,37 +170,39 @@
 		} // if
 
-		// only generate these when needed
-
-		if ( e.isContUsed() ) {
-			// continue label goes in the body as the last statement
-			std::list< Label > labels; labels.push_back( e.useContExit() );
-			newBody->get_kids().push_back( new NullStmt( labels ) );			
-		}
-
-		if ( e.isBreakUsed() ) {
-			// break label goes after the loop -- it'll get set by the 
-			// outer mutator if we do this
-			set_breakLabel( e.useBreakExit() );			
-		}
+		Label endLabel = e.get_contExit();
+
+		if ( e.get_breakExit() != "" ) {
+			if ( endLabel == "" ) endLabel = generator->newLabel();
+			// check for whether this label is used or not, so as to not generate extraneous gotos
+			if (e.breakExitUsed)
+				newBody->get_kids().push_back( new BranchStmt( std::list< Label >(), endLabel, BranchStmt::Goto ) );
+			// xxx
+			//std::list< Label > ls; ls.push_back( e.get_breakExit() );
+			set_breakLabel( e.get_breakExit() );
+			//newBody->get_kids().push_back( new BranchStmt( ls, "", BranchStmt::Break ) );
+		} // if
+
+		if ( e.get_breakExit() != "" || e.get_contExit() != "" ) {
+			if (dynamic_cast< NullStmt *>( newBody->get_kids().back() ))
+				newBody->get_kids().back()->get_labels().push_back( endLabel );
+			else {
+				std::list < Label > ls; ls.push_back( endLabel );
+				newBody->get_kids().push_back( new NullStmt( ls ) );
+			} // if
+		} // if
 
 		return newBody;
 	}
 
-	Statement *MLEMutator::mutate( WhileStmt *whileStmt ) {
-		return handleLoopStmt( whileStmt );
-	}
-
-	Statement *MLEMutator::mutate( ForStmt *forStmt ) {
-		return handleLoopStmt( forStmt );
-	}
-
-	Statement *MLEMutator::mutate( SwitchStmt *switchStmt ) {
-		return handleSwitchStmt( switchStmt );
-	}
-
-	Statement *MLEMutator::mutate( ChooseStmt *switchStmt ) {
-		return handleSwitchStmt( switchStmt );		
-	}
-
+	//*** Entry's methods
+	void MLEMutator::Entry::set_contExit( Label l ) {
+		assert ( contExit == "" || contExit == l );
+		contExit = l;
+	}
+
+	void MLEMutator::Entry::set_breakExit( Label l ) {
+		assert ( breakExit == "" || breakExit == l );
+		breakExit = l;
+	}
 } // namespace ControlStruct
 
Index: src/ControlStruct/MLEMutator.h
===================================================================
--- src/ControlStruct/MLEMutator.h	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/MLEMutator.h	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Wed Jun 03 15:06:36 2015
-// Update Count     : 25
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue May 19 15:32:39 2015
+// Update Count     : 3
 //
 
@@ -38,5 +38,4 @@
 		Statement *mutate( BranchStmt *branchStmt ) throw ( SemanticError );
 
-		Statement *mutate( CaseStmt *caseStmt ); 
 		Statement *mutate( SwitchStmt *switchStmt );
 		Statement *mutate( ChooseStmt *switchStmt );
@@ -49,6 +48,6 @@
 		class Entry {
 		  public:
-			explicit Entry( Statement *_loop, Label _breakExit, Label _contExit = Label("") ) :
-				loop( _loop ), breakExit( _breakExit ), contExit( _contExit ), breakUsed(false), contUsed(false) {}
+			explicit Entry( Statement *_loop = 0, Label _contExit = Label(""), Label _breakExit = Label("") ) :
+				loop( _loop ), contExit( _contExit ), breakExit( _breakExit ), contExitUsed( false ), breakExitUsed( false ) {}
 
 			bool operator==( const Statement *stmt ) { return ( loop == stmt ); }
@@ -59,14 +58,15 @@
 			Statement *get_loop() const { return loop; }
 
-			Label useContExit() { contUsed = true; return contExit; }
-			Label useBreakExit() { breakUsed = true; return breakExit; }
+			Label get_contExit() const { return contExit; }
+			void set_contExit( Label );
 
-			bool isContUsed() const { return contUsed; }
-			bool isBreakUsed() const { return breakUsed; }
+			Label get_breakExit() const { return breakExit; }
+			void set_breakExit( Label );
 
 		  private:
 			Statement *loop;
-			Label breakExit, contExit;
-			bool breakUsed, contUsed;
+			Label contExit, breakExit;
+		  public: // hack, provide proper [sg]etters
+			bool contExitUsed, breakExitUsed;
 		};
 
@@ -75,12 +75,4 @@
 		Label breakLabel;
 		LabelGenerator *generator;
-
-		template< typename LoopClass >
-		Statement *handleLoopStmt( LoopClass *loopStmt );
-
-		template< typename SwitchClass > 
-		Statement *handleSwitchStmt( SwitchClass *switchStmt );
-
-		void fixBlock( std::list< Statement * > &kids );
 	};
 } // namespace ControlStruct
Index: src/ControlStruct/Mutate.cc
===================================================================
--- src/ControlStruct/Mutate.cc	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/Mutate.cc	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Wed Jun 03 23:08:43 2015
-// Update Count     : 5
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue May 19 15:32:52 2015
+// Update Count     : 2
 //
 
@@ -37,15 +37,7 @@
 	void mutate( std::list< Declaration * > translationUnit ) {
 		// ForExprMutator formut;
-
-		// normalizes label definitions and generates multi-level
-		// exit labels
 		LabelFixer lfix;
-
-		// transform choose statements into switch statements
 		ChooseMutator chmut;
-
-		// expand case ranges and turn fallthru into a null statement
 		CaseRangeMutator ranges;  // has to run after ChooseMutator
-
 		//ExceptMutator exc;
 		// LabelTypeChecker lbl;
Index: src/ControlStruct/module.mk
===================================================================
--- src/ControlStruct/module.mk	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ControlStruct/module.mk	(revision 09d789c493c816483fb88c49a900967b7addbd2c)
@@ -1,20 +1,4 @@
-######################### -*- Mode: Makefile-Gmake -*- ########################
-##
-## 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.
-##
-## module.mk -- 
-##
-## Author           : Richard C. Bilson
-## Created On       : Mon Jun  1 17:49:17 2015
-## Last Modified By : Peter A. Buhr
-## Last Modified On : Mon Jun  1 17:51:45 2015
-## Update Count     : 1
-###############################################################################
-
 SRC +=  ControlStruct/LabelGenerator.cc \
-	ControlStruct/LabelFixer.cc \
+        ControlStruct/LabelFixer.cc \
         ControlStruct/MLEMutator.cc \
 	ControlStruct/CaseRangeMutator.cc \
@@ -22,4 +6,5 @@
 	ControlStruct/ChooseMutator.cc \
 	ControlStruct/ForExprMutator.cc \
-	ControlStruct/LabelTypeChecker.cc
+	ControlStruct/LabelTypeChecker.cc \
+	$(NULL)
 
