Index: src/InitTweak/FixGlobalInit.cc
===================================================================
--- src/InitTweak/FixGlobalInit.cc	(revision fd236ed4157df27ec024f8383f9f7ce8254ae142)
+++ src/InitTweak/FixGlobalInit.cc	(revision 1cb934d650adf089eb2786865a4e27013e6c42e5)
@@ -20,4 +20,5 @@
 #include <algorithm>               // for replace_if
 
+#include "Common/PassVisitor.h"
 #include "Common/SemanticError.h"  // for SemanticError
 #include "Common/UniqueName.h"     // for UniqueName
@@ -35,15 +36,15 @@
 
 namespace InitTweak {
-	class GlobalFixer : public Visitor {
+	class GlobalFixer : public WithShortCircuiting {
 	  public:
 		GlobalFixer( const std::string & name, bool inLibrary );
 
-		virtual void visit( ObjectDecl *objDecl );
-		virtual void visit( FunctionDecl *functionDecl );
-		virtual void visit( StructDecl *aggregateDecl );
-		virtual void visit( UnionDecl *aggregateDecl );
-		virtual void visit( EnumDecl *aggregateDecl );
-		virtual void visit( TraitDecl *aggregateDecl );
-		virtual void visit( TypeDecl *typeDecl );
+		void previsit( ObjectDecl *objDecl );
+		void previsit( FunctionDecl *functionDecl );
+		void previsit( StructDecl *aggregateDecl );
+		void previsit( UnionDecl *aggregateDecl );
+		void previsit( EnumDecl *aggregateDecl );
+		void previsit( TraitDecl *aggregateDecl );
+		void previsit( TypeDecl *typeDecl );
 
 		UniqueName tempNamer;
@@ -53,6 +54,7 @@
 
 	void fixGlobalInit( std::list< Declaration * > & translationUnit, const std::string & name, bool inLibrary ) {
-		GlobalFixer fixer( name, inLibrary );
-		acceptAll( translationUnit, fixer );
+		PassVisitor<GlobalFixer> visitor( name, inLibrary );
+		acceptAll( translationUnit, visitor );
+		GlobalFixer & fixer = visitor.pass;
 		// don't need to include function if it's empty
 		if ( fixer.initFunction->get_statements()->get_kids().empty() ) {
@@ -98,5 +100,5 @@
 	}
 
-	void GlobalFixer::visit( ObjectDecl *objDecl ) {
+	void GlobalFixer::previsit( ObjectDecl *objDecl ) {
 		std::list< Statement * > & initStatements = initFunction->get_statements()->get_kids();
 		std::list< Statement * > & destroyStatements = destroyFunction->get_statements()->get_kids();
@@ -134,10 +136,10 @@
 
 	// only modify global variables
-	void GlobalFixer::visit( __attribute__((unused)) FunctionDecl *functionDecl ) {}
-	void GlobalFixer::visit( __attribute__((unused)) StructDecl *aggregateDecl ) {}
-	void GlobalFixer::visit( __attribute__((unused)) UnionDecl *aggregateDecl ) {}
-	void GlobalFixer::visit( __attribute__((unused)) EnumDecl *aggregateDecl ) {}
-	void GlobalFixer::visit( __attribute__((unused)) TraitDecl *aggregateDecl ) {}
-	void GlobalFixer::visit( __attribute__((unused)) TypeDecl *typeDecl ) {}
+	void GlobalFixer::previsit( FunctionDecl * ) { visit_children = false; }
+	void GlobalFixer::previsit( StructDecl * ) { visit_children = false; }
+	void GlobalFixer::previsit( UnionDecl * ) { visit_children = false; }
+	void GlobalFixer::previsit( EnumDecl * ) { visit_children = false; }
+	void GlobalFixer::previsit( TraitDecl * ) { visit_children = false; }
+	void GlobalFixer::previsit( TypeDecl * ) { visit_children = false; }
 
 } // namespace InitTweak
