Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 5e92feed72740551b66e8ea1388e58acc8148be4)
+++ src/GenPoly/Box.cc	(revision 78dd0da46b655b629d14117130a2cf1ecf113a4c)
@@ -640,5 +640,5 @@
 		}
 
-		Expression *makeIncrDecrExpr( ApplicationExpr *appExpr, std::string polyName, bool isIncr ) {
+		Expression *makeIncrDecrExpr( ApplicationExpr *appExpr, Type *polyType, bool isIncr ) {
 			NameExpr *opExpr;
 			if ( isIncr ) {
@@ -653,5 +653,5 @@
 				addAssign->get_args().push_back( appExpr->get_args().front() );
 			} // if
-			addAssign->get_args().push_back( new NameExpr( std::string("_sizeof_") + polyName ) );
+			addAssign->get_args().push_back( new NameExpr( sizeofName( polyType ) ) );
 			addAssign->get_results().front() = appExpr->get_results().front()->clone();
 			if ( appExpr->get_env() ) {
@@ -680,5 +680,5 @@
 							UntypedExpr *multiply = new UntypedExpr( new NameExpr( "?*?" ) );
 							multiply->get_args().push_back( appExpr->get_args().back() );
-							multiply->get_args().push_back( new NameExpr( std::string("_sizeof_") + typeInst1->get_name() ) );
+							multiply->get_args().push_back( new NameExpr( sizeofName( typeInst1 ) ) );
 							ret->get_args().push_back( appExpr->get_args().front() );
 							ret->get_args().push_back( multiply );
@@ -686,5 +686,5 @@
 							UntypedExpr *multiply = new UntypedExpr( new NameExpr( "?*?" ) );
 							multiply->get_args().push_back( appExpr->get_args().front() );
-							multiply->get_args().push_back( new NameExpr( std::string("_sizeof_") + typeInst2->get_name() ) );
+							multiply->get_args().push_back( new NameExpr( sizeofName( typeInst2 ) ) );
 							ret->get_args().push_back( multiply );
 							ret->get_args().push_back( appExpr->get_args().back() );
@@ -732,5 +732,5 @@
 								assignExpr->get_args().push_back( appExpr->get_args().front()->clone() );
 							} // if
-							CommaExpr *firstComma = new CommaExpr( assignExpr, makeIncrDecrExpr( appExpr, typeInst->get_name(), varExpr->get_var()->get_name() == "?++" ) );
+							CommaExpr *firstComma = new CommaExpr( assignExpr, makeIncrDecrExpr( appExpr, typeInst, varExpr->get_var()->get_name() == "?++" ) );
 							return new CommaExpr( firstComma, tempExpr );
 						} // if
@@ -739,5 +739,5 @@
 						assert( appExpr->get_args().size() == 1 );
 						if ( TypeInstType *typeInst = isPolyPtr( appExpr->get_results().front(), env, scopeTyVars ) ) {
-							return makeIncrDecrExpr( appExpr, typeInst->get_name(), varExpr->get_var()->get_name() == "++?" );
+							return makeIncrDecrExpr( appExpr, typeInst, varExpr->get_var()->get_name() == "++?" );
 						} // if
 					} else if ( varExpr->get_var()->get_name() == "?+?" || varExpr->get_var()->get_name() == "?-?" ) {
@@ -749,5 +749,5 @@
 							UntypedExpr *divide = new UntypedExpr( new NameExpr( "?/?" ) );
 							divide->get_args().push_back( appExpr );
-							divide->get_args().push_back( new NameExpr( std::string("_sizeof_") + typeInst1->get_name() ) );
+							divide->get_args().push_back( new NameExpr( sizeofName( typeInst1 ) ) );
 							divide->get_results().push_front( appExpr->get_results().front()->clone() );
 							if ( appExpr->get_env() ) {
@@ -759,10 +759,10 @@
 							UntypedExpr *multiply = new UntypedExpr( new NameExpr( "?*?" ) );
 							multiply->get_args().push_back( appExpr->get_args().back() );
-							multiply->get_args().push_back( new NameExpr( std::string("_sizeof_") + typeInst1->get_name() ) );
+							multiply->get_args().push_back( new NameExpr( sizeofName( typeInst1 ) ) );
 							appExpr->get_args().back() = multiply;
 						} else if ( typeInst2 ) {
 							UntypedExpr *multiply = new UntypedExpr( new NameExpr( "?*?" ) );
 							multiply->get_args().push_back( appExpr->get_args().front() );
-							multiply->get_args().push_back( new NameExpr( std::string("_sizeof_") + typeInst2->get_name() ) );
+							multiply->get_args().push_back( new NameExpr( sizeofName( typeInst2 ) ) );
 							appExpr->get_args().front() = multiply;
 						} // if
@@ -774,5 +774,5 @@
 							UntypedExpr *multiply = new UntypedExpr( new NameExpr( "?*?" ) );
 							multiply->get_args().push_back( appExpr->get_args().back() );
-							multiply->get_args().push_back( new NameExpr( std::string("_sizeof_") + typeInst->get_name() ) );
+							multiply->get_args().push_back( new NameExpr( sizeofName( typeInst ) ) );
 							appExpr->get_args().back() = multiply;
 						} // if
@@ -1009,5 +1009,5 @@
 			std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin();
 			std::list< DeclarationWithType *> inferredParams;
-			ObjectDecl *newObj = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
+			ObjectDecl newObj( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
 //   ObjectDecl *newFunPtr = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 );
 			for ( std::list< TypeDecl *>::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) {
@@ -1015,10 +1015,13 @@
 				// add all size and alignment parameters to parameter list
 				if ( (*tyParm)->get_kind() == TypeDecl::Any ) {
-					sizeParm = newObj->clone();
-					sizeParm->set_name( std::string("_sizeof_") + (*tyParm)->get_name() );
+					TypeInstType parmType( Type::Qualifiers(), (*tyParm)->get_name(), *tyParm );
+					
+					sizeParm = newObj.clone();
+					sizeParm->set_name( sizeofName( &parmType ) );
 					last = funcType->get_parameters().insert( last, sizeParm );
 					++last;
-					alignParm = newObj->clone();
-					alignParm->set_name( std::string("_alignof_") + (*tyParm)->get_name() );
+
+					alignParm = newObj.clone();
+					alignParm->set_name( alignofName( &parmType ) );
 					last = funcType->get_parameters().insert( last, alignParm );
 					++last;
@@ -1031,5 +1034,4 @@
 				(*tyParm)->get_assertions().clear();
 			}
-			delete newObj;
 			funcType->get_parameters().splice( last, inferredParams );
 			addAdapters( funcType );
@@ -1108,5 +1110,5 @@
 					assert( typeInst );
 					UntypedExpr *alloc = new UntypedExpr( new NameExpr( "__builtin_alloca" ) );
-					alloc->get_args().push_back( new NameExpr( std::string("_sizeof_") + typeInst->get_name() ) );
+					alloc->get_args().push_back( new NameExpr( sizeofName( typeInst ) ) );
 
 					delete objectDecl->get_init();
Index: src/GenPoly/ScrubTyVars.cc
===================================================================
--- src/GenPoly/ScrubTyVars.cc	(revision 5e92feed72740551b66e8ea1388e58acc8148be4)
+++ src/GenPoly/ScrubTyVars.cc	(revision 78dd0da46b655b629d14117130a2cf1ecf113a4c)
@@ -14,8 +14,11 @@
 //
 
+#include <sstream>
 #include <string>
 
 #include "GenPoly.h"
 #include "ScrubTyVars.h"
+
+#include "SymTab/Mangler.h"
 
 #include "SynTree/Mutator.h"
@@ -46,5 +49,5 @@
 		// sizeof( T ) => _sizeof_T parameter, which is the size of T
 		if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( szeof->get_type() ) ) {
-			Expression *expr = new NameExpr( std::string("_sizeof_") + typeInst->get_name() );
+			Expression *expr = new NameExpr( sizeofName( typeInst ) );
 			return expr;
 		} else {
@@ -56,5 +59,5 @@
 		// alignof( T ) => _alignof_T parameter, which is the alignment of T
 		if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( algnof->get_type() ) ) {
-			Expression *expr = new NameExpr( std::string("_alignof_") + typeInst->get_name() );
+			Expression *expr = new NameExpr( alignofName( typeInst ) );
 			return expr;
 		} else {
@@ -75,4 +78,12 @@
 		return Mutator::mutate( pointer );
 	}
+	
+	std::string sizeofName( Type *ty ) {
+		return std::string( "_sizeof_" ) + SymTab::Mangler::mangle( ty, false, false );
+	}
+
+	std::string alignofName( Type *ty ) {
+		return std::string( "_alignof_" ) + SymTab::Mangler::mangle( ty, false, false );
+	}
 } // namespace GenPoly
 
Index: src/GenPoly/ScrubTyVars.h
===================================================================
--- src/GenPoly/ScrubTyVars.h	(revision 5e92feed72740551b66e8ea1388e58acc8148be4)
+++ src/GenPoly/ScrubTyVars.h	(revision 78dd0da46b655b629d14117130a2cf1ecf113a4c)
@@ -16,4 +16,6 @@
 #ifndef _SCRUBTYVARS_H
 #define _SCRUBTYVARS_H
+
+#include <string>
 
 #include "GenPoly.h"
@@ -57,4 +59,10 @@
 		return static_cast< SynTreeClass* >( target->acceptMutator( scrubber ) );
 	}
+
+	/// Gets the name of the sizeof parameter for the type
+	std::string sizeofName( Type *ty );
+
+	/// Gets the name of the alignof parameter for the type
+	std::string alignofName( Type *ty );
 } // namespace GenPoly
 
