Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
+++ src/InitTweak/FixInit.cc	(revision f1e012b7aa1aaea6aa2dde9bcb3b0e83dcf13824)
@@ -10,6 +10,6 @@
 // Created On       : Wed Jan 13 16:29:30 2016
 // Last Modified By : Rob Schluntz
-// Last Modified On : Wed Jan 13 16:45:37 2016
-// Update Count     : 17
+// Last Modified On : Tue Jan 19 13:25:13 2016
+// Update Count     : 27
 //
 
@@ -35,4 +35,6 @@
 
 		virtual ObjectDecl * mutate( ObjectDecl *objDecl );
+
+		virtual CompoundStmt * mutate( CompoundStmt * compoundStmt );
 	};
 
@@ -50,5 +52,5 @@
 	ObjectDecl *FixInit::mutate( ObjectDecl *objDecl ) {
 		if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
-			// a decision should have been made by the resolver, so either ctor is NULL or init is NULL
+			// a decision should have been made by the resolver, so ctor and init are not both non-NULL
 			assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
 			if ( Expression * ctor = ctorInit->get_ctor() ) {
@@ -61,6 +63,6 @@
 				ctorInit->set_init( NULL );
 			} else {
-				// one of them should be non-NULL
-				assert( ctorInit->get_ctor() || ctorInit->get_init() );
+				// no constructor and no initializer, which is okay
+				objDecl->set_init( NULL );
 			}
 			delete ctorInit;
@@ -68,4 +70,24 @@
 		return objDecl;
 	}
+
+	CompoundStmt * FixInit::mutate( CompoundStmt * compoundStmt ) {
+		std::list< Statement * > & statements = compoundStmt->get_kids();
+		for ( std::list< Statement * >::iterator it = statements.begin(); it != statements.end(); ++it ) {
+			// remove if instrinsic destructor statement
+			// xxx - test user manually calling intrinsic functions - what happens?
+			if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( *it ) ) {
+				if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( exprStmt->get_expr() ) ) {
+					if ( VariableExpr * function = dynamic_cast< VariableExpr * >( appExpr->get_function() ) ) {
+						if ( function->get_var()->get_name() == "^?{}" && function->get_var()->get_linkage() == LinkageSpec::Intrinsic ) {
+							statements.erase(it++);
+						}
+					}
+				}
+			}
+		}
+		// mutate non-destructor statements
+		return Mutator::mutate( compoundStmt );
+	}
+
 } // namespace InitTweak
 
Index: src/InitTweak/RemoveInit.cc
===================================================================
--- src/InitTweak/RemoveInit.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
+++ src/InitTweak/RemoveInit.cc	(revision f1e012b7aa1aaea6aa2dde9bcb3b0e83dcf13824)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Wed Jan 13 15:19:35 2016
-// Update Count     : 154
+// Last Modified On : Tue Jan 19 11:12:49 2016
+// Update Count     : 165
 //
 
@@ -59,4 +59,6 @@
 		static void generateCtorDtor( std::list< Declaration * > &translationUnit );
 
+		CtorDtor() : inFunction( false ) {}
+
 		virtual ObjectDecl * mutate( ObjectDecl * );
 		virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
@@ -71,4 +73,5 @@
 
 	  protected:
+		bool inFunction;
 
 		// to be added before block ends - use push_front so order is correct
@@ -93,5 +96,6 @@
 		if (objDecl->get_init() && dynamic_cast<TypeInstType*>(objDecl->get_type())) {
 			if (SingleInit * single = dynamic_cast<SingleInit*>(objDecl->get_init())) {
-				UntypedExpr *assign = new UntypedExpr( new NameExpr( "?=?" ) );
+				// xxx this can be more complicated - consider ListInit
+				UntypedExpr *assign = new UntypedExpr( new NameExpr( "?{}" ) );
 				assign->get_args().push_back( new AddressExpr (new NameExpr( objDecl->get_name() ) ) );
 				assign->get_args().push_back( single->get_value()->clone() );
@@ -107,4 +111,5 @@
 		// hands off if the function returns an lvalue - we don't want to allocate a temporary if a variable's address
 		// is being returned
+		// xxx - this should construct rather than assign
 		if ( returnStmt->get_expr() && returnVals.size() == 1 && funcName != "?=?" && ! returnVals.front()->get_type()->get_isLvalue()  ) {
 			ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, returnVals.front()->get_type()->clone(), 0 );
@@ -186,12 +191,18 @@
 		// hands off if designated or if @=
 		if ( tryConstruct( objDecl ) ) {
-			Expression * ctor = makeCtorDtorExpr( "?{}", objDecl, makeInitList( objDecl->get_init() ) );
-			Expression * dtor = makeCtorDtorExpr( "^?{}", objDecl, std::list< Expression * >() );
-
-			// need to remember init expression, in case no ctors exist
-			// if ctor does exist, want to use ctor expression instead of init
-			// push this decision to the resolver
-			objDecl->set_init( new ConstructorInit( ctor, objDecl->get_init() ) );
-			destructorStmts.push_front( new ExprStmt( noLabels, dtor ) );
+			if ( inFunction ) {
+				Expression * ctor = makeCtorDtorExpr( "?{}", objDecl, makeInitList( objDecl->get_init() ) );
+				Expression * dtor = makeCtorDtorExpr( "^?{}", objDecl, std::list< Expression * >() );
+
+				// need to remember init expression, in case no ctors exist
+				// if ctor does exist, want to use ctor expression instead of init
+				// push this decision to the resolver
+				objDecl->set_init( new ConstructorInit( ctor, objDecl->get_init() ) );
+				destructorStmts.push_front( new ExprStmt( noLabels, dtor ) );
+			} else {
+				// xxx - find a way to construct/destruct globals
+				// hack: implicit "static" initialization routine for each struct type? or something similar?
+				// --ties into module system
+			}
 		}
 		return objDecl;
@@ -200,6 +211,9 @@
 	DeclarationWithType * CtorDtor::mutate( FunctionDecl *functionDecl ) {
 		// parameters should not be constructed and destructed, so don't mutate FunctionType
+		bool oldInFunc = inFunction;
 		mutateAll( functionDecl->get_oldDecls(), *this );
+		inFunction = true;
 		functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
+		inFunction = oldInFunc;
 		return functionDecl;
 	}
