Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 080615890f586cb9954c252b55cab47f52c25758)
+++ src/CodeGen/CodeGenerator.cc	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : 
-// Last Modified On : Sun Jul 31 08:42:18 2016
-// Update Count     : 345
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug  4 11:16:21 2016
+// Update Count     : 351
 //
 
@@ -48,5 +48,5 @@
 	}
 
-	void CodeGenerator::extension( Expression *expr ) {
+	void CodeGenerator::extension( Expression * expr ) {
 		if ( expr->get_extension() ) {
 			output << "__extension__ ";
@@ -54,5 +54,5 @@
 	} // extension
 
-	void CodeGenerator::extension( Declaration *decl ) {
+	void CodeGenerator::extension( Declaration * decl ) {
 		if ( decl->get_extension() ) {
 			output << "__extension__ ";
@@ -73,5 +73,5 @@
 	}
 
-	ostream & operator<<( ostream & output, CodeGenerator::LabelPrinter &printLabels ) {
+	ostream & operator<<( ostream & output, CodeGenerator::LabelPrinter & printLabels ) {
 		std::list< Label > & labs = *printLabels.labels;
 		// l.unique(); // assumes a sorted list. Why not use set? Does order matter?
@@ -79,21 +79,21 @@
 			output << l.get_name() + ": ";
 			printLabels.cg.genAttributes( l.get_attributes() );
-		}
+		} // for
 		return output;
 	}
 
-	CodeGenerator::CodeGenerator( std::ostream &os ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ), printLabels( *this ) {}
-
-	CodeGenerator::CodeGenerator( std::ostream &os, std::string init, int indentation, bool infunp )
+	CodeGenerator::CodeGenerator( std::ostream & os ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ), printLabels( *this ) {}
+
+	CodeGenerator::CodeGenerator( std::ostream & os, std::string init, int indentation, bool infunp )
 			: indent( *this), cur_indent( indentation ), insideFunction( infunp ), output( os ), printLabels( *this ) {
 		//output << std::string( init );
 	}
 
-	CodeGenerator::CodeGenerator( std::ostream &os, char *init, int indentation, bool infunp )
+	CodeGenerator::CodeGenerator( std::ostream & os, char * init, int indentation, bool infunp )
 			: indent( *this ), cur_indent( indentation ), insideFunction( infunp ), output( os ), printLabels( *this ) {
 		//output << std::string( init );
 	}
 
-	string mangleName( DeclarationWithType *decl ) {
+	string mangleName( DeclarationWithType * decl ) {
 		if ( decl->get_mangleName() != "" ) {
 			// need to incorporate scope level in order to differentiate names for destructors
@@ -112,14 +112,14 @@
 					genCommaList( attr->get_parameters().begin(), attr->get_parameters().end() );
 					output << ")";
-				}
+				} // if
 				output << ",";
-			}
+			} // for
 			output << ")) ";
-		}
+		} // if
 	}
 
 
 	//*** Declarations
-	void CodeGenerator::visit( FunctionDecl *functionDecl ) {
+	void CodeGenerator::visit( FunctionDecl * functionDecl ) {
 		extension( functionDecl );
 		genAttributes( functionDecl->get_attributes() );
@@ -146,5 +146,5 @@
 	}
 
-	void CodeGenerator::visit( ObjectDecl *objectDecl ) {
+	void CodeGenerator::visit( ObjectDecl * objectDecl ) {
 		extension( objectDecl );
 		handleStorageClass( objectDecl );
@@ -162,12 +162,12 @@
 	}
 
-	void CodeGenerator::handleAggregate( AggregateDecl *aggDecl ) {
+	void CodeGenerator::handleAggregate( AggregateDecl * aggDecl ) {
 		if ( aggDecl->get_name() != "" )
 			output << aggDecl->get_name();
 
-		std::list< Declaration * > &memb = aggDecl->get_members();
+		std::list< Declaration * > & memb = aggDecl->get_members();
 		if ( ! memb.empty() ) {
 //		if ( aggDecl->has_body() ) {
-//			std::list< Declaration * > &memb = aggDecl->get_members();
+//			std::list< Declaration * > & memb = aggDecl->get_members();
 			output << " {" << endl;
 
@@ -185,5 +185,5 @@
 	}
 
-	void CodeGenerator::visit( StructDecl *structDecl ) {
+	void CodeGenerator::visit( StructDecl * structDecl ) {
 		extension( structDecl );
 		output << "struct ";
@@ -191,5 +191,5 @@
 	}
 
-	void CodeGenerator::visit( UnionDecl *unionDecl ) {
+	void CodeGenerator::visit( UnionDecl * unionDecl ) {
 		extension( unionDecl );
 		output << "union ";
@@ -197,5 +197,5 @@
 	}
 
-	void CodeGenerator::visit( EnumDecl *enumDecl ) {
+	void CodeGenerator::visit( EnumDecl * enumDecl ) {
 		extension( enumDecl );
 		output << "enum ";
@@ -211,5 +211,5 @@
 			cur_indent += CodeGenerator::tabsize;
 			for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
-				ObjectDecl *obj = dynamic_cast< ObjectDecl* >( *i );
+				ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i );
 				assert( obj );
 				output << indent << mangleName( obj );
@@ -227,7 +227,7 @@
 	}
 
-	void CodeGenerator::visit( TraitDecl *traitDecl ) {}
-
-	void CodeGenerator::visit( TypedefDecl *typeDecl ) {
+	void CodeGenerator::visit( TraitDecl * traitDecl ) {}
+
+	void CodeGenerator::visit( TypedefDecl * typeDecl ) {
 		assert( false && "Typedefs are removed and substituted in earlier passes." );
 		//output << "typedef ";
@@ -235,5 +235,5 @@
 	}
 
-	void CodeGenerator::visit( TypeDecl *typeDecl ) {
+	void CodeGenerator::visit( TypeDecl * typeDecl ) {
 		// really, we should mutate this into something that isn't a TypeDecl but that requires large-scale changes,
 		// still to be done
@@ -263,10 +263,10 @@
 	}
 
-	void CodeGenerator::visit( SingleInit *init ) {
+	void CodeGenerator::visit( SingleInit * init ) {
 		printDesignators( init->get_designators() );
 		init->get_value()->accept( *this );
 	}
 
-	void CodeGenerator::visit( ListInit *init ) {
+	void CodeGenerator::visit( ListInit * init ) {
 		printDesignators( init->get_designators() );
 		output << "{ ";
@@ -276,16 +276,16 @@
 		} else {
 			genCommaList( init->begin_initializers(), init->end_initializers() );
-		}
+		} // if
 		output << " }";
 	}
 
-	void CodeGenerator::visit( Constant *constant ) {
+	void CodeGenerator::visit( Constant * constant ) {
 		output << constant->get_value() ;
 	}
 
 	//*** Expressions
-	void CodeGenerator::visit( ApplicationExpr *applicationExpr ) {
+	void CodeGenerator::visit( ApplicationExpr * applicationExpr ) {
 		extension( applicationExpr );
-		if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( applicationExpr->get_function() ) ) {
+		if ( VariableExpr * varExpr = dynamic_cast< VariableExpr* >( applicationExpr->get_function() ) ) {
 			OperatorInfo opInfo;
 			if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( varExpr->get_var()->get_name(), opInfo ) ) {
@@ -299,10 +299,10 @@
 					{
 						assert( arg != applicationExpr->get_args().end() );
-						if ( AddressExpr *addrExpr = dynamic_cast< AddressExpr * >( *arg ) ) {
+						if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( *arg ) ) {
 							// remove & from first assignment/ctor argument
 							*arg = addrExpr->get_arg();
 						} else {
 							// no address-of operator, so must be a pointer - add dereference
-							UntypedExpr *newExpr = new UntypedExpr( new NameExpr( "*?" ) );
+							UntypedExpr * newExpr = new UntypedExpr( new NameExpr( "*?" ) );
 							newExpr->get_args().push_back( *arg );
 							assert( (*arg)->get_results().size() == 1 );
@@ -352,5 +352,5 @@
 						// no constructors with 0 or more than 2 parameters
 						assert( false );
-					}
+					} // if
 					break;
 
@@ -401,7 +401,7 @@
 	}
 
-	void CodeGenerator::visit( UntypedExpr *untypedExpr ) {
+	void CodeGenerator::visit( UntypedExpr * untypedExpr ) {
 		extension( untypedExpr );
-		if ( NameExpr *nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
+		if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
 			OperatorInfo opInfo;
 			if ( operatorLookup( nameExpr->get_name(), opInfo ) ) {
@@ -472,5 +472,5 @@
 				} // switch
 			} else {
-				if ( nameExpr->get_name() == "Range" ) { // case V1 ... V2 or case V1~V2
+				if ( nameExpr->get_name() == "..." ) { // case V1 ... V2 or case V1~V2
 					assert( untypedExpr->get_args().size() == 2 );
 					(*untypedExpr->get_args().begin())->accept( *this );
@@ -492,5 +492,5 @@
 	}
 
-	void CodeGenerator::visit( NameExpr *nameExpr ) {
+	void CodeGenerator::visit( NameExpr * nameExpr ) {
 		extension( nameExpr );
 		OperatorInfo opInfo;
@@ -503,9 +503,9 @@
 	}
 
-	void CodeGenerator::visit( AddressExpr *addressExpr ) {
+	void CodeGenerator::visit( AddressExpr * addressExpr ) {
 		extension( addressExpr );
 		output << "(&";
 		// this hack makes sure that we don't convert "constant_zero" to "0" if we're taking its address
-		if ( VariableExpr *variableExpr = dynamic_cast< VariableExpr* >( addressExpr->get_arg() ) ) {
+		if ( VariableExpr * variableExpr = dynamic_cast< VariableExpr* >( addressExpr->get_arg() ) ) {
 			output << mangleName( variableExpr->get_var() );
 		} else {
@@ -515,5 +515,5 @@
 	}
 
-	void CodeGenerator::visit( CastExpr *castExpr ) {
+	void CodeGenerator::visit( CastExpr * castExpr ) {
 		extension( castExpr );
 		output << "(";
@@ -533,9 +533,9 @@
 	}
 
-	void CodeGenerator::visit( UntypedMemberExpr *memberExpr ) {
+	void CodeGenerator::visit( UntypedMemberExpr * memberExpr ) {
 		assert( false );
 	}
 
-	void CodeGenerator::visit( MemberExpr *memberExpr ) {
+	void CodeGenerator::visit( MemberExpr * memberExpr ) {
 		extension( memberExpr );
 		memberExpr->get_aggregate()->accept( *this );
@@ -543,5 +543,5 @@
 	}
 
-	void CodeGenerator::visit( VariableExpr *variableExpr ) {
+	void CodeGenerator::visit( VariableExpr * variableExpr ) {
 		extension( variableExpr );
 		OperatorInfo opInfo;
@@ -553,5 +553,5 @@
 	}
 
-	void CodeGenerator::visit( ConstantExpr *constantExpr ) {
+	void CodeGenerator::visit( ConstantExpr * constantExpr ) {
 		assert( constantExpr->get_constant() );
 		extension( constantExpr );
@@ -559,5 +559,5 @@
 	}
 
-	void CodeGenerator::visit( SizeofExpr *sizeofExpr ) {
+	void CodeGenerator::visit( SizeofExpr * sizeofExpr ) {
 		extension( sizeofExpr );
 		output << "sizeof(";
@@ -570,5 +570,5 @@
 	}
 
-	void CodeGenerator::visit( AlignofExpr *alignofExpr ) {
+	void CodeGenerator::visit( AlignofExpr * alignofExpr ) {
 		// use GCC extension to avoid bumping std to C11
 		extension( alignofExpr );
@@ -582,9 +582,9 @@
 	}
 
-	void CodeGenerator::visit( UntypedOffsetofExpr *offsetofExpr ) {
+	void CodeGenerator::visit( UntypedOffsetofExpr * offsetofExpr ) {
 		assert( false && "UntypedOffsetofExpr should not reach code generation." );
 	}
 
-	void CodeGenerator::visit( OffsetofExpr *offsetofExpr ) {
+	void CodeGenerator::visit( OffsetofExpr * offsetofExpr ) {
 		// use GCC builtin
 		output << "__builtin_offsetof(";
@@ -594,9 +594,9 @@
 	}
 
-	void CodeGenerator::visit( OffsetPackExpr *offsetPackExpr ) {
+	void CodeGenerator::visit( OffsetPackExpr * offsetPackExpr ) {
 		assert( false && "OffsetPackExpr should not reach code generation." );
 	}
 
-	void CodeGenerator::visit( LogicalExpr *logicalExpr ) {
+	void CodeGenerator::visit( LogicalExpr * logicalExpr ) {
 		extension( logicalExpr );
 		output << "(";
@@ -611,5 +611,5 @@
 	}
 
-	void CodeGenerator::visit( ConditionalExpr *conditionalExpr ) {
+	void CodeGenerator::visit( ConditionalExpr * conditionalExpr ) {
 		extension( conditionalExpr );
 		output << "(";
@@ -622,5 +622,5 @@
 	}
 
-	void CodeGenerator::visit( CommaExpr *commaExpr ) {
+	void CodeGenerator::visit( CommaExpr * commaExpr ) {
 		extension( commaExpr );
 		output << "(";
@@ -631,9 +631,9 @@
 	}
 
-	void CodeGenerator::visit( TupleExpr *tupleExpr ) {}
-
-	void CodeGenerator::visit( TypeExpr *typeExpr ) {}
-
-	void CodeGenerator::visit( AsmExpr *asmExpr ) {
+	void CodeGenerator::visit( TupleExpr * tupleExpr ) {}
+
+	void CodeGenerator::visit( TypeExpr * typeExpr ) {}
+
+	void CodeGenerator::visit( AsmExpr * asmExpr ) {
 		if ( asmExpr->get_inout() ) {
 			output << "[ ";
@@ -648,5 +648,5 @@
 
 	//*** Statements
-	void CodeGenerator::visit( CompoundStmt *compoundStmt ) {
+	void CodeGenerator::visit( CompoundStmt * compoundStmt ) {
 		std::list<Statement*> ks = compoundStmt->get_kids();
 		output << "{" << endl;
@@ -662,5 +662,5 @@
 				output << endl;
 			} // if
-		}
+		} // for
 		cur_indent -= CodeGenerator::tabsize;
 
@@ -668,5 +668,5 @@
 	}
 
-	void CodeGenerator::visit( ExprStmt *exprStmt ) {
+	void CodeGenerator::visit( ExprStmt * exprStmt ) {
 		assert( exprStmt );
 		// cast the top-level expression to void to reduce gcc warnings.
@@ -676,5 +676,5 @@
 	}
 
-	void CodeGenerator::visit( AsmStmt *asmStmt ) {
+	void CodeGenerator::visit( AsmStmt * asmStmt ) {
 		output << "asm ";
 		if ( asmStmt->get_voltile() ) output << "volatile ";
@@ -699,5 +699,5 @@
 	}
 
-	void CodeGenerator::visit( IfStmt *ifStmt ) {
+	void CodeGenerator::visit( IfStmt * ifStmt ) {
 		output << "if ( ";
 		ifStmt->get_condition()->accept( *this );
@@ -712,5 +712,5 @@
 	}
 
-	void CodeGenerator::visit( SwitchStmt *switchStmt ) {
+	void CodeGenerator::visit( SwitchStmt * switchStmt ) {
 		output << "switch ( " ;
 		switchStmt->get_condition()->accept( *this );
@@ -719,13 +719,10 @@
 		output << "{" << std::endl;
 		cur_indent += CodeGenerator::tabsize;
-
-		acceptAll( switchStmt->get_branches(), *this );
-
+		acceptAll( switchStmt->get_statements(), *this );
 		cur_indent -= CodeGenerator::tabsize;
-
 		output << indent << "}";
 	}
 
-	void CodeGenerator::visit( CaseStmt *caseStmt ) {
+	void CodeGenerator::visit( CaseStmt * caseStmt ) {
 		output << indent;
 		if ( caseStmt->isDefault()) {
@@ -748,5 +745,5 @@
 	}
 
-	void CodeGenerator::visit( BranchStmt *branchStmt ) {
+	void CodeGenerator::visit( BranchStmt * branchStmt ) {
 		switch ( branchStmt->get_type()) {
 		  case BranchStmt::Goto:
@@ -771,5 +768,5 @@
 
 
-	void CodeGenerator::visit( ReturnStmt *returnStmt ) {
+	void CodeGenerator::visit( ReturnStmt * returnStmt ) {
 		output << "return ";
 		maybeAccept( returnStmt->get_expr(), *this );
@@ -777,5 +774,5 @@
 	}
 
-	void CodeGenerator::visit( WhileStmt *whileStmt ) {
+	void CodeGenerator::visit( WhileStmt * whileStmt ) {
 		if ( whileStmt->get_isDoWhile() ) {
 			output << "do" ;
@@ -799,5 +796,5 @@
 	}
 
-	void CodeGenerator::visit( ForStmt *forStmt ) {
+	void CodeGenerator::visit( ForStmt * forStmt ) {
 		// initialization is always hoisted, so don't bother doing anything with that
 		output << "for (;";
@@ -821,10 +818,10 @@
 	}
 
-	void CodeGenerator::visit( NullStmt *nullStmt ) {
+	void CodeGenerator::visit( NullStmt * nullStmt ) {
 		//output << indent << CodeGenerator::printLabels( nullStmt->get_labels() );
 		output << "/* null statement */ ;";
 	}
 
-	void CodeGenerator::visit( DeclStmt *declStmt ) {
+	void CodeGenerator::visit( DeclStmt * declStmt ) {
 		declStmt->get_decl()->accept( *this );
 
@@ -834,5 +831,5 @@
 	}
 
-	void CodeGenerator::handleStorageClass( Declaration *decl ) {
+	void CodeGenerator::handleStorageClass( Declaration * decl ) {
 		switch ( decl->get_storageClass() ) {
 		  case DeclarationNode::Extern:
