Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision ebbe941350858b50ae5e998786be35c57934643e)
+++ src/GenPoly/Box.cc	(revision df9e4121ae2dc577aeae7d6885da02ca3730f237)
@@ -72,10 +72,11 @@
 		};
 
+		/// Updates the call sites of polymorphic functions.
 		/// Replaces polymorphic return types with out-parameters,
 		/// replaces calls to polymorphic functions with adapter calls,
 		/// and adds appropriate type variables to the function call.
-		class Pass1 final : public BoxPass, public WithConstTypeSubstitution, public WithStmtsToAdd, public WithGuards, public WithVisitorRef<Pass1>, public WithShortCircuiting {
+		class CallAdapter final : public BoxPass, public WithConstTypeSubstitution, public WithStmtsToAdd, public WithGuards, public WithVisitorRef<CallAdapter>, public WithShortCircuiting {
 		  public:
-			Pass1();
+			CallAdapter();
 
 			void premutate( FunctionDecl * functionDecl );
@@ -138,7 +139,8 @@
 		};
 
+		/// Updates declarations (and types) that require adapters.
 		/// * Moves polymorphic returns in function types to pointer-type parameters
 		/// * adds type size and assertion parameters to parameter lists
-		struct Pass2 final : public BoxPass, public WithGuards {
+		struct DeclAdapter final : public BoxPass, public WithGuards {
 			void handleAggDecl();
 
@@ -210,9 +212,10 @@
 		};
 
+		/// Erases unneeded/unwanted polymorphic information.
 		/// Replaces initialization of polymorphic values with alloca,
 		/// declaration of dtype/ftype with appropriate void expression,
 		/// sizeof expressions of polymorphic types with the proper variable,
 		/// and strips fields from generic struct declarations.
-		struct Pass3 final {
+		struct Eraser final {
 			void premutate( ObjectDecl * objectDecl );
 			void premutate( FunctionDecl * functionDecl );
@@ -225,17 +228,17 @@
 	void box( std::list< Declaration *>& translationUnit ) {
 		PassVisitor<LayoutFunctionBuilder> layoutBuilder;
-		PassVisitor<Pass1> pass1;
-		PassVisitor<Pass2> pass2;
+		PassVisitor<CallAdapter> callAdapter;
+		PassVisitor<DeclAdapter> declAdapter;
 		PassVisitor<PolyGenericCalculator> polyCalculator;
-		PassVisitor<Pass3> pass3;
+		PassVisitor<Eraser> eraser;
 
 		acceptAll( translationUnit, layoutBuilder );
-		mutateAll( translationUnit, pass1 );
-		mutateAll( translationUnit, pass2 );
+		mutateAll( translationUnit, callAdapter );
+		mutateAll( translationUnit, declAdapter );
 		mutateAll( translationUnit, polyCalculator );
-		mutateAll( translationUnit, pass3 );
+		mutateAll( translationUnit, eraser );
 	}
 
-	////////////////////////////////// LayoutFunctionBuilder ////////////////////////////////////////////
+////////////////////////////////// LayoutFunctionBuilder ////////////////////////////////////////
 
 	/// Get a list of type declarations that will affect a layout function
@@ -417,5 +420,5 @@
 	}
 
-	////////////////////////////////////////// Pass1 ////////////////////////////////////////////////////
+////////////////////////////////////////////// CallAdapter //////////////////////////////////////
 
 	namespace {
@@ -459,7 +462,7 @@
 		Type *replaceWithConcrete( Type *type, TypeSubstitution const * env, bool doClone = true );
 
-		Pass1::Pass1() : tempNamer( "_temp" ) {}
-
-		void Pass1::premutate( FunctionDecl *functionDecl ) {
+		CallAdapter::CallAdapter() : tempNamer( "_temp" ) {}
+
+		void CallAdapter::premutate( FunctionDecl *functionDecl ) {
 			if ( functionDecl->get_statements() ) {		// empty routine body ?
 				// std::cerr << "mutating function: " << functionDecl->get_mangleName() << std::endl;
@@ -503,9 +506,9 @@
 		}
 
-		void Pass1::premutate( TypeDecl *typeDecl ) {
+		void CallAdapter::premutate( TypeDecl *typeDecl ) {
 			addToTyVarMap( typeDecl, scopeTyVars );
 		}
 
-		void Pass1::premutate( CommaExpr *commaExpr ) {
+		void CallAdapter::premutate( CommaExpr *commaExpr ) {
 			// Attempting to find application expressions that were mutated by the copy constructor passes
 			// to use an explicit return variable, so that the variable can be reused as a parameter to the
@@ -525,5 +528,5 @@
 		}
 
-		std::list< Expression *>::iterator Pass1::passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes ) {
+		std::list< Expression *>::iterator CallAdapter::passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes ) {
 			Type *polyType = isPolyType( parmType, exprTyVars );
 			if ( polyType && ! dynamic_cast< TypeInstType* >( polyType ) ) {
@@ -552,5 +555,5 @@
 		}
 
-		std::list< Expression *>::iterator Pass1::passTypeVars( ApplicationExpr *appExpr, Type *polyRetType, const TyVarMap &exprTyVars ) {
+		std::list< Expression *>::iterator CallAdapter::passTypeVars( ApplicationExpr *appExpr, Type *polyRetType, const TyVarMap &exprTyVars ) {
 			assert( env );
 			std::list< Expression *>::iterator arg = appExpr->args.begin();
@@ -605,5 +608,5 @@
 		}
 
-		ObjectDecl *Pass1::makeTemporary( Type *type ) {
+		ObjectDecl *CallAdapter::makeTemporary( Type *type ) {
 			ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, type, 0 );
 			stmtsToAddBefore.push_back( new DeclStmt( newObj ) );
@@ -611,5 +614,5 @@
 		}
 
-		Expression *Pass1::addRetParam( ApplicationExpr *appExpr, Type *retType ) {
+		Expression *CallAdapter::addRetParam( ApplicationExpr *appExpr, Type *retType ) {
 			// Create temporary to hold return value of polymorphic function and produce that temporary as a result
 			// using a comma expression.
@@ -674,5 +677,5 @@
 		}
 
-		Expression *Pass1::addDynRetParam( ApplicationExpr *appExpr, Type *dynType ) {
+		Expression *CallAdapter::addDynRetParam( ApplicationExpr *appExpr, Type *dynType ) {
 			Type *concrete = replaceWithConcrete( dynType, env );
 			// add out-parameter for return value
@@ -680,5 +683,5 @@
 		}
 
-		Expression *Pass1::applyAdapter( ApplicationExpr *appExpr, FunctionType *function ) {
+		Expression *CallAdapter::applyAdapter( ApplicationExpr *appExpr, FunctionType *function ) {
 			Expression *ret = appExpr;
 			if ( isDynRet( function, scopeTyVars ) ) {
@@ -729,5 +732,5 @@
 		}
 
-		void Pass1::boxParam( Expression *&arg, Type *param, const TyVarMap &exprTyVars ) {
+		void CallAdapter::boxParam( Expression *&arg, Type *param, const TyVarMap &exprTyVars ) {
 			assertf( arg->result, "arg does not have result: %s", toString( arg ).c_str() );
 			addCast( arg, param, exprTyVars );
@@ -764,5 +767,5 @@
 		}
 
-		void Pass1::boxParams( ApplicationExpr *appExpr, std::list< Expression *>::iterator arg, FunctionType *function, const TyVarMap &exprTyVars ) {
+		void CallAdapter::boxParams( ApplicationExpr *appExpr, std::list< Expression *>::iterator arg, FunctionType *function, const TyVarMap &exprTyVars ) {
 			for ( DeclarationWithType * param : function->parameters ) {
 				assertf( arg != appExpr->args.end(), "boxParams: missing argument for param %s to %s in %s", toString( param ).c_str(), toString( function ).c_str(), toString( appExpr ).c_str() );
@@ -772,5 +775,5 @@
 		}
 
-		void Pass1::addInferredParams( ApplicationExpr *appExpr, std::list< Expression *>::iterator arg, FunctionType *functionType, const TyVarMap &tyVars ) {
+		void CallAdapter::addInferredParams( ApplicationExpr *appExpr, std::list< Expression *>::iterator arg, FunctionType *functionType, const TyVarMap &tyVars ) {
 			for ( TypeDecl * const tyVar : functionType->forall ) {
 				for ( DeclarationWithType * const assert : tyVar->assertions ) {
@@ -840,5 +843,5 @@
 		}
 
-		FunctionDecl *Pass1::makeAdapter( FunctionType const *adaptee, FunctionType *realType, const std::string &mangleName, const TyVarMap &tyVars ) {
+		FunctionDecl *CallAdapter::makeAdapter( FunctionType const *adaptee, FunctionType *realType, const std::string &mangleName, const TyVarMap &tyVars ) {
 			FunctionType *adapterType = makeAdapterType( adaptee, tyVars );
 			adapterType = ScrubTyVars::scrub( adapterType, tyVars );
@@ -900,5 +903,5 @@
 		}
 
-		void Pass1::passAdapters( ApplicationExpr * appExpr, FunctionType * functionType, const TyVarMap & exprTyVars ) {
+		void CallAdapter::passAdapters( ApplicationExpr * appExpr, FunctionType * functionType, const TyVarMap & exprTyVars ) {
 			// collect a list of function types passed as parameters or implicit parameters (assertions)
 			std::list<FunctionType const *> functions;
@@ -968,5 +971,5 @@
 		}
 
-		Expression *Pass1::handleIntrinsics( ApplicationExpr *appExpr ) {
+		Expression *CallAdapter::handleIntrinsics( ApplicationExpr *appExpr ) {
 			if ( VariableExpr *varExpr = dynamic_cast< VariableExpr *>( appExpr->function ) ) {
 				if ( varExpr->var->linkage == LinkageSpec::Intrinsic ) {
@@ -1091,5 +1094,5 @@
 		}
 
-		Expression *Pass1::postmutate( ApplicationExpr *appExpr ) {
+		Expression *CallAdapter::postmutate( ApplicationExpr *appExpr ) {
 			// std::cerr << "mutate appExpr: " << InitTweak::getFunctionName( appExpr ) << std::endl;
 			// for ( auto tyVar : scopeTyVars ) {
@@ -1163,5 +1166,5 @@
 		}
 
-		Expression * Pass1::postmutate( UntypedExpr *expr ) {
+		Expression * CallAdapter::postmutate( UntypedExpr *expr ) {
 			if ( isPolyDeref( expr, scopeTyVars, env ) ) {
 				Expression *ret = expr->args.front();
@@ -1173,7 +1176,7 @@
 		}
 
-		void Pass1::premutate( AddressExpr * ) { visit_children = false; }
-
-		Expression * Pass1::postmutate( AddressExpr * addrExpr ) {
+		void CallAdapter::premutate( AddressExpr * ) { visit_children = false; }
+
+		Expression * CallAdapter::postmutate( AddressExpr * addrExpr ) {
 			assert( addrExpr->arg->result && ! addrExpr->arg->result->isVoid() );
 
@@ -1206,5 +1209,5 @@
 		}
 
-		void Pass1::premutate( ReturnStmt *returnStmt ) {
+		void CallAdapter::premutate( ReturnStmt *returnStmt ) {
 			if ( retval && returnStmt->expr ) {
 				assert( returnStmt->expr->result && ! returnStmt->expr->result->isVoid() );
@@ -1214,25 +1217,25 @@
 		}
 
-		void Pass1::premutate( PointerType *pointerType ) {
+		void CallAdapter::premutate( PointerType *pointerType ) {
 			GuardScope( scopeTyVars );
 			makeTyVarMap( pointerType, scopeTyVars );
 		}
 
-		void Pass1::premutate( FunctionType *functionType ) {
+		void CallAdapter::premutate( FunctionType *functionType ) {
 			GuardScope( scopeTyVars );
 			makeTyVarMap( functionType, scopeTyVars );
 		}
 
-		void Pass1::beginScope() {
+		void CallAdapter::beginScope() {
 			adapters.beginScope();
 		}
 
-		void Pass1::endScope() {
+		void CallAdapter::endScope() {
 			adapters.endScope();
 		}
 
-////////////////////////////////////////// Pass2 ////////////////////////////////////////////////////
-
-		void Pass2::addAdapters( FunctionType *functionType ) {
+////////////////////////////////////////// DeclAdapter //////////////////////////////////////////
+
+		void DeclAdapter::addAdapters( FunctionType *functionType ) {
 			std::list< FunctionType const *> functions;
 			for ( DeclarationWithType * const arg : functionType->parameters ) {
@@ -1254,5 +1257,5 @@
 		}
 
-		DeclarationWithType * Pass2::postmutate( FunctionDecl *functionDecl ) {
+		DeclarationWithType * DeclAdapter::postmutate( FunctionDecl *functionDecl ) {
 			FunctionType * ftype = functionDecl->type;
 			if ( ! ftype->returnVals.empty() && functionDecl->statements ) {
@@ -1279,29 +1282,29 @@
 		}
 
-		void Pass2::premutate( StructDecl * ) {
+		void DeclAdapter::premutate( StructDecl * ) {
 			// prevent tyVars from leaking into containing scope
 			GuardScope( scopeTyVars );
 		}
 
-		void Pass2::premutate( UnionDecl * ) {
+		void DeclAdapter::premutate( UnionDecl * ) {
 			// prevent tyVars from leaking into containing scope
 			GuardScope( scopeTyVars );
 		}
 
-		void Pass2::premutate( TraitDecl * ) {
+		void DeclAdapter::premutate( TraitDecl * ) {
 			// prevent tyVars from leaking into containing scope
 			GuardScope( scopeTyVars );
 		}
 
-		void Pass2::premutate( TypeDecl *typeDecl ) {
+		void DeclAdapter::premutate( TypeDecl *typeDecl ) {
 			addToTyVarMap( typeDecl, scopeTyVars );
 		}
 
-		void Pass2::premutate( PointerType *pointerType ) {
+		void DeclAdapter::premutate( PointerType *pointerType ) {
 			GuardScope( scopeTyVars );
 			makeTyVarMap( pointerType, scopeTyVars );
 		}
 
-		void Pass2::premutate( FunctionType *funcType ) {
+		void DeclAdapter::premutate( FunctionType *funcType ) {
 			GuardScope( scopeTyVars );
 			makeTyVarMap( funcType, scopeTyVars );
@@ -1387,5 +1390,5 @@
 		}
 
-////////////////////////////////////////// PolyGenericCalculator ////////////////////////////////////////////////////
+////////////////////////////////////////// PolyGenericCalculator ////////////////////////////////
 
 		PolyGenericCalculator::PolyGenericCalculator()
@@ -1468,5 +1471,5 @@
 			// make sure that any type information passed into the function is accounted for
 			for ( DeclarationWithType * const fnParam : funcType->get_parameters() ) {
-				// condition here duplicates that in Pass2::mutate( FunctionType* )
+				// condition here duplicates that in DeclAdapter::mutate( FunctionType* )
 				Type *polyType = isPolyType( fnParam->get_type(), scopeTyVars );
 				if ( polyType && ! dynamic_cast< TypeInstType* >( polyType ) ) {
@@ -1878,15 +1881,15 @@
 		}
 
-////////////////////////////////////////// Pass3 ////////////////////////////////////////////////////
-
-		void Pass3::premutate( ObjectDecl * objectDecl ) {
+////////////////////////////////////////// Eraser ///////////////////////////////////////////////
+
+		void Eraser::premutate( ObjectDecl * objectDecl ) {
 			ScrubTyVars::scrubAll( objectDecl );
 		}
 
-		void Pass3::premutate( FunctionDecl * functionDecl ) {
+		void Eraser::premutate( FunctionDecl * functionDecl ) {
 			ScrubTyVars::scrubAll( functionDecl );
 		}
 
-		void Pass3::premutate( TypedefDecl * typedefDecl ) {
+		void Eraser::premutate( TypedefDecl * typedefDecl ) {
 			ScrubTyVars::scrubAll( typedefDecl );
 		}
@@ -1897,9 +1900,9 @@
 		}
 
-		void Pass3::premutate( StructDecl * structDecl ) {
+		void Eraser::premutate( StructDecl * structDecl ) {
 			stripGenericMembers( structDecl );
 		}
 
-		void Pass3::premutate( UnionDecl * unionDecl ) {
+		void Eraser::premutate( UnionDecl * unionDecl ) {
 			stripGenericMembers( unionDecl );
 		}
Index: sts/concurrent/pthread/.expect/bounded_buffer.txt
===================================================================
--- tests/concurrent/pthread/.expect/bounded_buffer.txt	(revision ebbe941350858b50ae5e998786be35c57934643e)
+++ 	(revision )
@@ -1,2 +1,0 @@
-producer total value is 24150
-consumer total value is 24150
Index: tests/concurrent/pthread/.expect/bounded_buffer.x64.txt
===================================================================
--- tests/concurrent/pthread/.expect/bounded_buffer.x64.txt	(revision df9e4121ae2dc577aeae7d6885da02ca3730f237)
+++ tests/concurrent/pthread/.expect/bounded_buffer.x64.txt	(revision df9e4121ae2dc577aeae7d6885da02ca3730f237)
@@ -0,0 +1,2 @@
+producer total value is 24150
+consumer total value is 24150
Index: tests/concurrent/pthread/.expect/bounded_buffer.x86.txt
===================================================================
--- tests/concurrent/pthread/.expect/bounded_buffer.x86.txt	(revision df9e4121ae2dc577aeae7d6885da02ca3730f237)
+++ tests/concurrent/pthread/.expect/bounded_buffer.x86.txt	(revision df9e4121ae2dc577aeae7d6885da02ca3730f237)
@@ -0,0 +1,2 @@
+producer total value is 5940
+consumer total value is 5940
