Index: src/InitTweak/FixInitNew.cpp
===================================================================
--- src/InitTweak/FixInitNew.cpp	(revision 33b7d490d37c1f84e96a85cdf1c8baad2b08aeb8)
+++ src/InitTweak/FixInitNew.cpp	(revision 4c530a517ad27e21191fa09816161ecc4ca7a818)
@@ -86,5 +86,5 @@
 	/// generate/resolve copy construction expressions for each, and generate/resolve destructors for both
 	/// arguments and return value temporaries
-	struct ResolveCopyCtors final : public ast::WithGuards, public ast::WithStmtsToAdd<>, public ast::WithSymbolTable, public ast::WithShortCircuiting, public ast::WithVisitorRef<ResolveCopyCtors> {
+	struct ResolveCopyCtors final : public ast::WithGuards, public ast::WithStmtsToAdd<>, public ast::WithSymbolTable, public ast::WithShortCircuiting, public ast::WithVisitorRef<ResolveCopyCtors>, public ast::WithConstTranslationUnit {
 		const ast::Expr * postvisit( const ast::ImplicitCopyCtorExpr * impCpCtorExpr );
 		const ast::StmtExpr * previsit( const ast::StmtExpr * stmtExpr );
@@ -190,5 +190,5 @@
 	/// for any member that is missing a corresponding ctor/dtor call.
 	/// error if a member is used before constructed
-	struct GenStructMemberCalls final : public ast::WithGuards, public ast::WithShortCircuiting, public ast::WithSymbolTable, public ast::WithVisitorRef<GenStructMemberCalls> {
+	struct GenStructMemberCalls final : public ast::WithGuards, public ast::WithShortCircuiting, public ast::WithSymbolTable, public ast::WithVisitorRef<GenStructMemberCalls>, public ast::WithConstTranslationUnit {
 		void previsit( const ast::FunctionDecl * funcDecl );
 		const ast::DeclWithType * postvisit( const ast::FunctionDecl * funcDecl );
@@ -215,5 +215,5 @@
 
 	/// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument
-	struct FixCtorExprs final : public ast::WithDeclsToAdd<>, public ast::WithSymbolTable, public ast::WithShortCircuiting {
+	struct FixCtorExprs final : public ast::WithDeclsToAdd<>, public ast::WithSymbolTable, public ast::WithShortCircuiting, public ast::WithConstTranslationUnit {
 		const ast::Expr * postvisit( const ast::ConstructorExpr * ctorExpr );
 	};
@@ -510,5 +510,5 @@
 		// (VariableExpr and already resolved expression)
 		CP_CTOR_PRINT( std::cerr << "ResolvingCtorDtor " << untyped << std::endl; )
-		ast::ptr<ast::Expr> resolved = ResolvExpr::findVoidExpression(untyped, symtab);
+		ast::ptr<ast::Expr> resolved = ResolvExpr::findVoidExpression(untyped, { symtab, transUnit().global } );
 		assert( resolved );
 		if ( resolved->env ) {
@@ -588,11 +588,12 @@
 
 	ast::Expr * ResolveCopyCtors::destructRet( const ast::ObjectDecl * ret, const ast::Expr * arg ) {
+		auto global = transUnit().global;
 		// TODO: refactor code for generating cleanup attribute, since it's common and reused in ~3-4 places
 		// check for existing cleanup attribute before adding another(?)
 		// need to add __Destructor for _tmp_cp variables as well
 
-		assertf( ast::dtorStruct, "Destructor generation requires __Destructor definition." );
-		assertf( ast::dtorStruct->members.size() == 2, "__Destructor definition does not have expected fields." );
-		assertf( ast::dtorStructDestroy, "Destructor generation requires __destroy_Destructor." );
+		assertf( global.dtorStruct, "Destructor generation requires __Destructor definition." );
+		assertf( global.dtorStruct->members.size() == 2, "__Destructor definition does not have expected fields." );
+		assertf( global.dtorDestroy, "Destructor generation requires __destroy_Destructor." );
 
 		const CodeLocation loc = ret->location;
@@ -611,5 +612,5 @@
 		auto dtorFunc = getDtorFunc( ret, new ast::ExprStmt(loc, dtor ), stmtsToAddBefore );
 
-		auto dtorStructType = new ast::StructInstType(ast::dtorStruct);
+		auto dtorStructType = new ast::StructInstType( global.dtorStruct );
 
 		// what does this do???
@@ -623,9 +624,9 @@
 		static UniqueName namer( "_ret_dtor" );
 		auto retDtor = new ast::ObjectDecl(loc, namer.newName(), dtorStructType, new ast::ListInit(loc, { new ast::SingleInit(loc, ast::ConstantExpr::null(loc) ), new ast::SingleInit(loc, new ast::CastExpr( new ast::VariableExpr(loc, dtorFunc ), dtorType ) ) } ) );
-		retDtor->attributes.push_back( new ast::Attribute( "cleanup", { new ast::VariableExpr(loc, ast::dtorStructDestroy ) } ) );
+		retDtor->attributes.push_back( new ast::Attribute( "cleanup", { new ast::VariableExpr(loc, global.dtorDestroy ) } ) );
 		stmtsToAddBefore.push_back( new ast::DeclStmt(loc, retDtor ) );
 
 		if ( arg ) {
-			auto member = new ast::MemberExpr(loc, ast::dtorStruct->members.front().strict_as<ast::DeclWithType>(), new ast::VariableExpr(loc, retDtor ) );
+			auto member = new ast::MemberExpr(loc, global.dtorStruct->members.front().strict_as<ast::DeclWithType>(), new ast::VariableExpr(loc, retDtor ) );
 			auto object = new ast::CastExpr( new ast::AddressExpr( new ast::VariableExpr(loc, ret ) ), new ast::PointerType(new ast::VoidType() ) );
 			ast::Expr * assign = createBitwiseAssignment( member, object );
@@ -1179,4 +1180,5 @@
 			auto guard = makeFuncGuard( [this]() { symtab.enterScope(); }, [this]() { symtab.leaveScope(); } );
 			symtab.addFunction( function );
+			auto global = transUnit().global;
 
 			// need to iterate through members in reverse in order for
@@ -1224,6 +1226,6 @@
 
 							static UniqueName memberDtorNamer = { "__memberDtor" };
-							assertf( ast::dtorStruct, "builtin __Destructor not found." );
-							assertf( ast::dtorStructDestroy, "builtin __destroy_Destructor not found." );
+							assertf( global.dtorStruct, "builtin __Destructor not found." );
+							assertf( global.dtorDestroy, "builtin __destroy_Destructor not found." );
 
 							ast::Expr * thisExpr = new ast::CastExpr( new ast::AddressExpr( new ast::VariableExpr(loc, thisParam ) ), new ast::PointerType( new ast::VoidType(), ast::CV::Qualifiers() ) );
@@ -1235,6 +1237,6 @@
 							auto dtorType = new ast::PointerType( dtorFtype );
 
-							auto destructor = new ast::ObjectDecl(loc, memberDtorNamer.newName(), new ast::StructInstType( ast::dtorStruct ), new ast::ListInit(loc, { new ast::SingleInit(loc, thisExpr ), new ast::SingleInit(loc, new ast::CastExpr( dtorExpr, dtorType ) ) } ) );
-							destructor->attributes.push_back( new ast::Attribute( "cleanup", { new ast::VariableExpr( loc, ast::dtorStructDestroy ) } ) );
+							auto destructor = new ast::ObjectDecl(loc, memberDtorNamer.newName(), new ast::StructInstType( global.dtorStruct ), new ast::ListInit(loc, { new ast::SingleInit(loc, thisExpr ), new ast::SingleInit(loc, new ast::CastExpr( dtorExpr, dtorType ) ) } ) );
+							destructor->attributes.push_back( new ast::Attribute( "cleanup", { new ast::VariableExpr( loc, global.dtorDestroy ) } ) );
 							mutStmts->push_front( new ast::DeclStmt(loc, destructor ) );
 							mutStmts->kids.splice( mutStmts->kids.begin(), stmtsToAdd );
@@ -1331,5 +1333,5 @@
 	const ast::Expr * GenStructMemberCalls::postvisit( const ast::UntypedExpr * untypedExpr ) {
 		// xxx - functions returning ast::ptr seems wrong...
-		auto res = ResolvExpr::findVoidExpression( untypedExpr, symtab );
+		auto res = ResolvExpr::findVoidExpression( untypedExpr, { symtab, transUnit().global } );
 		// Fix CodeLocation (at least until resolver is fixed).
 		auto fix = localFillCodeLocations( untypedExpr->location, res.release() );
@@ -1368,5 +1370,5 @@
 
 		// resolve assignment and dispose of new env
-		auto resolved = ResolvExpr::findVoidExpression( assign, symtab );
+		auto resolved = ResolvExpr::findVoidExpression( assign, { symtab, transUnit().global } );
 		auto mut = resolved.get_and_mutate();
 		assertf(resolved.get() == mut, "newly resolved expression must be unique");
