Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 4e5e6cc70090e807822b56cfc8f3dc1ddaae698e)
+++ src/InitTweak/InitTweak.cc	(revision f9a7cf02009d22652a44bc6eb45f9b86af2f2e54)
@@ -1,2 +1,17 @@
+//
+// 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.
+//
+// InitTweak.cc --
+//
+// Author           : Rob Schluntz
+// Created On       : Fri May 13 11:26:36 2016
+// Last Modified By : Aaron B. Moss
+// Last Modified On : Mon Jun 10 13:30:00 2019
+// Update Count     : 5
+//
+
 #include <algorithm>               // for find, all_of
 #include <cassert>                 // for assertf, assert, strict_dynamic_cast
@@ -4,4 +19,5 @@
 #include <iterator>                // for back_insert_iterator, back_inserter
 #include <memory>                  // for __shared_ptr
+#include <vector>
 
 #include "AST/Expr.hpp"
@@ -307,6 +323,6 @@
 	}
 
-	struct CallFinder {
-		CallFinder( const std::list< std::string > & names ) : names( names ) {}
+	struct CallFinder_old {
+		CallFinder_old( const std::list< std::string > & names ) : names( names ) {}
 
 		void postvisit( ApplicationExpr * appExpr ) {
@@ -331,8 +347,31 @@
 	};
 
+	struct CallFinder_new final {
+		std::vector< ast::ptr< ast::Expr > > matches;
+		const std::vector< std::string > names;
+
+		CallFinder_new( std::vector< std::string > && ns ) : matches(), names( std::move(ns) ) {}
+
+		void handleCallExpr( const ast::Expr * expr ) {
+			std::string fname = getFunctionName( expr );
+			if ( std::find( names.begin(), names.end(), fname ) != names.end() ) {
+				matches.emplace_back( expr );
+			}
+		}
+
+		void postvisit( const ast::ApplicationExpr * expr ) { handleCallExpr( expr ); }
+		void postvisit( const ast::UntypedExpr *     expr ) { handleCallExpr( expr ); }
+	};
+
 	void collectCtorDtorCalls( Statement * stmt, std::list< Expression * > & matches ) {
-		static PassVisitor<CallFinder> finder( std::list< std::string >{ "?{}", "^?{}" } );
+		static PassVisitor<CallFinder_old> finder( std::list< std::string >{ "?{}", "^?{}" } );
 		finder.pass.matches = &matches;
 		maybeAccept( stmt, finder );
+	}
+
+	std::vector< ast::ptr< ast::Expr > > collectCtorDtorCalls( const ast::Stmt * stmt ) {
+		ast::Pass< CallFinder_new > finder{ std::vector< std::string >{ "?{}", "^?{}" } };
+		maybe_accept( stmt, finder );
+		return std::move( finder.pass.matches );
 	}
 
@@ -436,4 +475,18 @@
 	}
 
+	const ast::ApplicationExpr * isIntrinsicCallExpr( const ast::Expr * expr ) {
+		auto appExpr = dynamic_cast< const ast::ApplicationExpr * >( expr );
+		if ( ! appExpr ) return nullptr;
+
+		const ast::DeclWithType * func = getCalledFunction( appExpr->func );
+		assertf( func, 
+			"getCalledFunction returned nullptr: %s", toString( appExpr->func ).c_str() );
+		
+		// check for Intrinsic only -- don't want to remove all overridable ctor/dtor because 
+		// autogenerated ctor/dtor will call all member dtors, and some members may have a 
+		// user-defined dtor
+		return func->linkage == ast::Linkage::Intrinsic ? appExpr : nullptr;
+	}
+
 	namespace {
 		template <typename Predicate>
@@ -444,4 +497,10 @@
 			return std::all_of( callExprs.begin(), callExprs.end(), pred);
 		}
+
+		template <typename Predicate>
+		bool allofCtorDtor( const ast::Stmt * stmt, const Predicate & pred ) {
+			std::vector< ast::ptr< ast::Expr > > callExprs = collectCtorDtorCalls( stmt );
+			return std::all_of( callExprs.begin(), callExprs.end(), pred );
+		}
 	}
 
@@ -452,4 +511,16 @@
 				assert( funcType );
 				return funcType->get_parameters().size() == 1;
+			}
+			return false;
+		});
+	}
+
+	bool isIntrinsicSingleArgCallStmt( const ast::Stmt * stmt ) {
+		return allofCtorDtor( stmt, []( const ast::Expr * callExpr ){
+			if ( const ast::ApplicationExpr * appExpr = isIntrinsicCallExpr( callExpr ) ) {
+				const ast::FunctionType * funcType = 
+					GenPoly::getFunctionType( appExpr->func->result );
+				assert( funcType );
+				return funcType->params.size() == 1;
 			}
 			return false;
Index: src/InitTweak/InitTweak.h
===================================================================
--- src/InitTweak/InitTweak.h	(revision 4e5e6cc70090e807822b56cfc8f3dc1ddaae698e)
+++ src/InitTweak/InitTweak.h	(revision f9a7cf02009d22652a44bc6eb45f9b86af2f2e54)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// RemoveInit.h --
+// InitTweak.h --
 //
 // Author           : Rob Schluntz
 // Created On       : Fri May 13 11:26:36 2016
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 22 09:30:33 2017
-// Update Count     : 4
+// Last Modified By : Aaron B. Moss
+// Last Modified On : Mon Jun 10 13:30:00 2019
+// Update Count     : 5
 //
 
@@ -19,4 +19,5 @@
 #include <memory>             // for shared_ptr
 #include <string>             // for string, allocator
+#include <vector>
 
 #include "AST/Fwd.hpp"        // for AST nodes
@@ -63,4 +64,5 @@
 	/// Non-Null if expr is a call expression whose target function is intrinsic
 	ApplicationExpr * isIntrinsicCallExpr( Expression * expr );
+	const ast::ApplicationExpr * isIntrinsicCallExpr( const ast::Expr * expr);
 
 	/// True if stmt is a call statement where the function called is intrinsic and takes one parameter.
@@ -68,4 +70,5 @@
 	/// Currently has assertions that make it less than fully general.
 	bool isIntrinsicSingleArgCallStmt( Statement * stmt );
+	bool isIntrinsicSingleArgCallStmt( const ast::Stmt * stmt );
 
 	/// True if stmt is a call statement where the function called is intrinsic.
@@ -74,4 +77,5 @@
 	/// get all Ctor/Dtor call expressions from a Statement
 	void collectCtorDtorCalls( Statement * stmt, std::list< Expression * > & matches );
+	std::vector< ast::ptr< ast::Expr > > collectCtorDtorCalls( const ast::Stmt * stmt );
 
 	/// get the Ctor/Dtor call expression from a Statement that looks like a generated ctor/dtor call
