Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision c2ce235057f98752b61e14874034b2d792b4f1b7)
+++ src/CodeGen/CodeGenerator.cc	(revision afc1045a9ddab4e6d7c524844fc6895bf4ef52ec)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// CodeGenerator.cc --
+// CodeGenerator.cc -- 
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Wed Apr 27 11:59:36 2016
-// Update Count     : 255
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Mar  2 17:32:16 2016
+// Update Count     : 243
 //
 
@@ -67,6 +67,5 @@
 	string mangleName( DeclarationWithType *decl ) {
 		if ( decl->get_mangleName() != "" ) {
-			// need to incorporate scope level in order to differentiate names for destructors
-			return decl->get_scopedMangleName();
+			return decl->get_mangleName();
 		} else {
 			return decl->get_name();
@@ -100,5 +99,5 @@
 		handleStorageClass( objectDecl );
 		output << genType( objectDecl->get_type(), mangleName( objectDecl ) );
-
+	
 		if ( objectDecl->get_init() ) {
 			output << " = ";
@@ -114,5 +113,5 @@
 		if ( aggDecl->get_name() != "" )
 			output << aggDecl->get_name();
-
+	
 		std::list< Declaration * > &memb = aggDecl->get_members();
 
@@ -120,12 +119,12 @@
 			output << " {" << endl;
 
-			cur_indent += CodeGenerator::tabsize;
+			cur_indent += CodeGenerator::tabsize; 
 			for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
-				output << indent;
+				output << indent; 
 				(*i)->accept( *this );
 				output << ";" << endl;
 			}
 
-			cur_indent -= CodeGenerator::tabsize;
+			cur_indent -= CodeGenerator::tabsize; 
 
 			output << indent << "}";
@@ -142,5 +141,5 @@
 		handleAggregate( aggregateDecl );
 	}
-
+  
 	void CodeGenerator::visit( EnumDecl *aggDecl ) {
 		output << "enum ";
@@ -148,5 +147,5 @@
 		if ( aggDecl->get_name() != "" )
 			output << aggDecl->get_name();
-
+	
 		std::list< Declaration* > &memb = aggDecl->get_members();
 
@@ -154,9 +153,9 @@
 			output << " {" << endl;
 
-			cur_indent += CodeGenerator::tabsize;
+			cur_indent += CodeGenerator::tabsize; 
 			for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
 				ObjectDecl *obj = dynamic_cast< ObjectDecl* >( *i );
 				assert( obj );
-				output << indent << mangleName( obj );
+				output << indent << mangleName( obj ); 
 				if ( obj->get_init() ) {
 					output << " = ";
@@ -166,17 +165,17 @@
 			} // for
 
-			cur_indent -= CodeGenerator::tabsize;
+			cur_indent -= CodeGenerator::tabsize; 
 
 			output << indent << "}";
 		} // if
 	}
-
+  
 	void CodeGenerator::visit( TraitDecl *aggregateDecl ) {}
-
+  
 	void CodeGenerator::visit( TypedefDecl *typeDecl ) {
 		output << "typedef ";
 		output << genType( typeDecl->get_base(), typeDecl->get_name() );
 	}
-
+  
 	void CodeGenerator::visit( TypeDecl *typeDecl ) {
 		// really, we should mutate this into something that isn't a TypeDecl but that requires large-scale changes,
@@ -214,15 +213,9 @@
 		printDesignators( init->get_designators() );
 		output << "{ ";
-		if ( init->begin_initializers() == init->end_initializers() ) {
-			// illegal to leave initializer list empty for scalar initializers,
-			// but always legal to have 0
-			output << "0";
-		} else {
-			genCommaList( init->begin_initializers(), init->end_initializers() );
-		}
+		genCommaList( init->begin_initializers(), init->end_initializers() );
 		output << " }";
 	}
 
-	void CodeGenerator::visit( Constant *constant ) {
+	void CodeGenerator::visit( Constant *constant ) { 
 		output << constant->get_value() ;
 	}
@@ -238,13 +231,10 @@
 				  case OT_POSTFIXASSIGN:
 				  case OT_INFIXASSIGN:
-				  case OT_CTOR:
-				  case OT_DTOR:
 					{
 						assert( arg != applicationExpr->get_args().end() );
 						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( "*?" ) );
 							newExpr->get_args().push_back( *arg );
@@ -253,10 +243,10 @@
 						break;
 					}
-
+	      
 				  default:
 					// do nothing
 					;
 				}
-
+	    
 				switch ( opInfo.type ) {
 				  case OT_INDEX:
@@ -267,31 +257,10 @@
 					output << "]";
 					break;
-
+	      
 				  case OT_CALL:
 					// there are no intrinsic definitions of the function call operator
 					assert( false );
 					break;
-
-				  case OT_CTOR:
-				  case OT_DTOR:
-					if ( applicationExpr->get_args().size() == 1 ) {
-						// the expression fed into a single parameter constructor or destructor
-						// may contain side effects - output as a void expression
-						output << "((void)(";
-						(*arg++)->accept( *this );
-						output << ")) /* " << opInfo.inputName << " */";
-					} else if ( applicationExpr->get_args().size() == 2 ) {
-						// intrinsic two parameter constructors are essentially bitwise assignment
-						output << "(";
-						(*arg++)->accept( *this );
-						output << opInfo.symbol;
-						(*arg)->accept( *this );
-						output << ") /* " << opInfo.inputName << " */";
-					} else {
-						// no constructors with 0 or more than 2 parameters
-						assert( false );
-					}
-					break;
-
+	      
 				  case OT_PREFIX:
 				  case OT_PREFIXASSIGN:
@@ -302,5 +271,5 @@
 					output << ")";
 					break;
-
+	      
 				  case OT_POSTFIX:
 				  case OT_POSTFIXASSIGN:
@@ -309,5 +278,4 @@
 					output << opInfo.symbol;
 					break;
-
 
 				  case OT_INFIX:
@@ -320,5 +288,5 @@
 					output << ")";
 					break;
-
+	      
 				  case OT_CONSTANT:
 				  case OT_LABELADDRESS:
@@ -339,5 +307,5 @@
 		} // if
 	}
-
+  
 	void CodeGenerator::visit( UntypedExpr *untypedExpr ) {
 		if ( NameExpr *nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
@@ -353,30 +321,9 @@
 					output << "]";
 					break;
-
+	      
 				  case OT_CALL:
 					assert( false );
-
-
-				  case OT_CTOR:
-				  case OT_DTOR:
-					if ( untypedExpr->get_args().size() == 1 ) {
-						// the expression fed into a single parameter constructor or destructor
-						// may contain side effects - output as a void expression
-						output << "((void)(";
-						(*arg++)->accept( *this );
-						output << ")) /* " << opInfo.inputName << " */";
-					} else if ( untypedExpr->get_args().size() == 2 ) {
-						// intrinsic two parameter constructors are essentially bitwise assignment
-						output << "(";
-						(*arg++)->accept( *this );
-						output << opInfo.symbol;
-						(*arg)->accept( *this );
-						output << ") /* " << opInfo.inputName << " */";
-					} else {
-						// no constructors with 0 or more than 2 parameters
-						assert( false );
-					}
-					break;
-
+					break;
+	      
 				  case OT_PREFIX:
 				  case OT_PREFIXASSIGN:
@@ -388,5 +335,5 @@
 					output << ")";
 					break;
-
+	      
 				  case OT_POSTFIX:
 				  case OT_POSTFIXASSIGN:
@@ -395,5 +342,5 @@
 					output << opInfo.symbol;
 					break;
-
+  
 				  case OT_INFIX:
 				  case OT_INFIXASSIGN:
@@ -405,5 +352,5 @@
 					output << ")";
 					break;
-
+					
 				  case OT_CONSTANT:
 					// there are no intrinsic definitions of 0 or 1 as functions
@@ -423,5 +370,5 @@
 		} // if
 	}
-
+  
 	void CodeGenerator::visit( NameExpr *nameExpr ) {
 		OperatorInfo opInfo;
@@ -433,5 +380,5 @@
 		} // if
 	}
-
+  
 	void CodeGenerator::visit( AddressExpr *addressExpr ) {
 		output << "(&";
@@ -462,14 +409,14 @@
 		output << ")";
 	}
-
+  
 	void CodeGenerator::visit( UntypedMemberExpr *memberExpr ) {
 		assert( false );
 	}
-
+  
 	void CodeGenerator::visit( MemberExpr *memberExpr ) {
 		memberExpr->get_aggregate()->accept( *this );
 		output << "." << mangleName( memberExpr->get_member() );
 	}
-
+  
 	void CodeGenerator::visit( VariableExpr *variableExpr ) {
 		OperatorInfo opInfo;
@@ -480,10 +427,10 @@
 		} // if
 	}
-
+  
 	void CodeGenerator::visit( ConstantExpr *constantExpr ) {
 		assert( constantExpr->get_constant() );
 		constantExpr->get_constant()->accept( *this );
 	}
-
+  
 	void CodeGenerator::visit( SizeofExpr *sizeofExpr ) {
 		output << "sizeof(";
@@ -522,5 +469,5 @@
 		assert( false && "OffsetPackExpr should not reach code generation" );
 	}
-
+  
 	void CodeGenerator::visit( LogicalExpr *logicalExpr ) {
 		output << "(";
@@ -534,5 +481,5 @@
 		output << ")";
 	}
-
+  
 	void CodeGenerator::visit( ConditionalExpr *conditionalExpr ) {
 		output << "(";
@@ -544,5 +491,5 @@
 		output << ")";
 	}
-
+  
 	void CodeGenerator::visit( CommaExpr *commaExpr ) {
 		output << "(";
@@ -552,7 +499,7 @@
 		output << ")";
 	}
-
+  
 	void CodeGenerator::visit( TupleExpr *tupleExpr ) {}
-
+  
 	void CodeGenerator::visit( TypeExpr *typeExpr ) {}
 
@@ -585,5 +532,5 @@
 			}
 		}
-		cur_indent -= CodeGenerator::tabsize;
+		cur_indent -= CodeGenerator::tabsize; 
 
 		output << indent << "}";
@@ -591,6 +538,6 @@
 
 	void CodeGenerator::visit( ExprStmt *exprStmt ) {
-		// I don't see why this check is necessary.
-		// If this starts to cause problems then put it back in,
+		// I don't see why this check is necessary. 
+		// If this starts to cause problems then put it back in, 
 		// with an explanation
 		assert( exprStmt );
@@ -642,5 +589,5 @@
 		switchStmt->get_condition()->accept( *this );
 		output << " ) ";
-
+		
 		output << "{" << std::endl;
 		cur_indent += CodeGenerator::tabsize;
@@ -662,5 +609,5 @@
 		} // if
 		output << ":\n";
-
+		
 		std::list<Statement *> sts = caseStmt->get_statements();
 
@@ -679,5 +626,5 @@
 			if ( ! branchStmt->get_target().empty() )
 				output << "goto " << branchStmt->get_target();
-			else {
+			else { 
 				if ( branchStmt->get_computedTarget() != 0 ) {
 					output << "goto *";
@@ -730,6 +677,6 @@
 
 	void CodeGenerator::visit( ForStmt *forStmt ) {
-		// initialization is always hoisted, so don't
-		// bother doing anything with that
+		// initialization is always hoisted, so don't 
+		// bother doing anything with that 
 		output << "for (;";
 
@@ -755,5 +702,5 @@
 	void CodeGenerator::visit( DeclStmt *declStmt ) {
 		declStmt->get_decl()->accept( *this );
-
+	
 		if ( doSemicolon( declStmt->get_decl() ) ) {
 			output << ";";
