Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 79970ed6c19a6660b1238fe9021a3df4e5884245)
+++ src/CodeGen/CodeGenerator.cc	(revision ad4581b92c4dfccbb3a38993ff4021d2330b9138)
@@ -83,5 +83,5 @@
 	}
 
-	CodeGenerator::CodeGenerator( std::ostream & os ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ), printLabels( *this ) {}
+	CodeGenerator::CodeGenerator( std::ostream & os, bool mangle ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ), printLabels( *this ), mangle( mangle ) {}
 
 	CodeGenerator::CodeGenerator( std::ostream & os, std::string init, int indentation, bool infunp )
@@ -95,5 +95,6 @@
 	}
 
-	string mangleName( DeclarationWithType * decl ) {
+	string CodeGenerator::mangleName( DeclarationWithType * decl ) {
+		if ( ! mangle ) return decl->get_name();
 		if ( decl->get_mangleName() != "" ) {
 			// need to incorporate scope level in order to differentiate names for destructors
Index: src/CodeGen/CodeGenerator.h
===================================================================
--- src/CodeGen/CodeGenerator.h	(revision 79970ed6c19a6660b1238fe9021a3df4e5884245)
+++ src/CodeGen/CodeGenerator.h	(revision ad4581b92c4dfccbb3a38993ff4021d2330b9138)
@@ -30,5 +30,5 @@
 		static int tabsize;
 
-		CodeGenerator( std::ostream &os );
+		CodeGenerator( std::ostream &os, bool mangle = true );
 		CodeGenerator( std::ostream &os, std::string, int indent = 0, bool infun = false );
 		CodeGenerator( std::ostream &os, char *, int indent = 0, bool infun = false );
@@ -114,4 +114,5 @@
 		std::ostream &output;
 		LabelPrinter printLabels;
+		bool mangle = true;
 
 		void printDesignators( std::list< Expression * > & );
@@ -119,4 +120,5 @@
 		void handleAggregate( AggregateDecl *aggDecl );
 		void handleTypedef( NamedTypeDecl *namedType );
+		std::string mangleName( DeclarationWithType * decl );
 	}; // CodeGenerator
 
Index: src/CodeGen/GenType.cc
===================================================================
--- src/CodeGen/GenType.cc	(revision 79970ed6c19a6660b1238fe9021a3df4e5884245)
+++ src/CodeGen/GenType.cc	(revision ad4581b92c4dfccbb3a38993ff4021d2330b9138)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// GenType.cc -- 
+// GenType.cc --
 //
 // Author           : Richard C. Bilson
@@ -28,8 +28,8 @@
 	class GenType : public Visitor {
 	  public:
-		GenType( const std::string &typeString );
+		GenType( const std::string &typeString, bool mangle = true );
 		std::string get_typeString() const { return typeString; }
 		void set_typeString( const std::string &newValue ) { typeString = newValue; }
-  
+
 		virtual void visit( FunctionType *funcType );
 		virtual void visit( VoidType *voidType );
@@ -42,19 +42,20 @@
 		virtual void visit( TypeInstType *typeInst );
 		virtual void visit( VarArgsType *varArgsType );
-  
+
 	  private:
 		void handleQualifiers( Type *type );
 		void genArray( const Type::Qualifiers &qualifiers, Type *base, Expression *dimension, bool isVarLen, bool isStatic );
-  
+
 		std::string typeString;
+		bool mangle = true;
 	};
 
-	std::string genType( Type *type, const std::string &baseString ) {
-		GenType gt( baseString );
+	std::string genType( Type *type, const std::string &baseString, bool mangle ) {
+		GenType gt( baseString, mangle );
 		type->accept( gt );
 		return gt.get_typeString();
 	}
 
-	GenType::GenType( const std::string &typeString ) : typeString( typeString ) {}
+	GenType::GenType( const std::string &typeString, bool mangle ) : typeString( typeString ), mangle( mangle ) {}
 
 	void GenType::visit( VoidType *voidType ) {
@@ -100,5 +101,5 @@
 		} // if
 		if ( dimension != 0 ) {
-			CodeGenerator cg( os );
+			CodeGenerator cg( os, mangle );
 			dimension->accept( cg );
 		} else if ( isVarLen ) {
@@ -109,5 +110,5 @@
 
 		typeString = os.str();
-  
+
 		base->accept( *this );
 	}
@@ -142,5 +143,5 @@
 			} // if
 		} // if
-  
+
 		/************* parameters ***************/
 
@@ -154,5 +155,5 @@
 			} // if
 		} else {
-			CodeGenerator cg( os );
+			CodeGenerator cg( os, mangle );
 			os << "(" ;
 
@@ -164,5 +165,5 @@
 			os << ")";
 		} // if
-  
+
 		typeString = os.str();
 
Index: src/CodeGen/GenType.h
===================================================================
--- src/CodeGen/GenType.h	(revision 79970ed6c19a6660b1238fe9021a3df4e5884245)
+++ src/CodeGen/GenType.h	(revision ad4581b92c4dfccbb3a38993ff4021d2330b9138)
@@ -21,5 +21,5 @@
 
 namespace CodeGen {
-	std::string genType( Type *type, const std::string &baseString );
+	std::string genType( Type *type, const std::string &baseString, bool mangle = true );
 } // namespace CodeGen
 
