Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision 8fd52e90372722cd58a940aabae4889d3072d17a)
+++ src/SymTab/Indexer.cc	(revision e3d7f9ff33f317b575231654cab3ce4e670f0a3d)
@@ -188,14 +188,14 @@
 	}
 
-	bool isFunction( DeclarationWithType * decl ) {
+	bool isFunction( const DeclarationWithType * decl ) {
 		return GenPoly::getFunctionType( decl->get_type() );
 	}
 
-	bool isObject( DeclarationWithType * decl ) {
+	bool isObject( const DeclarationWithType * decl ) {
 		return ! isFunction( decl );
 	}
 
-	bool isDefinition( DeclarationWithType * decl ) {
-		if ( FunctionDecl * func = dynamic_cast< FunctionDecl * >( decl ) ) {
+	bool isDefinition( const DeclarationWithType * decl ) {
+		if ( const FunctionDecl * func = dynamic_cast< const FunctionDecl * >( decl ) ) {
 			// a function is a definition if it has a body
 			return func->statements;
@@ -209,6 +209,6 @@
 
 	bool Indexer::addedIdConflicts(
-			const Indexer::IdData & existing, DeclarationWithType * added,
-			Indexer::OnConflict handleConflicts, BaseSyntaxNode * deleteStmt ) {
+			const Indexer::IdData & existing, const DeclarationWithType * added,
+			Indexer::OnConflict handleConflicts, const BaseSyntaxNode * deleteStmt ) {
 		// if we're giving the same name mangling to things of different types then there is
 		// something wrong
@@ -274,6 +274,5 @@
 	}
 
-	bool Indexer::hasIncompatibleCDecl(
-			const std::string & id, const std::string &mangleName ) const {
+	bool Indexer::hasIncompatibleCDecl(const std::string & id, const std::string &mangleName ) const {
 		if ( ! idTable ) return false;
 
@@ -295,5 +294,5 @@
 
 	/// gets the base type of the first parameter; decl must be a ctor/dtor/assignment function
-	std::string getOtypeKey( FunctionDecl * function ) {
+	std::string getOtypeKey( const FunctionDecl * function ) {
 		auto& params = function->type->parameters;
 		assert( ! params.empty() );
@@ -306,12 +305,11 @@
 	/// gets the declaration for the function acting on a type specified by otype key,
 	/// nullptr if none such
-	FunctionDecl * getFunctionForOtype( DeclarationWithType * decl, const std::string& otypeKey ) {
-		FunctionDecl * func = dynamic_cast< FunctionDecl * >( decl );
+	const FunctionDecl * getFunctionForOtype( const DeclarationWithType * decl, const std::string& otypeKey ) {
+		const FunctionDecl * func = dynamic_cast< const FunctionDecl * >( decl );
 		if ( ! func || otypeKey != getOtypeKey( func ) ) return nullptr;
 		return func;
 	}
 
-	bool Indexer::removeSpecialOverrides(
-			Indexer::IdData& data, Indexer::MangleTable::Ptr& mangleTable ) {
+	bool Indexer::removeSpecialOverrides(Indexer::IdData& data, Indexer::MangleTable::Ptr& mangleTable ) {
 		// if a type contains user defined ctor/dtor/assign, then special rules trigger, which
 		// determinethe set of ctor/dtor/assign that can be used  by the requester. In particular,
@@ -324,5 +322,5 @@
 
 		// only relevant on function declarations
-		FunctionDecl * function = dynamic_cast< FunctionDecl * >( data.id );
+		const FunctionDecl * function = dynamic_cast< const FunctionDecl * >( data.id );
 		if ( ! function ) return true;
 		// only need to perform this check for constructors, destructors, and assignment functions
@@ -343,5 +341,5 @@
 			for ( const auto& entry : * mangleTable ) {
 				// skip decls that aren't functions or are for the wrong type
-				FunctionDecl * decl = getFunctionForOtype( entry.second.id, dataOtypeKey );
+				const FunctionDecl * decl = getFunctionForOtype( entry.second.id, dataOtypeKey );
 				if ( ! decl ) continue;
 
@@ -382,5 +380,5 @@
 			for ( const auto& entry : * mangleTable ) {
 				// skip decls that aren't functions or are for the wrong type
-				FunctionDecl * decl = getFunctionForOtype( entry.second.id, dataOtypeKey );
+				const FunctionDecl * decl = getFunctionForOtype( entry.second.id, dataOtypeKey );
 				if ( ! decl ) continue;
 
@@ -410,5 +408,5 @@
 			for ( const auto& entry : * mangleTable ) {
 				// skip decls that aren't functions or are for the wrong type
-				FunctionDecl * decl = getFunctionForOtype( entry.second.id, dataOtypeKey );
+				const FunctionDecl * decl = getFunctionForOtype( entry.second.id, dataOtypeKey );
 				if ( ! decl ) continue;
 
@@ -433,7 +431,6 @@
 	}
 
-	void Indexer::addId(
-			DeclarationWithType * decl, OnConflict handleConflicts, Expression * baseExpr,
-			BaseSyntaxNode * deleteStmt ) {
+	void Indexer::addId(const DeclarationWithType * decl, OnConflict handleConflicts, const Expression * baseExpr,
+			const BaseSyntaxNode * deleteStmt ) {
 		++* stats().add_calls;
 		const std::string &name = decl->name;
@@ -508,15 +505,15 @@
 	}
 
-	void Indexer::addId( DeclarationWithType * decl, Expression * baseExpr ) {
+	void Indexer::addId( const DeclarationWithType * decl, const Expression * baseExpr ) {
 		// default handling of conflicts is to raise an error
 		addId( decl, OnConflict::error(), baseExpr, decl->isDeleted ? decl : nullptr );
 	}
 
-	void Indexer::addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt ) {
+	void Indexer::addDeletedId( const DeclarationWithType * decl, const BaseSyntaxNode * deleteStmt ) {
 		// default handling of conflicts is to raise an error
 		addId( decl, OnConflict::error(), nullptr, deleteStmt );
 	}
 
-	bool addedTypeConflicts( NamedTypeDecl * existing, NamedTypeDecl * added ) {
+	bool addedTypeConflicts( const NamedTypeDecl * existing, const NamedTypeDecl * added ) {
 		if ( existing->base == nullptr ) {
 			return false;
@@ -535,5 +532,5 @@
 	}
 
-	void Indexer::addType( NamedTypeDecl * decl ) {
+	void Indexer::addType( const NamedTypeDecl * decl ) {
 		++* stats().add_calls;
 		const std::string & id = decl->name;
@@ -554,5 +551,5 @@
 	}
 
-	bool addedDeclConflicts( AggregateDecl * existing, AggregateDecl * added ) {
+	bool addedDeclConflicts( const AggregateDecl * existing, const AggregateDecl * added ) {
 		if ( ! existing->body ) {
 			return false;
@@ -567,5 +564,5 @@
 	}
 
-	void Indexer::addStruct( StructDecl * decl ) {
+	void Indexer::addStruct( const StructDecl * decl ) {
 		++* stats().add_calls;
 		const std::string & id = decl->name;
@@ -586,5 +583,5 @@
 	}
 
-	void Indexer::addEnum( EnumDecl * decl ) {
+	void Indexer::addEnum( const EnumDecl * decl ) {
 		++* stats().add_calls;
 		const std::string & id = decl->name;
@@ -609,5 +606,5 @@
 	}
 
-	void Indexer::addUnion( UnionDecl * decl ) {
+	void Indexer::addUnion( const UnionDecl * decl ) {
 		++* stats().add_calls;
 		const std::string & id = decl->name;
@@ -628,5 +625,5 @@
 	}
 
-	void Indexer::addTrait( TraitDecl * decl ) {
+	void Indexer::addTrait( const TraitDecl * decl ) {
 		++* stats().add_calls;
 		const std::string & id = decl->name;
@@ -647,12 +644,11 @@
 	}
 
-	void Indexer::addMembers( AggregateDecl * aggr, Expression * expr,
-			OnConflict handleConflicts ) {
+	void Indexer::addMembers( const AggregateDecl * aggr, const Expression * expr, OnConflict handleConflicts ) {
 		for ( Declaration * decl : aggr->members ) {
 			if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
 				addId( dwt, handleConflicts, expr );
 				if ( dwt->name == "" ) {
-					Type * t = dwt->get_type()->stripReferences();
-					if ( dynamic_cast<StructInstType *>( t ) || dynamic_cast<UnionInstType *>( t ) ) {
+					const Type * t = dwt->get_type()->stripReferences();
+					if ( dynamic_cast<const StructInstType *>( t ) || dynamic_cast<const UnionInstType *>( t ) ) {
 						Expression * base = expr->clone();
 						ResolvExpr::Cost cost = ResolvExpr::Cost::zero; // xxx - carry this cost into the indexer as a base cost?
@@ -665,6 +661,6 @@
 	}
 
-	void Indexer::addWith( std::list< Expression * > & withExprs, BaseSyntaxNode * withStmt ) {
-		for ( Expression * expr : withExprs ) {
+	void Indexer::addWith( const std::list< Expression * > & withExprs, const BaseSyntaxNode * withStmt ) {
+		for ( const Expression * expr : withExprs ) {
 			if ( expr->result ) {
 				AggregateDecl * aggr = expr->result->stripReferences()->getAggr();
@@ -689,5 +685,5 @@
 	}
 
-	void Indexer::addFunctionType( FunctionType * ftype ) {
+	void Indexer::addFunctionType( const FunctionType * ftype ) {
 		addTypes( ftype->forall );
 		addIds( ftype->returnVals );
@@ -700,5 +696,5 @@
 			Expression * base = baseExpr->clone();
 			ResolvExpr::referenceToRvalueConversion( base, cost );
-			ret = new MemberExpr( id, base );
+			ret = new MemberExpr( const_cast<DeclarationWithType *>(id), base );
 			// xxx - this introduces hidden environments, for now remove them.
 			// std::swap( base->env, ret->env );
@@ -706,7 +702,7 @@
 			base->env = nullptr;
 		} else {
-			ret = new VariableExpr( id );
-		}
-		if ( deleteStmt ) ret = new DeletedExpr( ret, deleteStmt );
+			ret = new VariableExpr( const_cast<DeclarationWithType *>(id) );
+		}
+		if ( deleteStmt ) ret = new DeletedExpr( ret, const_cast<BaseSyntaxNode *>(deleteStmt) );
 		return ret;
 	}
Index: src/SymTab/Indexer.h
===================================================================
--- src/SymTab/Indexer.h	(revision 8fd52e90372722cd58a940aabae4889d3072d17a)
+++ src/SymTab/Indexer.h	(revision e3d7f9ff33f317b575231654cab3ce4e670f0a3d)
@@ -40,9 +40,9 @@
 
 		struct IdData {
-			DeclarationWithType * id = nullptr;
-			Expression * baseExpr = nullptr; // WithExpr
+			const DeclarationWithType * id = nullptr;
+			const Expression * baseExpr = nullptr; // WithExpr
 
 			/// non-null if this declaration is deleted
-			BaseSyntaxNode * deleteStmt = nullptr;
+			const BaseSyntaxNode * deleteStmt = nullptr;
 			/// scope of identifier
 			unsigned long scope = 0;
@@ -51,8 +51,8 @@
 			IdData() = default;
 			IdData(
-				DeclarationWithType * id, Expression * baseExpr, BaseSyntaxNode * deleteStmt,
+				const DeclarationWithType * id, const Expression * baseExpr, const BaseSyntaxNode * deleteStmt,
 				unsigned long scope )
 				: id( id ), baseExpr( baseExpr ), deleteStmt( deleteStmt ), scope( scope ) {}
-			IdData( const IdData& o, BaseSyntaxNode * deleteStmt )
+			IdData( const IdData& o, const BaseSyntaxNode * deleteStmt )
 				: id( o.id ), baseExpr( o.baseExpr ), deleteStmt( deleteStmt ), scope( o.scope ) {}
 
@@ -82,17 +82,17 @@
 		const EnumDecl * globalLookupEnum( const std::string & id ) const;
 
-		void addId( DeclarationWithType * decl, Expression * baseExpr = nullptr );
-		void addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt );
+		void addId( const DeclarationWithType * decl, const Expression * baseExpr = nullptr );
+		void addDeletedId( const DeclarationWithType * decl, const BaseSyntaxNode * deleteStmt );
 
-		void addType( NamedTypeDecl * decl );
+		void addType( const NamedTypeDecl * decl );
 		void addStruct( const std::string & id );
-		void addStruct( StructDecl * decl );
-		void addEnum( EnumDecl * decl );
+		void addStruct( const StructDecl * decl );
+		void addEnum( const EnumDecl * decl );
 		void addUnion( const std::string & id );
-		void addUnion( UnionDecl * decl );
-		void addTrait( TraitDecl * decl );
+		void addUnion( const UnionDecl * decl );
+		void addTrait( const TraitDecl * decl );
 
 		/// adds all of the IDs from WithStmt exprs
-		void addWith( std::list< Expression * > & withExprs, BaseSyntaxNode * withStmt );
+		void addWith( const std::list< Expression * > & withExprs, const BaseSyntaxNode * withStmt );
 
 		/// convenience function for adding a list of Ids to the indexer
@@ -103,5 +103,5 @@
 
 		/// convenience function for adding all of the declarations in a function type to the indexer
-		void addFunctionType( FunctionType * ftype );
+		void addFunctionType( const FunctionType * ftype );
 
 	  private:
@@ -109,8 +109,8 @@
 	  	template<typename Decl>
 		struct Scoped {
-			Decl * decl;           ///< declaration
+			const Decl * decl;           ///< declaration
 			unsigned long scope;  ///< scope of this declaration
 
-			Scoped(Decl * d, unsigned long s) : decl(d), scope(s) {}
+			Scoped(const Decl * d, unsigned long s) : decl(d), scope(s) {}
 		};
 
@@ -144,5 +144,5 @@
 		/// Removes matching autogenerated constructors and destructors so that they will not be
 		/// selected. If returns false, passed decl should not be added.
-		bool removeSpecialOverrides( IdData& decl, MangleTable::Ptr& mangleTable );
+		bool removeSpecialOverrides( IdData & decl, MangleTable::Ptr & mangleTable );
 
 		/// Options for handling identifier conflicts
@@ -152,33 +152,32 @@
 				Delete  ///< Delete the earlier version with the delete statement
 			} mode;
-			BaseSyntaxNode * deleteStmt;  ///< Statement that deletes this expression
+			const BaseSyntaxNode * deleteStmt;  ///< Statement that deletes this expression
 
 		private:
 			OnConflict() : mode(Error), deleteStmt(nullptr) {}
-			OnConflict( BaseSyntaxNode * d ) : mode(Delete), deleteStmt(d) {}
+			OnConflict( const BaseSyntaxNode * d ) : mode(Delete), deleteStmt(d) {}
 		public:
 			OnConflict( const OnConflict& ) = default;
 
 			static OnConflict error() { return {}; }
-			static OnConflict deleteWith( BaseSyntaxNode * d ) { return { d }; }
+			static OnConflict deleteWith( const BaseSyntaxNode * d ) { return { d }; }
 		};
 
 		/// true if the existing identifier conflicts with the added identifier
 		bool addedIdConflicts(
-			const IdData& existing, DeclarationWithType * added, OnConflict handleConflicts,
-			BaseSyntaxNode * deleteStmt );
+			const IdData & existing, const DeclarationWithType * added, OnConflict handleConflicts,
+			const BaseSyntaxNode * deleteStmt );
 
 		/// common code for addId, addDeletedId, etc.
-		void addId(
-			DeclarationWithType * decl, OnConflict handleConflicts,
-			Expression * baseExpr = nullptr, BaseSyntaxNode * deleteStmt = nullptr );
+		void addId(const DeclarationWithType * decl, OnConflict handleConflicts,
+			const Expression * baseExpr = nullptr, const BaseSyntaxNode * deleteStmt = nullptr );
 
 		/// adds all of the members of the Aggregate (addWith helper)
-		void addMembers( AggregateDecl * aggr, Expression * expr, OnConflict handleConflicts );
+		void addMembers( const AggregateDecl * aggr, const Expression * expr, OnConflict handleConflicts );
 
 		/// returns true if there exists a declaration with C linkage and the given name with the same mangled name
-		bool hasCompatibleCDecl( const std::string & id, const std::string &mangleName ) const;
+		bool hasCompatibleCDecl( const std::string & id, const std::string & mangleName ) const;
 		/// returns true if there exists a declaration with C linkage and the given name with a different mangled name
-		bool hasIncompatibleCDecl( const std::string & id, const std::string &mangleName ) const;
+		bool hasIncompatibleCDecl( const std::string & id, const std::string & mangleName ) const;
 	};
 } // namespace SymTab
Index: src/SymTab/Mangler.cc
===================================================================
--- src/SymTab/Mangler.cc	(revision 8fd52e90372722cd58a940aabae4889d3072d17a)
+++ src/SymTab/Mangler.cc	(revision e3d7f9ff33f317b575231654cab3ce4e670f0a3d)
@@ -42,26 +42,26 @@
 				Mangler_old( const Mangler_old & ) = delete;
 
-				void previsit( BaseSyntaxNode * ) { visit_children = false; }
-
-				void postvisit( ObjectDecl * declaration );
-				void postvisit( FunctionDecl * declaration );
-				void postvisit( TypeDecl * declaration );
-
-				void postvisit( VoidType * voidType );
-				void postvisit( BasicType * basicType );
-				void postvisit( PointerType * pointerType );
-				void postvisit( ArrayType * arrayType );
-				void postvisit( ReferenceType * refType );
-				void postvisit( FunctionType * functionType );
-				void postvisit( StructInstType * aggregateUseType );
-				void postvisit( UnionInstType * aggregateUseType );
-				void postvisit( EnumInstType * aggregateUseType );
-				void postvisit( TypeInstType * aggregateUseType );
-				void postvisit( TraitInstType * inst );
-				void postvisit( TupleType * tupleType );
-				void postvisit( VarArgsType * varArgsType );
-				void postvisit( ZeroType * zeroType );
-				void postvisit( OneType * oneType );
-				void postvisit( QualifiedType * qualType );
+				void previsit( const BaseSyntaxNode * ) { visit_children = false; }
+
+				void postvisit( const ObjectDecl * declaration );
+				void postvisit( const FunctionDecl * declaration );
+				void postvisit( const TypeDecl * declaration );
+
+				void postvisit( const VoidType * voidType );
+				void postvisit( const BasicType * basicType );
+				void postvisit( const PointerType * pointerType );
+				void postvisit( const ArrayType * arrayType );
+				void postvisit( const ReferenceType * refType );
+				void postvisit( const FunctionType * functionType );
+				void postvisit( const StructInstType * aggregateUseType );
+				void postvisit( const UnionInstType * aggregateUseType );
+				void postvisit( const EnumInstType * aggregateUseType );
+				void postvisit( const TypeInstType * aggregateUseType );
+				void postvisit( const TraitInstType * inst );
+				void postvisit( const TupleType * tupleType );
+				void postvisit( const VarArgsType * varArgsType );
+				void postvisit( const ZeroType * zeroType );
+				void postvisit( const OneType * oneType );
+				void postvisit( const QualifiedType * qualType );
 
 				std::string get_mangleName() { return mangleName.str(); }
@@ -79,16 +79,16 @@
 
 			  public:
-				Mangler_old( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 
+				Mangler_old( bool mangleOverridable, bool typeMode, bool mangleGenericParams,
 					int nextVarNum, const VarMapType& varNums );
 
 			  private:
-				void mangleDecl( DeclarationWithType *declaration );
-				void mangleRef( ReferenceToType *refType, std::string prefix );
-
-				void printQualifiers( Type *type );
+				void mangleDecl( const DeclarationWithType * declaration );
+				void mangleRef( const ReferenceToType * refType, std::string prefix );
+
+				void printQualifiers( const Type *type );
 			}; // Mangler_old
 		} // namespace
 
-		std::string mangle( BaseSyntaxNode * decl, bool mangleOverridable, bool typeMode, bool mangleGenericParams ) {
+		std::string mangle( const BaseSyntaxNode * decl, bool mangleOverridable, bool typeMode, bool mangleGenericParams ) {
 			PassVisitor<Mangler_old> mangler( mangleOverridable, typeMode, mangleGenericParams );
 			maybeAccept( decl, mangler );
@@ -96,5 +96,5 @@
 		}
 
-		std::string mangleType( Type * ty ) {
+		std::string mangleType( const Type * ty ) {
 			PassVisitor<Mangler_old> mangler( false, true, true );
 			maybeAccept( ty, mangler );
@@ -102,5 +102,5 @@
 		}
 
-		std::string mangleConcrete( Type * ty ) {
+		std::string mangleConcrete( const Type * ty ) {
 			PassVisitor<Mangler_old> mangler( false, false, false );
 			maybeAccept( ty, mangler );
@@ -110,15 +110,15 @@
 		namespace {
 			Mangler_old::Mangler_old( bool mangleOverridable, bool typeMode, bool mangleGenericParams )
-				: nextVarNum( 0 ), isTopLevel( true ), 
-				mangleOverridable( mangleOverridable ), typeMode( typeMode ), 
+				: nextVarNum( 0 ), isTopLevel( true ),
+				mangleOverridable( mangleOverridable ), typeMode( typeMode ),
 				mangleGenericParams( mangleGenericParams ) {}
-			
-			Mangler_old::Mangler_old( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 
+
+			Mangler_old::Mangler_old( bool mangleOverridable, bool typeMode, bool mangleGenericParams,
 				int nextVarNum, const VarMapType& varNums )
-				: varNums( varNums ), nextVarNum( nextVarNum ), isTopLevel( false ), 
-				mangleOverridable( mangleOverridable ), typeMode( typeMode ), 
+				: varNums( varNums ), nextVarNum( nextVarNum ), isTopLevel( false ),
+				mangleOverridable( mangleOverridable ), typeMode( typeMode ),
 				mangleGenericParams( mangleGenericParams ) {}
 
-			void Mangler_old::mangleDecl( DeclarationWithType * declaration ) {
+			void Mangler_old::mangleDecl( const DeclarationWithType * declaration ) {
 				bool wasTopLevel = isTopLevel;
 				if ( isTopLevel ) {
@@ -150,24 +150,24 @@
 			}
 
-			void Mangler_old::postvisit( ObjectDecl * declaration ) {
+			void Mangler_old::postvisit( const ObjectDecl * declaration ) {
 				mangleDecl( declaration );
 			}
 
-			void Mangler_old::postvisit( FunctionDecl * declaration ) {
+			void Mangler_old::postvisit( const FunctionDecl * declaration ) {
 				mangleDecl( declaration );
 			}
 
-			void Mangler_old::postvisit( VoidType * voidType ) {
+			void Mangler_old::postvisit( const VoidType * voidType ) {
 				printQualifiers( voidType );
 				mangleName << Encoding::void_t;
 			}
 
-			void Mangler_old::postvisit( BasicType * basicType ) {
+			void Mangler_old::postvisit( const BasicType * basicType ) {
 				printQualifiers( basicType );
-				assertf( basicType->get_kind() < BasicType::NUMBER_OF_BASIC_TYPES, "Unhandled basic type: %d", basicType->get_kind() );
-				mangleName << Encoding::basicTypes[ basicType->get_kind() ];
-			}
-
-			void Mangler_old::postvisit( PointerType * pointerType ) {
+				assertf( basicType->kind < BasicType::NUMBER_OF_BASIC_TYPES, "Unhandled basic type: %d", basicType->kind );
+				mangleName << Encoding::basicTypes[ basicType->kind ];
+			}
+
+			void Mangler_old::postvisit( const PointerType * pointerType ) {
 				printQualifiers( pointerType );
 				// mangle void (*f)() and void f() to the same name to prevent overloading on functions and function pointers
@@ -176,5 +176,5 @@
 			}
 
-			void Mangler_old::postvisit( ArrayType * arrayType ) {
+			void Mangler_old::postvisit( const ArrayType * arrayType ) {
 				// TODO: encode dimension
 				printQualifiers( arrayType );
@@ -183,5 +183,5 @@
 			}
 
-			void Mangler_old::postvisit( ReferenceType * refType ) {
+			void Mangler_old::postvisit( const ReferenceType * refType ) {
 				// don't print prefix (e.g. 'R') for reference types so that references and non-references do not overload.
 				// Further, do not print the qualifiers for a reference type (but do run printQualifers because of TypeDecls, etc.),
@@ -202,5 +202,5 @@
 			}
 
-			void Mangler_old::postvisit( FunctionType * functionType ) {
+			void Mangler_old::postvisit( const FunctionType * functionType ) {
 				printQualifiers( functionType );
 				mangleName << Encoding::function;
@@ -219,5 +219,5 @@
 			}
 
-			void Mangler_old::mangleRef( ReferenceToType * refType, std::string prefix ) {
+			void Mangler_old::mangleRef( const ReferenceToType * refType, std::string prefix ) {
 				printQualifiers( refType );
 
@@ -225,10 +225,10 @@
 
 				if ( mangleGenericParams ) {
-					std::list< Expression* >& params = refType->parameters;
+					const std::list< Expression* > & params = refType->parameters;
 					if ( ! params.empty() ) {
 						mangleName << "_";
-						for ( std::list< Expression* >::const_iterator param = params.begin(); param != params.end(); ++param ) {
-							TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param );
-							assertf(paramType, "Aggregate parameters should be type expressions: %s", toCString(*param));
+						for ( const Expression * param : params ) {
+							const TypeExpr * paramType = dynamic_cast< const TypeExpr * >( param );
+							assertf(paramType, "Aggregate parameters should be type expressions: %s", toCString(param));
 							maybeAccept( paramType->type, *visitor );
 						}
@@ -238,17 +238,17 @@
 			}
 
-			void Mangler_old::postvisit( StructInstType * aggregateUseType ) {
+			void Mangler_old::postvisit( const StructInstType * aggregateUseType ) {
 				mangleRef( aggregateUseType, Encoding::struct_t );
 			}
 
-			void Mangler_old::postvisit( UnionInstType * aggregateUseType ) {
+			void Mangler_old::postvisit( const UnionInstType * aggregateUseType ) {
 				mangleRef( aggregateUseType, Encoding::union_t );
 			}
 
-			void Mangler_old::postvisit( EnumInstType * aggregateUseType ) {
+			void Mangler_old::postvisit( const EnumInstType * aggregateUseType ) {
 				mangleRef( aggregateUseType, Encoding::enum_t );
 			}
 
-			void Mangler_old::postvisit( TypeInstType * typeInst ) {
+			void Mangler_old::postvisit( const TypeInstType * typeInst ) {
 				VarMapType::iterator varNum = varNums.find( typeInst->get_name() );
 				if ( varNum == varNums.end() ) {
@@ -266,10 +266,10 @@
 			}
 
-			void Mangler_old::postvisit( TraitInstType * inst ) {
+			void Mangler_old::postvisit( const TraitInstType * inst ) {
 				printQualifiers( inst );
 				mangleName << inst->name.size() << inst->name;
 			}
 
-			void Mangler_old::postvisit( TupleType * tupleType ) {
+			void Mangler_old::postvisit( const TupleType * tupleType ) {
 				printQualifiers( tupleType );
 				mangleName << Encoding::tuple << tupleType->types.size();
@@ -277,5 +277,5 @@
 			}
 
-			void Mangler_old::postvisit( VarArgsType * varArgsType ) {
+			void Mangler_old::postvisit( const VarArgsType * varArgsType ) {
 				printQualifiers( varArgsType );
 				static const std::string vargs = "__builtin_va_list";
@@ -283,13 +283,13 @@
 			}
 
-			void Mangler_old::postvisit( ZeroType * ) {
+			void Mangler_old::postvisit( const ZeroType * ) {
 				mangleName << Encoding::zero;
 			}
 
-			void Mangler_old::postvisit( OneType * ) {
+			void Mangler_old::postvisit( const OneType * ) {
 				mangleName << Encoding::one;
 			}
 
-			void Mangler_old::postvisit( QualifiedType * qualType ) {
+			void Mangler_old::postvisit( const QualifiedType * qualType ) {
 				bool inqual = inQualifiedType;
 				if (! inqual ) {
@@ -307,5 +307,5 @@
 			}
 
-			void Mangler_old::postvisit( TypeDecl * decl ) {
+			void Mangler_old::postvisit( const TypeDecl * decl ) {
 				// TODO: is there any case where mangling a TypeDecl makes sense? If so, this code needs to be
 				// fixed to ensure that two TypeDecls mangle to the same name when they are the same type and vice versa.
@@ -314,6 +314,6 @@
 				// aside from the assert false.
 				assertf(false, "Mangler_old should not visit typedecl: %s", toCString(decl));
-				assertf( decl->get_kind() < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->get_kind() );
-				mangleName << Encoding::typeVariables[ decl->get_kind() ] << ( decl->name.length() ) << decl->name;
+				assertf( decl->kind < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->kind );
+				mangleName << Encoding::typeVariables[ decl->kind ] << ( decl->name.length() ) << decl->name;
 			}
 
@@ -324,13 +324,13 @@
 			}
 
-			void Mangler_old::printQualifiers( Type * type ) {
+			void Mangler_old::printQualifiers( const Type * type ) {
 				// skip if not including qualifiers
 				if ( typeMode ) return;
-				if ( ! type->get_forall().empty() ) {
+				if ( ! type->forall.empty() ) {
 					std::list< std::string > assertionNames;
 					int dcount = 0, fcount = 0, vcount = 0, acount = 0;
 					mangleName << Encoding::forall;
-					for ( Type::ForallList::iterator i = type->forall.begin(); i != type->forall.end(); ++i ) {
-						switch ( (*i)->get_kind() ) {
+					for ( const TypeDecl * i : type->forall ) {
+						switch ( i->kind ) {
 						  case TypeDecl::Dtype:
 							dcount++;
@@ -345,9 +345,9 @@
 							assert( false );
 						} // switch
-						varNums[ (*i)->name ] = std::make_pair( nextVarNum, (int)(*i)->get_kind() );
-						for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) {
-							PassVisitor<Mangler_old> sub_mangler( 
+						varNums[ i->name ] = std::make_pair( nextVarNum, (int)i->kind );
+						for ( const DeclarationWithType * assert : i->assertions ) {
+							PassVisitor<Mangler_old> sub_mangler(
 								mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums );
-							(*assert)->accept( sub_mangler );
+							assert->accept( sub_mangler );
 							assertionNames.push_back( sub_mangler.pass.get_mangleName() );
 							acount++;
@@ -436,5 +436,5 @@
 
 		  private:
-			Mangler_new( bool mangleOverridable, bool typeMode, bool mangleGenericParams,  
+			Mangler_new( bool mangleOverridable, bool typeMode, bool mangleGenericParams,
 				int nextVarNum, const VarMapType& varNums );
 			friend class ast::Pass<Mangler_new>;
@@ -457,13 +457,13 @@
 	namespace {
 		Mangler_new::Mangler_new( Mangle::Mode mode )
-			: nextVarNum( 0 ), isTopLevel( true ), 
+			: nextVarNum( 0 ), isTopLevel( true ),
 			mangleOverridable  ( ! mode.no_overrideable   ),
-			typeMode           (   mode.type              ), 
+			typeMode           (   mode.type              ),
 			mangleGenericParams( ! mode.no_generic_params ) {}
-		
-		Mangler_new::Mangler_new( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 
+
+		Mangler_new::Mangler_new( bool mangleOverridable, bool typeMode, bool mangleGenericParams,
 			int nextVarNum, const VarMapType& varNums )
-			: varNums( varNums ), nextVarNum( nextVarNum ), isTopLevel( false ), 
-			mangleOverridable( mangleOverridable ), typeMode( typeMode ), 
+			: varNums( varNums ), nextVarNum( nextVarNum ), isTopLevel( false ),
+			mangleOverridable( mangleOverridable ), typeMode( typeMode ),
 			mangleGenericParams( mangleGenericParams ) {}
 
@@ -693,5 +693,5 @@
 						varNums[ decl->name ] = std::make_pair( nextVarNum, (int)decl->kind );
 						for ( const ast::DeclWithType * assert : decl->assertions ) {
-							ast::Pass<Mangler_new> sub_mangler( 
+							ast::Pass<Mangler_new> sub_mangler(
 								mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums );
 							assert->accept( sub_mangler );
Index: src/SymTab/Mangler.h
===================================================================
--- src/SymTab/Mangler.h	(revision 8fd52e90372722cd58a940aabae4889d3072d17a)
+++ src/SymTab/Mangler.h	(revision e3d7f9ff33f317b575231654cab3ce4e670f0a3d)
@@ -40,10 +40,10 @@
 	namespace Mangler {
 		/// Mangle syntax tree object; primary interface to clients
-		std::string mangle( BaseSyntaxNode * decl, bool mangleOverridable = true, bool typeMode = false, bool mangleGenericParams = true );
+		std::string mangle( const BaseSyntaxNode * decl, bool mangleOverridable = true, bool typeMode = false, bool mangleGenericParams = true );
 
 		/// Mangle a type name; secondary interface
-		std::string mangleType( Type* ty );
+		std::string mangleType( const Type * ty );
 		/// Mangle ignoring generic type parameters
-		std::string mangleConcrete( Type* ty );
+		std::string mangleConcrete( const Type * ty );
 
 		namespace Encoding {
