Index: src/ControlStruct/HoistControlDecls.cpp
===================================================================
--- src/ControlStruct/HoistControlDecls.cpp	(revision 3a4732fc2d0558827a90fe9605763e2a13fe5d63)
+++ src/ControlStruct/HoistControlDecls.cpp	(revision 45040b6143abea5e9be5959e198f1b8e8d8d37c8)
@@ -9,7 +9,7 @@
 // Author           : Andrew Beach
 // Created On       : Fri Dec  3 15:34:00 2021
-// Last Modified By : Andrew Beach
-// Last Modified On : Fri Dec  3 15:34:00 2021
-// Update Count     : 0
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Jan 31 18:52:35 2022
+// Update Count     : 23
 //
 
@@ -19,44 +19,62 @@
 #include "AST/Pass.hpp"
 #include "AST/TranslationUnit.hpp"
+using namespace ast;
 
 namespace ControlStruct {
 
-namespace {
+template<typename StmtT>
+const Stmt * hoist( const StmtT * stmt ) {
+	// If no hoisting is needed, then make no changes.
 
-template<typename StmtT>
-const ast::Stmt * hoist( const StmtT * stmt ) {
-	// If no hoisting is needed, then make no changes.
-	if ( 0 == stmt->inits.size() ) {
+	if ( stmt->inits.size() == 0 ) {					// no declarations ?
+		// if ( /* no conditional declarations */ ...  ) ...
 		return stmt;
-	}
+	} // if
 
-	// Put initializers and the old statement in the compound statement.
-	ast::CompoundStmt * block = new ast::CompoundStmt( stmt->location );
-	StmtT * mutStmt = ast::mutate( stmt );
-	for ( const ast::Stmt * next : mutStmt->inits ) {
+	// Put hoist declarations and modified statement in a compound statement.
+
+	CompoundStmt * block = new CompoundStmt( stmt->location ); // create empty compound statement
+	//    {
+	//    }
+
+	for ( const Stmt * next : stmt->inits ) {			// link conditional declarations into compound
 		block->kids.push_back( next );
 	}
-	mutStmt->inits.clear();
-	block->kids.push_back( mutStmt );
+	//    if ( int x = f(), y = g(); ... ) ...
+	// link declarations into compound statement
+	//    {
+	//         int x = f();
+	//         int y = g();
+	//    }
+
+	StmtT * mutStmt = mutate( stmt );					// create mutate handle to change statement
+	mutStmt->inits.clear();								// remove declarations
+	//    if ( ... ) ...
+
+	block->kids.push_back( mutStmt );					// link modified statement into compound
+	//    {
+	//        int x = f();
+	//        int y = g();
+	//        if ( ... ) ...
+	//    }
 	return block;
 }
 
-struct HoistControlCore {
-	const ast::Stmt * postvisit( const ast::IfStmt * stmt ) {
-		return hoist<ast::IfStmt>( stmt );
+struct hoistControlDeclsCore {
+	// Statements with declarations in conditional.
+	const Stmt * postvisit( const IfStmt * stmt ) {
+		return hoist<IfStmt>( stmt );
 	}
-	const ast::Stmt * postvisit( const ast::ForStmt * stmt ) {
-		return hoist<ast::ForStmt>( stmt );
+	const Stmt * postvisit( const ForStmt * stmt ) {
+		return hoist<ForStmt>( stmt );
 	}
-	const ast::Stmt * postvisit( const ast::WhileStmt * stmt ) {
-		return hoist<ast::WhileStmt>( stmt );
+	const Stmt * postvisit( const WhileStmt * stmt ) {
+		return hoist<WhileStmt>( stmt );
 	}
 };
 
-} // namespace
-
-/// Hoist initialization out of for statements.
-void hoistControlDecls( ast::TranslationUnit & translationUnit ) {
-	ast::Pass<HoistControlCore>::run( translationUnit );
+// Hoist initialization out of for statements.
+void hoistControlDecls( TranslationUnit & translationUnit ) {
+	Pass<hoistControlDeclsCore>::run( translationUnit );
 }
 
Index: src/ControlStruct/HoistControlDecls.hpp
===================================================================
--- src/ControlStruct/HoistControlDecls.hpp	(revision 3a4732fc2d0558827a90fe9605763e2a13fe5d63)
+++ src/ControlStruct/HoistControlDecls.hpp	(revision 45040b6143abea5e9be5959e198f1b8e8d8d37c8)
@@ -9,7 +9,7 @@
 // Author           : Andrew Beach
 // Created On       : Fri Dec  3 15:31:00 2021
-// Last Modified By : Andrew Beach
-// Last Modified On : Fri Dec  3 15:31:00 2021
-// Update Count     : 0
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Jan 31 22:25:07 2022
+// Update Count     : 3
 //
 
@@ -17,12 +17,10 @@
 
 namespace ast {
-	class TranslationUnit;
+class TranslationUnit;
 }
 
 namespace ControlStruct {
-
-/// Hoist initialization out of control flow statements.
+// Hoist declarations out of control flow statements into compound statement.
 void hoistControlDecls( ast::TranslationUnit & translationUnit );
-
 } // namespace ControlStruct
 
