Index: src/InitTweak/FixInitNew.cpp
===================================================================
--- src/InitTweak/FixInitNew.cpp	(revision ed9a1ae9fd2dfee0f1af522273e707b0ae29b439)
+++ src/InitTweak/FixInitNew.cpp	(revision 3f7e68b737bfa5ec5df54d50ea194ff4dfd59db7)
@@ -14,4 +14,5 @@
 #include <utility>                     // for pair
 
+#include "AST/Inspect.hpp"             // for getFunction, getPointerBase, g...
 #include "CodeGen/GenType.h"           // for genPrettyType
 #include "CodeGen/OperatorTable.h"
@@ -24,5 +25,4 @@
 #include "GenInit.h"                   // for genCtorDtor
 #include "GenPoly/GenPoly.h"           // for getFunctionType
-#include "InitTweak.h"                 // for getFunctionName, getCallArg
 #include "ResolvExpr/Resolver.h"       // for findVoidExpression
 #include "ResolvExpr/typeops.h"        // for typesCompatible
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision ed9a1ae9fd2dfee0f1af522273e707b0ae29b439)
+++ src/InitTweak/InitTweak.cc	(revision 3f7e68b737bfa5ec5df54d50ea194ff4dfd59db7)
@@ -10,6 +10,6 @@
 // Created On       : Fri May 13 11:26:36 2016
 // Last Modified By : Andrew Beach
-// Last Modified On : Mon Dec  6 13:21:00 2021
-// Update Count     : 20
+// Last Modified On : Wed Sep 22  9:50:00 2022
+// Update Count     : 21
 //
 
@@ -23,4 +23,5 @@
 #include "AST/Expr.hpp"
 #include "AST/Init.hpp"
+#include "AST/Inspect.hpp"
 #include "AST/Node.hpp"
 #include "AST/Pass.hpp"
@@ -654,5 +655,4 @@
 	namespace {
 		DeclarationWithType * getCalledFunction( Expression * expr );
-		const ast::DeclWithType * getCalledFunction( const ast::Expr * expr );
 
 		template<typename CallExpr>
@@ -664,14 +664,4 @@
 			return getCalledFunction( expr->get_args().front() );
 		}
-
-		template<typename CallExpr>
-		const ast::DeclWithType * handleDerefCalledFunction( const CallExpr * expr ) {
-			// (*f)(x) => should get "f"
-			std::string name = getFunctionName( expr );
-			assertf( name == "*?", "Unexpected untyped expression: %s", name.c_str() );
-			assertf( ! expr->args.empty(), "Cannot get called function from dereference with no arguments" );
-			return getCalledFunction( expr->args.front() );
-		}
-
 
 		DeclarationWithType * getCalledFunction( Expression * expr ) {
@@ -695,24 +685,4 @@
 		}
 
-		const ast::DeclWithType * getCalledFunction( const ast::Expr * expr ) {
-			assert( expr );
-			if ( const ast::VariableExpr * varExpr = dynamic_cast< const ast::VariableExpr * >( expr ) ) {
-				return varExpr->var;
-			} else if ( const ast::MemberExpr * memberExpr = dynamic_cast< const ast::MemberExpr * >( expr ) ) {
-				return memberExpr->member;
-			} else if ( const ast::CastExpr * castExpr = dynamic_cast< const ast::CastExpr * >( expr ) ) {
-				return getCalledFunction( castExpr->arg );
-			} else if ( const ast::UntypedExpr * untypedExpr = dynamic_cast< const ast::UntypedExpr * >( expr ) ) {
-				return handleDerefCalledFunction( untypedExpr );
-			} else if ( const ast::ApplicationExpr * appExpr = dynamic_cast< const ast::ApplicationExpr * > ( expr ) ) {
-				return handleDerefCalledFunction( appExpr );
-			} else if ( const ast::AddressExpr * addrExpr = dynamic_cast< const ast::AddressExpr * >( expr ) ) {
-				return getCalledFunction( addrExpr->arg );
-			} else if ( const ast::CommaExpr * commaExpr = dynamic_cast< const ast::CommaExpr * >( expr ) ) {
-				return getCalledFunction( commaExpr->arg2 );
-			}
-			return nullptr;
-		}
-
 		DeclarationWithType * getFunctionCore( const Expression * expr ) {
 			if ( const auto * appExpr = dynamic_cast< const ApplicationExpr * >( expr ) ) {
@@ -731,13 +701,4 @@
 	const DeclarationWithType * getFunction( const Expression * expr ) {
 		return getFunctionCore( expr );
-	}
-
-	const ast::DeclWithType * getFunction( const ast::Expr * expr ) {
-		if ( const ast::ApplicationExpr * appExpr = dynamic_cast< const ast::ApplicationExpr * >( expr ) ) {
-			return getCalledFunction( appExpr->func );
-		} else if ( const ast::UntypedExpr * untyped = dynamic_cast< const ast::UntypedExpr * > ( expr ) ) {
-			return getCalledFunction( untyped->func );
-		}
-		assertf( false, "getFunction received unknown expression: %s", toString( expr ).c_str() );
 	}
 
@@ -752,18 +713,4 @@
 	}
 
-	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>
@@ -817,17 +764,4 @@
 				if ( pos == 0 ) return arg;
 				pos--;
-			}
-			assert( false );
-		}
-
-		template<typename CallExpr>
-		const ast::Expr * callArg( const CallExpr * call, unsigned int pos ) {
-			if( pos >= call->args.size() ) {
-				assertf( false, "getCallArg for argument that doesn't exist: (%u); %s.",
-					pos, toString( call ).c_str() );
-			}
-			for ( const ast::Expr * arg : call->args ) {
-				if ( pos == 0 ) return arg;
-				--pos;
 			}
 			assert( false );
@@ -854,27 +788,6 @@
 	}
 
-	const ast::Expr * getCallArg( const ast::Expr * call, unsigned pos ) {
-		if ( auto app = dynamic_cast< const ast::ApplicationExpr * >( call ) ) {
-			return callArg( app, pos );
-		} else if ( auto untyped = dynamic_cast< const ast::UntypedExpr * >( call ) ) {
-			return callArg( untyped, pos );
-		} else if ( auto tupleAssn = dynamic_cast< const ast::TupleAssignExpr * >( call ) ) {
-			const std::list<ast::ptr<ast::Stmt>>& stmts = tupleAssn->stmtExpr->stmts->kids;
-			assertf( ! stmts.empty(), "TupleAssignExpr missing statements." );
-			auto stmt  = strict_dynamic_cast< const ast::ExprStmt * >( stmts.back().get() );
-			auto tuple = strict_dynamic_cast< const ast::TupleExpr * >( stmt->expr.get() );
-			assertf( ! tuple->exprs.empty(), "TupleAssignExpr has empty tuple expr.");
-			return getCallArg( tuple->exprs.front(), pos );
-		} else if ( auto ctor = dynamic_cast< const ast::ImplicitCopyCtorExpr * >( call ) ) {
-			return getCallArg( ctor->callExpr, pos );
-		} else {
-			assertf( false, "Unexpected expression type passed to getCallArg: %s",
-				toString( call ).c_str() );
-		}
-	}
-
 	namespace {
 		std::string funcName( Expression * func );
-		std::string funcName( const ast::Expr * func );
 
 		template<typename CallExpr>
@@ -885,13 +798,4 @@
 			assertf( ! expr->get_args().empty(), "Cannot get function name from dereference with no arguments" );
 			return funcName( expr->get_args().front() );
-		}
-
-		template<typename CallExpr>
-		std::string handleDerefName( const CallExpr * expr ) {
-			// (*f)(x) => should get name "f"
-			std::string name = getFunctionName( expr );
-			assertf( name == "*?", "Unexpected untyped expression: %s", name.c_str() );
-			assertf( ! expr->args.empty(), "Cannot get function name from dereference with no arguments" );
-			return funcName( expr->args.front() );
 		}
 
@@ -917,26 +821,4 @@
 			}
 		}
-
-		std::string funcName( const ast::Expr * func ) {
-			if ( const ast::NameExpr * nameExpr = dynamic_cast< const ast::NameExpr * >( func ) ) {
-				return nameExpr->name;
-			} else if ( const ast::VariableExpr * varExpr = dynamic_cast< const ast::VariableExpr * >( func ) ) {
-				return varExpr->var->name;
-			} else if ( const ast::CastExpr * castExpr = dynamic_cast< const ast::CastExpr * >( func ) ) {
-				return funcName( castExpr->arg );
-			} else if ( const ast::MemberExpr * memberExpr = dynamic_cast< const ast::MemberExpr * >( func ) ) {
-				return memberExpr->member->name;
-			} else if ( const ast::UntypedMemberExpr * memberExpr = dynamic_cast< const ast::UntypedMemberExpr * > ( func ) ) {
-				return funcName( memberExpr->member );
-			} else if ( const ast::UntypedExpr * untypedExpr = dynamic_cast< const ast::UntypedExpr * >( func ) ) {
-				return handleDerefName( untypedExpr );
-			} else if ( const ast::ApplicationExpr * appExpr = dynamic_cast< const ast::ApplicationExpr * >( func ) ) {
-				return handleDerefName( appExpr );
-			} else if ( const ast::ConstructorExpr * ctorExpr = dynamic_cast< const ast::ConstructorExpr * >( func ) ) {
-				return funcName( getCallArg( ctorExpr->callExpr, 0 ) );
-			} else {
-				assertf( false, "Unexpected expression type being called as a function in call expression: %s", toString( func ).c_str() );
-			}
-		}
 	}
 
@@ -955,18 +837,4 @@
 	}
 
-	std::string getFunctionName( const ast::Expr * expr ) {
-		// there's some unforunate overlap here with getCalledFunction. Ideally this would be able to use getCalledFunction and
-		// return the name of the DeclarationWithType, but this needs to work for NameExpr and UntypedMemberExpr, where getCalledFunction
-		// can't possibly do anything reasonable.
-		if ( const ast::ApplicationExpr * appExpr = dynamic_cast< const ast::ApplicationExpr * >( expr ) ) {
-			return funcName( appExpr->func );
-		} else if ( const ast::UntypedExpr * untypedExpr = dynamic_cast< const ast::UntypedExpr * > ( expr ) ) {
-			return funcName( untypedExpr->func );
-		} else {
-			std::cerr << expr << std::endl;
-			assertf( false, "Unexpected expression type passed to getFunctionName" );
-		}
-	}
-
 	Type * getPointerBase( Type * type ) {
 		if ( PointerType * ptrType = dynamic_cast< PointerType * >( type ) ) {
@@ -979,13 +847,4 @@
 			return nullptr;
 		}
-	}
-	const ast::Type* getPointerBase( const ast::Type* t ) {
-		if ( const auto * p = dynamic_cast< const ast::PointerType * >( t ) ) {
-			return p->base;
-		} else if ( const auto * a = dynamic_cast< const ast::ArrayType * >( t ) ) {
-			return a->base;
-		} else if ( const auto * r = dynamic_cast< const ast::ReferenceType * >( t ) ) {
-			return r->base;
-		} else return nullptr;
 	}
 
@@ -1203,10 +1062,11 @@
 	if ( ftype->params.size() != 2 ) return false;
 
-	const ast::Type * t1 = getPointerBase( ftype->params.front() );
+	const ast::Type * t1 = ast::getPointerBase( ftype->params.front() );
 	if ( ! t1 ) return false;
 	const ast::Type * t2 = ftype->params.back();
 
-	return ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, ast::SymbolTable{} );
+	return ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, ast::SymbolTable() );
 }
+
 
 	const FunctionDecl * isAssignment( const Declaration * decl ) {
Index: src/InitTweak/InitTweak.h
===================================================================
--- src/InitTweak/InitTweak.h	(revision ed9a1ae9fd2dfee0f1af522273e707b0ae29b439)
+++ src/InitTweak/InitTweak.h	(revision 3f7e68b737bfa5ec5df54d50ea194ff4dfd59db7)
@@ -10,6 +10,6 @@
 // Created On       : Fri May 13 11:26:36 2016
 // Last Modified By : Andrew Beach
-// Last Modified On : Mon Dec  6 13:20:00 2021
-// Update Count     : 8
+// Last Modified On : Wed Sep 22  9:21:00 2022
+// Update Count     : 9
 //
 
@@ -74,9 +74,7 @@
 	DeclarationWithType * getFunction( Expression * expr );
 	const DeclarationWithType * getFunction( const Expression * expr );
-	const ast::DeclWithType * getFunction( const ast::Expr * expr );
 
 	/// 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.
@@ -98,13 +96,10 @@
 	/// returns the name of the function being called
 	std::string getFunctionName( Expression * expr );
-	std::string getFunctionName( const ast::Expr * expr );
 
 	/// returns the argument to a call expression in position N indexed from 0
 	Expression *& getCallArg( Expression * callExpr, unsigned int pos );
-	const ast::Expr * getCallArg( const ast::Expr * call, unsigned pos );
 
 	/// returns the base type of a PointerType or ArrayType, else returns NULL
 	Type * getPointerBase( Type * );
-	const ast::Type* getPointerBase( const ast::Type* );
 
 	/// returns the argument if it is a PointerType or ArrayType, else returns NULL
