Index: src/MakeLibCfa.cc
===================================================================
--- src/MakeLibCfa.cc	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/MakeLibCfa.cc	(revision 7528ba10cd66aa6353fc8a1b816f5aca7fdde207)
@@ -5,12 +5,12 @@
 // file "LICENCE" distributed with Cforall.
 //
-// MakeLibCfa.cc -- 
+// MakeLibCfa.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Sat May 16 10:33:33 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jun 26 16:52:59 2015
-// Update Count     : 14
-// 
+// Last Modified By : Rob Schluntz
+// Last Modified On : Tue Jan 19 13:20:26 2016
+// Update Count     : 40
+//
 
 #include "MakeLibCfa.h"
@@ -29,5 +29,5 @@
 		void visit( FunctionDecl* funcDecl );
 		void visit( ObjectDecl* objDecl );
-  
+
 		std::list< Declaration* > &get_newDecls() { return newDecls; }
 	  private:
@@ -43,5 +43,5 @@
 	void MakeLibCfa::visit( FunctionDecl* origFuncDecl ) {
 		if ( origFuncDecl->get_linkage() != LinkageSpec::Intrinsic ) return;
-  
+
 		FunctionDecl *funcDecl = origFuncDecl->clone();
 		CodeGen::OperatorInfo opInfo;
@@ -54,8 +54,14 @@
 		assert( param != funcDecl->get_functionType()->get_parameters().end() );
 
-		if ( (*param)->get_name() == "" ) {
-			(*param)->set_name( paramNamer.newName() );
-			(*param)->set_linkage( LinkageSpec::C );
-		} // if
+		for ( ; param != funcDecl->get_functionType()->get_parameters().end(); ++param ) {
+			if ( (*param)->get_name() == "" ) {
+				(*param)->set_name( paramNamer.newName() );
+				(*param)->set_linkage( LinkageSpec::C );
+			}
+			newExpr->get_args().push_back( new VariableExpr( *param ) );
+		} // for
+
+		funcDecl->set_statements( new CompoundStmt( std::list< Label >() ) );
+		newDecls.push_back( funcDecl );
 
 		switch ( opInfo.type ) {
@@ -65,16 +71,28 @@
 		  case CodeGen::OT_POSTFIX:
 		  case CodeGen::OT_INFIX:
-			newExpr->get_args().push_back( new VariableExpr( *param ) );
-			break;
 		  case CodeGen::OT_PREFIXASSIGN:
 		  case CodeGen::OT_POSTFIXASSIGN:
 		  case CodeGen::OT_INFIXASSIGN:
-			{
-				newExpr->get_args().push_back( new VariableExpr( *param ) );
-				// UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) );
-				// deref->get_args().push_back( new VariableExpr( *param ) );
-				// newExpr->get_args().push_back( deref );
+				funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( std::list< Label >(), newExpr ) );
 				break;
-			}
+		  case CodeGen::OT_CTOR:
+		  	// ctors don't return a value
+		  	if ( funcDecl->get_functionType()->get_parameters().size() == 1 ) {
+		  		// intrinsic default constructors should do nothing
+		  		// delete newExpr;
+		  		break;
+		  	} else {
+		  		assert( funcDecl->get_functionType()->get_parameters().size() == 2 );
+		  		// anything else is a single parameter constructor that is effectively a C-style assignment
+		  		// delete newExpr->get_function();
+		  		assert(newExpr->get_args().size()==2);
+		  		newExpr->set_function( new NameExpr( "?=?" ) );
+			  	funcDecl->get_statements()->get_kids().push_back( new ExprStmt( std::list< Label >(), newExpr ) );
+		  	}
+		  	break;
+		  case CodeGen::OT_DTOR:
+		  	// intrinsic destructors should do nothing
+		  	// delete newExpr;
+		  	break;
 		  case CodeGen::OT_CONSTANT:
 		  case CodeGen::OT_LABELADDRESS:
@@ -82,31 +100,14 @@
 			assert( false );
 		} // switch
-
-		for ( param++; param != funcDecl->get_functionType()->get_parameters().end(); ++param ) {
-			if ( (*param)->get_name() == "" ) {
-				(*param)->set_name( paramNamer.newName() );
-				(*param)->set_linkage( LinkageSpec::C );
-			}
-			newExpr->get_args().push_back( new VariableExpr( *param ) );
-		} // for
-		funcDecl->set_statements( new CompoundStmt( std::list< Label >() ) );
-		funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( std::list< Label >(), newExpr ) );
-		newDecls.push_back( funcDecl );
 	}
 
 	void MakeLibCfa::visit( ObjectDecl* origObjDecl ) {
 		if ( origObjDecl->get_linkage() != LinkageSpec::Intrinsic ) return;
-  
+
 		ObjectDecl *objDecl = origObjDecl->clone();
 		assert( ! objDecl->get_init() );
 		std::list< Expression* > noDesignators;
-		objDecl->set_init( new SingleInit( new NameExpr( objDecl->get_name() ), noDesignators ) );
+		objDecl->set_init( new SingleInit( new NameExpr( objDecl->get_name() ), noDesignators, false ) ); // cannot be constructed
 		newDecls.push_back( objDecl );
 	}
 } // namespace LibCfa
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
