Index: src/GenPoly/CopyParams.cc
===================================================================
--- src/GenPoly/CopyParams.cc	(revision effdde00071d909bdd934dea8c45aade4b2b8a5c)
+++ src/GenPoly/CopyParams.cc	(revision 582ee2851d02bc30a951c8b62bf2576587e3ad25)
@@ -53,6 +53,6 @@
 
 	void CopyParams::visit( FunctionDecl *funcDecl ) {
-		if ( funcDecl->get_statements() ) {
-			funcDecl->get_statements()->accept( *this );
+		if ( funcDecl->statements ) {
+			funcDecl->statements->accept( *this );
 
 			if ( ! modVars.empty() ) {
@@ -60,17 +60,17 @@
 				// xxx - this needs to use constructors, not assignment operators
 				// assume the assignment operator is the first assert param after any "type" parameter
-				for ( Type::ForallList::const_iterator tyVar = funcDecl->get_functionType()->get_forall().begin(); tyVar != funcDecl->get_functionType()->get_forall().end(); ++tyVar ) {
+				for ( Type::ForallList::const_iterator tyVar = funcDecl->type->forall.begin(); tyVar != funcDecl->type->forall.end(); ++tyVar ) {
 					if ( (*tyVar)->get_kind() == TypeDecl::Any ) {
-						assert( !(*tyVar)->get_assertions().empty() );
-						assert( (*tyVar)->get_assertions().front()->get_name() == "?=?" );
-						assignOps[ (*tyVar)->get_name() ] = (*tyVar)->get_assertions().front();
+						assert( !(*tyVar)->assertions.empty() );
+						assert( (*tyVar)->assertions.front()->name == "?=?" );
+						assignOps[ (*tyVar)->name ] = (*tyVar)->assertions.front();
 					} // if
 				} // for
-				for ( std::list< DeclarationWithType* >::iterator param = funcDecl->get_functionType()->get_parameters().begin(); param != funcDecl->get_functionType()->get_parameters().end(); ++param ) {
+				for ( std::list< DeclarationWithType* >::iterator param = funcDecl->type->parameters.begin(); param != funcDecl->type->parameters.end(); ++param ) {
 					std::set< UniqueId >::const_iterator var = modVars.find( (*param)->get_uniqueId() );
 					if ( var != modVars.end() ) {
 						TypeInstType *typeInst = dynamic_cast< TypeInstType* >( (*param)->get_type() );
-						assert( typeInst );
-						std::map< std::string, DeclarationWithType* >::const_iterator assignOp = assignOps.find( typeInst->get_name() );
+						assertf( typeInst, "Found in modVars for function %s: unique id: %u, %s", funcDecl->name.c_str(), (*param)->get_uniqueId(), toString( *param ).c_str() );
+						std::map< std::string, DeclarationWithType* >::const_iterator assignOp = assignOps.find( typeInst->name );
 						if ( assignOp != assignOps.end() ) {
 							DeclarationWithType *oldParam = *param;
@@ -78,8 +78,8 @@
 							(*param)->set_mangleName( namer.newName( (*param)->get_mangleName() ) );
 							ApplicationExpr *assign = new ApplicationExpr( new VariableExpr( assignOp->second ) );
-							assign->get_args().push_back( new VariableExpr( oldParam ) );
-							assign->get_args().push_back( new VariableExpr( *param ) );
-							funcDecl->get_statements()->get_kids().push_front( new ExprStmt( noLabels, assign ) );
-							funcDecl->get_statements()->get_kids().push_front( new DeclStmt( noLabels, oldParam ) );
+							assign->args.push_back( new VariableExpr( oldParam ) );
+							assign->args.push_back( new VariableExpr( *param ) );
+							funcDecl->statements->push_front( new ExprStmt( noLabels, assign ) );
+							funcDecl->statements->push_front( new DeclStmt( noLabels, oldParam ) );
 						} // if
 						modVars.erase( var );
@@ -97,7 +97,9 @@
 	// every parameter of TypeInstType* when visiting the FunctionDecl.
 	void CopyParams::visit( AddressExpr *addrExpr ) {
-		if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( addrExpr->get_arg() ) ) {
-			if ( dynamic_cast< TypeInstType* >( varExpr->get_var()->get_type() ) ) {
-				modVars.insert( varExpr->get_var()->get_uniqueId() );
+		if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( addrExpr->arg ) ) {
+			if ( dynamic_cast< TypeInstType* >( varExpr->var->get_type() ) ) {
+				assertf( varExpr->var->get_uniqueId(), "Address-taken variable does not have a unique ID: %s", toString( varExpr->var ).c_str() );
+				modVars.insert( varExpr->var->get_uniqueId() );
+				std::cerr << "added unique id: " << varExpr->var->get_uniqueId() << " var: " << varExpr->var << std::endl;
 			} // if
 		} // if
