Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision 579263a52ab065d42a5208e15e3d707dd0d03798)
+++ src/Common/PassVisitor.h	(revision ad0be81733371b9a8190b6b92c4a8457cf5f4801)
@@ -257,15 +257,4 @@
 
 	void set_visit_children( bool& ref ) { bool_ref * ptr = visit_children_impl(pass, 0); if(ptr) ptr->set( ref ); }
-
-	guard_value_impl init_guard() {
-		guard_value_impl guard;
-		auto at_cleanup = at_cleanup_impl(pass, 0);
-		if( at_cleanup ) {
-			*at_cleanup = [&guard]( cleanup_func_t && func, void* val ) {
-				guard.push( std::move( func ), val );
-			};
-		}
-		return guard;
-	}
 };
 
Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision 579263a52ab065d42a5208e15e3d707dd0d03798)
+++ src/Common/PassVisitor.impl.h	(revision ad0be81733371b9a8190b6b92c4a8457cf5f4801)
@@ -3,5 +3,5 @@
 #define VISIT_START( node )                     \
 	__attribute__((unused))                   \
-	const auto & guard = init_guard();        \
+	guard_value_impl guard( at_cleanup_impl(pass, 0) );       \
 	bool visit_children = true;               \
 	set_visit_children( visit_children );	\
@@ -15,5 +15,5 @@
 #define MUTATE_START( node )                    \
 	__attribute__((unused))                   \
-	const auto & guard = init_guard();        \
+	guard_value_impl guard( at_cleanup_impl(pass, 0) );       \
 	bool visit_children = true;               \
 	set_visit_children( visit_children );	\
Index: src/Common/PassVisitor.proto.h
===================================================================
--- src/Common/PassVisitor.proto.h	(revision 579263a52ab065d42a5208e15e3d707dd0d03798)
+++ src/Common/PassVisitor.proto.h	(revision ad0be81733371b9a8190b6b92c4a8457cf5f4801)
@@ -5,8 +5,15 @@
 
 typedef std::function<void( void * )> cleanup_func_t;
+typedef std::function< void( cleanup_func_t, void * ) > at_cleanup_t;
 
 class guard_value_impl {
 public:
-	guard_value_impl() = default;
+	guard_value_impl( at_cleanup_t * at_cleanup ) {
+		if( at_cleanup ) {
+			*at_cleanup = [this]( cleanup_func_t && func, void* val ) {
+				push( std::move( func ), val );
+			};
+		}
+	}
 
 	~guard_value_impl() {
@@ -33,5 +40,4 @@
 };
 
-typedef std::function< void( cleanup_func_t, void * ) > at_cleanup_t;
 
 class bool_ref {
