Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision 6e09f211a3f11927060adf4fd6ff5df78060d285)
+++ src/Common/PassVisitor.h	(revision 637568b60bdf24177e836db017d886fcb9ea96ee)
@@ -253,3 +253,55 @@
 }
 
+class WithTypeSubstitution {
+protected:
+	WithTypeSubstitution() = default;
+	~WithTypeSubstitution() = default;
+
+	TypeSubstitution * env;
+
+	template<typename pass_type>
+	friend class PassVisitor< pass_type>;
+};
+
+class WithStmtsToAdd {
+protected:
+	WithStmtsToAdd() = default;
+	~WithStmtsToAdd() = default;
+
+	std::list< Statement* > stmtsToAddBefore;
+	std::list< Statement* > stmtsToAddAfter;
+
+	template<typename pass_type>
+	friend class PassVisitor< pass_type>;
+};
+
+class WithShortCircuiting {
+protected:
+	WithShortCircuiting() = default;
+	~WithShortCircuiting() = default;
+
+	bool skip_children;
+
+	template<typename pass_type>
+	friend class PassVisitor< pass_type>;
+};
+
+class WithScopes {
+protected:
+	WithScopes() = default;
+	~WithScopes() = default;
+
+	at_cleanup_t at_cleanup;
+
+	void GuardValue( T& val ) {
+		at_cleanup( [ val ]( void * newVal ) {
+			* static_cast< T * >( newVal ) = val;
+		}, static_cast< void * >( & val ) );
+	}
+
+	template<typename pass_type>
+	friend class PassVisitor< pass_type>;
+};
+
+
 #include "PassVisitor.impl.h"
