Index: src/AST/Create.cpp
===================================================================
--- src/AST/Create.cpp	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/AST/Create.cpp	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -20,4 +20,5 @@
 #include "AST/Decl.hpp"
 #include "AST/Type.hpp"
+#include "Common/Iterate.hpp"
 
 namespace ast {
Index: src/AST/Decl.cpp
===================================================================
--- src/AST/Decl.cpp	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/AST/Decl.cpp	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -20,5 +20,5 @@
 #include <unordered_map>
 
-#include "Common/utility.h"
+#include "Common/Eval.h"       // for eval
 
 #include "Fwd.hpp"             // for UniqueId
Index: src/AST/Pass.impl.hpp
===================================================================
--- src/AST/Pass.impl.hpp	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/AST/Pass.impl.hpp	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -22,4 +22,5 @@
 #include "AST/TranslationUnit.hpp"
 #include "AST/TypeSubstitution.hpp"
+#include "Common/Iterate.hpp"
 
 #define VISIT_START( node ) \
Index: src/Common/Eval.cc
===================================================================
--- src/Common/Eval.cc	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/Common/Eval.cc	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// utility.h --
+// Eval.cc -- Evaluate parts of the ast at compile time.
 //
 // Author           : Richard C. Bilson
@@ -13,4 +13,6 @@
 // Update Count     : 119
 //
+
+#include "Eval.h"
 
 #include <utility> // for pair
Index: src/Common/Eval.h
===================================================================
--- src/Common/Eval.h	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
+++ src/Common/Eval.h	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -0,0 +1,34 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Eval.h -- Evaluate parts of the ast at compile time.
+//
+// Author           : Andrew Beach
+// Created On       : Fri Feb 17 11:41:00 2023
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Feb 17 11:41:00 2023
+// Update Count     : 0
+//
+
+#pragma once
+
+#include <utility>                 // for pair
+
+class Expression;
+namespace ast {
+	class Expr;
+}
+
+/// Evaluates expr as a long long int.
+/// If second is false, expr could not be evaluated.
+std::pair<long long int, bool> eval(const Expression * expr);
+std::pair<long long int, bool> eval(const ast::Expr * expr);
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/Common/Iterate.hpp
===================================================================
--- src/Common/Iterate.hpp	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
+++ src/Common/Iterate.hpp	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -0,0 +1,241 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Iterate.hpp --
+//
+// Author           : Andrew Beach
+// Created On       : Fri Feb 17 13:32:00 2023
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Feb 17 13:32:00 2023
+// Update Count     : 0
+//
+
+#pragma once
+
+#include <algorithm>
+#include <functional>
+#include <iterator>
+
+// it's nice to actually be able to increment iterators by an arbitrary amount
+template< class InputIt, class Distance >
+InputIt operator+( InputIt it, Distance n ) {
+	advance(it, n);
+	return it;
+}
+
+// -----------------------------------------------------------------------------
+// Helper struct and function to support
+// for ( val : reverseIterate( container ) ) {}
+// syntax to have a for each that iterates backwards
+
+template< typename T >
+struct reverse_iterate_t {
+	T& ref;
+
+	reverse_iterate_t( T & ref ) : ref(ref) {}
+
+	// this does NOT work on const T!!!
+	// typedef typename T::reverse_iterator iterator;
+	auto begin() { return ref.rbegin(); }
+	auto end() { return ref.rend(); }
+};
+
+template< typename T >
+reverse_iterate_t< T > reverseIterate( T & ref ) {
+	return reverse_iterate_t< T >( ref );
+}
+
+// -----------------------------------------------------------------------------
+template< typename T >
+struct enumerate_t {
+	template<typename val_t>
+	struct value_t {
+		val_t & val;
+		size_t idx;
+	};
+
+	template< typename iter_t, typename val_t >
+	struct iterator_t {
+		iter_t it;
+		size_t idx;
+
+		iterator_t( iter_t _it, size_t _idx ) : it(_it), idx(_idx) {}
+
+		value_t<val_t> operator*() const { return value_t<val_t>{ *it, idx }; }
+
+		bool operator==(const iterator_t & o) const { return o.it == it; }
+		bool operator!=(const iterator_t & o) const { return o.it != it; }
+
+		iterator_t & operator++() {
+			it++;
+			idx++;
+			return *this;
+		}
+
+		using difference_type   = typename std::iterator_traits< iter_t >::difference_type;
+		using value_type        = value_t<val_t>;
+		using pointer           = value_t<val_t> *;
+		using reference         = value_t<val_t> &;
+		using iterator_category = std::forward_iterator_tag;
+	};
+
+	T & ref;
+
+	using iterator = iterator_t< typename T::iterator, typename T::value_type >;
+	using const_iterator = iterator_t< typename T::const_iterator, const typename T::value_type >;
+
+	iterator begin() { return iterator( ref.begin(), 0 ); }
+	iterator end()   { return iterator( ref.end(), ref.size() ); }
+
+	const_iterator begin() const { return const_iterator( ref.cbegin(), 0 ); }
+	const_iterator end()   const { return const_iterator( ref.cend(), ref.size() ); }
+
+	const_iterator cbegin() const { return const_iterator( ref.cbegin(), 0 ); }
+	const_iterator cend()   const { return const_iterator( ref.cend(), ref.size() ); }
+};
+
+template< typename T >
+enumerate_t<T> enumerate( T & ref ) {
+	return enumerate_t< T >{ ref };
+}
+
+template< typename T >
+const enumerate_t< const T > enumerate( const T & ref ) {
+	return enumerate_t< const T >{ ref };
+}
+
+// -----------------------------------------------------------------------------
+template< typename OutType, typename Range, typename Functor >
+OutType map_range( const Range& range, Functor&& functor ) {
+	OutType out;
+
+	std::transform(
+		begin( range ),
+		end( range ),
+		std::back_inserter( out ),
+		std::forward< Functor >( functor )
+	);
+
+	return out;
+}
+
+// -----------------------------------------------------------------------------
+// Helper struct and function to support:
+// for ( auto val : group_iterate( container1, container2, ... ) ) { ... }
+// This iteraters through multiple containers of the same size.
+
+template<typename... Args>
+class group_iterate_t {
+	using Iterables = std::tuple<Args...>;
+	Iterables iterables;
+
+	// Getting the iterator and value types this way preserves const.
+	template<size_t I> using Iter = decltype(std::get<I>(iterables).begin());
+	template<size_t I> using Data = decltype(*std::get<I>(iterables).begin());
+	template<typename> struct base_iterator;
+
+	// This inner template puts the sequence of `0, 1, ... sizeof...(Args)-1`
+	// into a pack. These are the indexes into the tuples, so unpacking can
+	// go over each element of the tuple.
+	// The std::integer_sequence is just used to build that sequence.
+	// A library reference will probably explain it better than I can.
+	template<std::size_t... Indices>
+	struct base_iterator<std::integer_sequence<std::size_t, Indices...>> {
+		using value_type = std::tuple< Data<Indices>... >;
+		std::tuple<Iter<Indices>...> iterators;
+
+		base_iterator( Iter<Indices>... is ) : iterators( is... ) {}
+		base_iterator operator++() {
+			return base_iterator( ++std::get<Indices>( iterators )... );
+		}
+		bool operator!=( const base_iterator& other ) const {
+			return iterators != other.iterators;
+		}
+		value_type operator*() const {
+			return std::tie( *std::get<Indices>( iterators )... );
+		}
+
+		static base_iterator make_begin( Iterables & data ) {
+			return base_iterator( std::get<Indices>( data ).begin()... );
+		}
+		static base_iterator make_end( Iterables & data ) {
+			return base_iterator( std::get<Indices>( data ).end()... );
+		}
+	};
+
+public:
+	group_iterate_t( const Args &... args ) : iterables( args... ) {}
+
+	using iterator = base_iterator<decltype(
+		std::make_integer_sequence<std::size_t, sizeof...(Args)>())>;
+
+	iterator begin() { return iterator::make_begin( iterables ); }
+	iterator end() { return iterator::make_end( iterables ); }
+};
+
+// Helpers for the bounds checks (the non-varatic part of group_iterate):
+static inline void runGroupBoundsCheck(size_t size0, size_t size1) {
+	assertf( size0 == size1,
+		"group iteration requires containers of the same size: <%zd, %zd>.",
+		size0, size1 );
+}
+
+static inline void runGroupBoundsCheck(size_t size0, size_t size1, size_t size2) {
+	assertf( size0 == size1 && size1 == size2,
+		"group iteration requires containers of the same size: <%zd, %zd, %zd>.",
+		size0, size1, size2 );
+}
+
+/// Performs bounds check to ensure that all arguments are of the same length.
+template< typename... Args >
+group_iterate_t<Args...> group_iterate( Args &&... args ) {
+	runGroupBoundsCheck( args.size()... );
+	return group_iterate_t<Args...>( std::forward<Args>( args )... );
+}
+
+/// Does not perform a bounds check - requires user to ensure that iteration terminates when appropriate.
+template< typename... Args >
+group_iterate_t<Args...> unsafe_group_iterate( Args &&... args ) {
+	return group_iterate_t<Args...>( std::forward<Args>( args )... );
+}
+
+// -----------------------------------------------------------------------------
+// Helper struct and function to support
+// for ( val : lazy_map( container1, f ) ) {}
+// syntax to have a for each that iterates a container, mapping each element by applying f
+template< typename T, typename Func >
+struct lambda_iterate_t {
+	const T & ref;
+	std::function<Func> f;
+
+	struct iterator {
+		typedef decltype(begin(ref)) Iter;
+		Iter it;
+		std::function<Func> f;
+		iterator( Iter it, std::function<Func> f ) : it(it), f(f) {}
+		iterator & operator++() {
+			++it; return *this;
+		}
+		bool operator!=( const iterator &other ) const { return it != other.it; }
+		auto operator*() const -> decltype(f(*it)) { return f(*it); }
+	};
+
+	lambda_iterate_t( const T & ref, std::function<Func> f ) : ref(ref), f(f) {}
+
+	auto begin() const -> decltype(iterator(std::begin(ref), f)) { return iterator(std::begin(ref), f); }
+	auto end() const   -> decltype(iterator(std::end(ref), f)) { return iterator(std::end(ref), f); }
+};
+
+template< typename... Args >
+lambda_iterate_t<Args...> lazy_map( const Args &... args ) {
+	return lambda_iterate_t<Args...>( args...);
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/Common/module.mk
===================================================================
--- src/Common/module.mk	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/Common/module.mk	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -25,4 +25,5 @@
 	Common/ErrorObjects.h \
 	Common/Eval.cc \
+	Common/Eval.h \
 	Common/Examine.cc \
 	Common/Examine.h \
@@ -30,4 +31,5 @@
 	Common/Indenter.h \
 	Common/Indenter.cc \
+	Common/Iterate.hpp \
 	Common/PassVisitor.cc \
 	Common/PassVisitor.h \
Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/Common/utility.h	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// utility.h --
+// utility.h -- General utilities used across the compiler.
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Andrew Beach
-// Last Modified On : Thr Feb 16 12:35:00 2023
-// Update Count     : 52
+// Last Modified On : Fri Feb 17 15:25:00 2023
+// Update Count     : 53
 //
 
@@ -19,7 +19,5 @@
 #include <cctype>
 #include <algorithm>
-#include <functional>
 #include <iostream>
-#include <iterator>
 #include <list>
 #include <memory>
@@ -27,5 +25,4 @@
 #include <string>
 #include <type_traits>
-#include <utility>
 #include <vector>
 #include <cstring>										// memcmp
@@ -166,24 +163,4 @@
 
 #define toCString( ... ) toString( __VA_ARGS__ ).c_str()
-
-// replace element of list with all elements of another list
-template< typename T >
-void replace( std::list< T > &org, typename std::list< T >::iterator pos, std::list< T > &with ) {
-	typename std::list< T >::iterator next = pos; advance( next, 1 );
-
-	//if ( next != org.end() ) {
-	org.erase( pos );
-	org.splice( next, with );
-	//}
-
-	return;
-}
-
-// replace range of a list with a single element
-template< typename T >
-void replace( std::list< T > &org, typename std::list< T >::iterator begin, typename std::list< T >::iterator end, const T & with ) {
-	org.insert( begin, with );
-	org.erase( begin, end );
-}
 
 template< typename... Args >
@@ -213,37 +190,9 @@
 }
 
-template< typename... Args >
-auto zip(Args&&... args) -> decltype(zipWith(std::forward<Args>(args)..., std::make_pair)) {
-  return zipWith(std::forward<Args>(args)..., std::make_pair);
-}
-
-template< class InputIterator1, class InputIterator2, class OutputIterator, class BinFunction >
-void zipWith( InputIterator1 b1, InputIterator1 e1, InputIterator2 b2, InputIterator2 e2, OutputIterator out, BinFunction func ) {
-	while ( b1 != e1 && b2 != e2 )
-		*out++ = func(*b1++, *b2++);
-}
-
-// it's nice to actually be able to increment iterators by an arbitrary amount
-template< class InputIt, class Distance >
-InputIt operator+( InputIt it, Distance n ) {
-	advance(it, n);
-	return it;
-}
-
-template< typename T >
-void warn_single( const T & arg ) {
-	std::cerr << arg << std::endl;
-}
-
-template< typename T, typename... Params >
-void warn_single(const T & arg, const Params & ... params ) {
-	std::cerr << arg;
-	warn_single( params... );
-}
-
 template< typename... Params >
 void warn( const Params & ... params ) {
 	std::cerr << "Warning: ";
-	warn_single( params... );
+	toString_single( std::cerr, params... );
+	std::cerr << std::endl;
 }
 
@@ -251,30 +200,6 @@
 static inline bool isPrefix( const std::string & str, const std::string & pref, unsigned int start = 0 ) {
 	if ( pref.size() > str.size() ) return false;
-    return 0 == memcmp( str.c_str() + start, pref.c_str(), pref.size() );
-	// return prefix == full.substr(0, prefix.size()); // for future, requires c++17
-}
-
-// -----------------------------------------------------------------------------
-// Ref Counted Singleton class
-// Objects that inherit from this class will have at most one reference to it
-// but if all references die, the object will be deleted.
-
-template< typename ThisType >
-class RefCountSingleton {
-  public:
-	static std::shared_ptr<ThisType> get() {
-		if( global_instance.expired() ) {
-			std::shared_ptr<ThisType> new_instance = std::make_shared<ThisType>();
-			global_instance = new_instance;
-			return std::move(new_instance);
-		}
-		return global_instance.lock();
-	}
-  private:
-	static std::weak_ptr<ThisType> global_instance;
-};
-
-template< typename ThisType >
-std::weak_ptr<ThisType> RefCountSingleton<ThisType>::global_instance;
+	return pref == str.substr(start, pref.size());
+}
 
 // -----------------------------------------------------------------------------
@@ -333,210 +258,4 @@
 	~ValueGuardPtr() { if( ref ) { swap( *ref, old ); } }
 };
-
-// -----------------------------------------------------------------------------
-// Helper struct and function to support
-// for ( val : reverseIterate( container ) ) {}
-// syntax to have a for each that iterates backwards
-
-template< typename T >
-struct reverse_iterate_t {
-	T& ref;
-
-	reverse_iterate_t( T & ref ) : ref(ref) {}
-
-	// this does NOT work on const T!!!
-	// typedef typename T::reverse_iterator iterator;
-	auto begin() { return ref.rbegin(); }
-	auto end() { return ref.rend(); }
-};
-
-template< typename T >
-reverse_iterate_t< T > reverseIterate( T & ref ) {
-	return reverse_iterate_t< T >( ref );
-}
-
-template< typename T >
-struct enumerate_t {
-	template<typename val_t>
-	struct value_t {
-		val_t & val;
-		size_t idx;
-	};
-
-	template< typename iter_t, typename val_t >
-	struct iterator_t {
-		iter_t it;
-		size_t idx;
-
-		iterator_t( iter_t _it, size_t _idx ) : it(_it), idx(_idx) {}
-
-		value_t<val_t> operator*() const { return value_t<val_t>{ *it, idx }; }
-
-		bool operator==(const iterator_t & o) const { return o.it == it; }
-		bool operator!=(const iterator_t & o) const { return o.it != it; }
-
-		iterator_t & operator++() {
-			it++;
-			idx++;
-			return *this;
-		}
-
-		using difference_type   = typename std::iterator_traits< iter_t >::difference_type;
-		using value_type        = value_t<val_t>;
-		using pointer           = value_t<val_t> *;
-		using reference         = value_t<val_t> &;
-		using iterator_category = std::forward_iterator_tag;
-	};
-
-	T & ref;
-
-	using iterator = iterator_t< typename T::iterator, typename T::value_type >;
-	using const_iterator = iterator_t< typename T::const_iterator, const typename T::value_type >;
-
-	iterator begin() { return iterator( ref.begin(), 0 ); }
-	iterator end()   { return iterator( ref.end(), ref.size() ); }
-
-	const_iterator begin() const { return const_iterator( ref.cbegin(), 0 ); }
-	const_iterator end()   const { return const_iterator( ref.cend(), ref.size() ); }
-
-	const_iterator cbegin() const { return const_iterator( ref.cbegin(), 0 ); }
-	const_iterator cend()   const { return const_iterator( ref.cend(), ref.size() ); }
-};
-
-template< typename T >
-enumerate_t<T> enumerate( T & ref ) {
-	return enumerate_t< T >{ ref };
-}
-
-template< typename T >
-const enumerate_t< const T > enumerate( const T & ref ) {
-	return enumerate_t< const T >{ ref };
-}
-
-template< typename OutType, typename Range, typename Functor >
-OutType map_range( const Range& range, Functor&& functor ) {
-	OutType out;
-
-	std::transform(
-		begin( range ),
-		end( range ),
-		std::back_inserter( out ),
-		std::forward< Functor >( functor )
-	);
-
-	return out;
-}
-
-// -----------------------------------------------------------------------------
-// Helper struct and function to support:
-// for ( auto val : group_iterate( container1, container2, ... ) ) { ... }
-// This iteraters through multiple containers of the same size.
-
-template<typename... Args>
-class group_iterate_t {
-	using Iterables = std::tuple<Args...>;
-	Iterables iterables;
-
-	// Getting the iterator and value types this way preserves const.
-	template<size_t I> using Iter = decltype(std::get<I>(iterables).begin());
-	template<size_t I> using Data = decltype(*std::get<I>(iterables).begin());
-	template<typename> struct base_iterator;
-
-	// This inner template puts the sequence of `0, 1, ... sizeof...(Args)-1`
-	// into a pack. These are the indexes into the tuples, so unpacking can
-	// go over each element of the tuple.
-	// The std::integer_sequence is just used to build that sequence.
-	// A library reference will probably explain it better than I can.
-	template<std::size_t... Indices>
-	struct base_iterator<std::integer_sequence<std::size_t, Indices...>> {
-		using value_type = std::tuple< Data<Indices>... >;
-		std::tuple<Iter<Indices>...> iterators;
-
-		base_iterator( Iter<Indices>... is ) : iterators( is... ) {}
-		base_iterator operator++() {
-			return base_iterator( ++std::get<Indices>( iterators )... );
-		}
-		bool operator!=( const base_iterator& other ) const {
-			return iterators != other.iterators;
-		}
-		value_type operator*() const {
-			return std::tie( *std::get<Indices>( iterators )... );
-		}
-
-		static base_iterator make_begin( Iterables & data ) {
-			return base_iterator( std::get<Indices>( data ).begin()... );
-		}
-		static base_iterator make_end( Iterables & data ) {
-			return base_iterator( std::get<Indices>( data ).end()... );
-		}
-	};
-
-public:
-	group_iterate_t( const Args &... args ) : iterables( args... ) {}
-
-	using iterator = base_iterator<decltype(
-		std::make_integer_sequence<std::size_t, sizeof...(Args)>())>;
-
-	iterator begin() { return iterator::make_begin( iterables ); }
-	iterator end() { return iterator::make_end( iterables ); }
-};
-
-// Helpers for the bounds checks (the non-varatic part of group_iterate):
-static inline void runGroupBoundsCheck(size_t size0, size_t size1) {
-	assertf( size0 == size1,
-		"group iteration requires containers of the same size: <%zd, %zd>.",
-		size0, size1 );
-}
-
-static inline void runGroupBoundsCheck(size_t size0, size_t size1, size_t size2) {
-	assertf( size0 == size1 && size1 == size2,
-		"group iteration requires containers of the same size: <%zd, %zd, %zd>.",
-		size0, size1, size2 );
-}
-
-/// Performs bounds check to ensure that all arguments are of the same length.
-template< typename... Args >
-group_iterate_t<Args...> group_iterate( Args &&... args ) {
-	runGroupBoundsCheck( args.size()... );
-	return group_iterate_t<Args...>( std::forward<Args>( args )... );
-}
-
-/// Does not perform a bounds check - requires user to ensure that iteration terminates when appropriate.
-template< typename... Args >
-group_iterate_t<Args...> unsafe_group_iterate( Args &&... args ) {
-	return group_iterate_t<Args...>( std::forward<Args>( args )... );
-}
-
-// -----------------------------------------------------------------------------
-// Helper struct and function to support
-// for ( val : lazy_map( container1, f ) ) {}
-// syntax to have a for each that iterates a container, mapping each element by applying f
-template< typename T, typename Func >
-struct lambda_iterate_t {
-	const T & ref;
-	std::function<Func> f;
-
-	struct iterator {
-		typedef decltype(begin(ref)) Iter;
-		Iter it;
-		std::function<Func> f;
-		iterator( Iter it, std::function<Func> f ) : it(it), f(f) {}
-		iterator & operator++() {
-			++it; return *this;
-		}
-		bool operator!=( const iterator &other ) const { return it != other.it; }
-		auto operator*() const -> decltype(f(*it)) { return f(*it); }
-	};
-
-	lambda_iterate_t( const T & ref, std::function<Func> f ) : ref(ref), f(f) {}
-
-	auto begin() const -> decltype(iterator(std::begin(ref), f)) { return iterator(std::begin(ref), f); }
-	auto end() const   -> decltype(iterator(std::end(ref), f)) { return iterator(std::end(ref), f); }
-};
-
-template< typename... Args >
-lambda_iterate_t<Args...> lazy_map( const Args &... args ) {
-	return lambda_iterate_t<Args...>( args...);
-}
 
 // -----------------------------------------------------------------------------
@@ -560,48 +279,4 @@
 } // ilog2
 
-// -----------------------------------------------------------------------------
-/// evaluates expr as a long long int. If second is false, expr could not be evaluated
-std::pair<long long int, bool> eval(const Expression * expr);
-
-namespace ast {
-	class Expr;
-}
-
-std::pair<long long int, bool> eval(const ast::Expr * expr);
-
-// -----------------------------------------------------------------------------
-/// Reorders the input range in-place so that the minimal-value elements according to the
-/// comparator are in front;
-/// returns the iterator after the last minimal-value element.
-template<typename Iter, typename Compare>
-Iter sort_mins( Iter begin, Iter end, Compare& lt ) {
-	if ( begin == end ) return end;
-
-	Iter min_pos = begin;
-	for ( Iter i = begin + 1; i != end; ++i ) {
-		if ( lt( *i, *min_pos ) ) {
-			// new minimum cost; swap into first position
-			min_pos = begin;
-			std::iter_swap( min_pos, i );
-		} else if ( ! lt( *min_pos, *i ) ) {
-			// duplicate minimum cost; swap into next minimum position
-			++min_pos;
-			std::iter_swap( min_pos, i );
-		}
-	}
-	return ++min_pos;
-}
-
-template<typename Iter, typename Compare>
-inline Iter sort_mins( Iter begin, Iter end, Compare&& lt ) {
-	return sort_mins( begin, end, lt );
-}
-
-/// sort_mins defaulted to use std::less
-template<typename Iter>
-inline Iter sort_mins( Iter begin, Iter end ) {
-	return sort_mins( begin, end, std::less<typename std::iterator_traits<Iter>::value_type>{} );
-}
-
 // Local Variables: //
 // tab-width: 4 //
Index: src/ResolvExpr/CurrentObject.cc
===================================================================
--- src/ResolvExpr/CurrentObject.cc	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/ResolvExpr/CurrentObject.cc	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -26,6 +26,7 @@
 #include "AST/Init.hpp"                // for Designation
 #include "AST/Node.hpp"                // for readonly
-#include "AST/Print.hpp"                // for readonly
+#include "AST/Print.hpp"               // for readonly
 #include "AST/Type.hpp"
+#include "Common/Eval.h"               // for eval
 #include "Common/Indenter.h"           // for Indenter, operator<<
 #include "Common/SemanticError.h"      // for SemanticError
Index: src/ResolvExpr/ResolveAssertions.cc
===================================================================
--- src/ResolvExpr/ResolveAssertions.cc	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/ResolvExpr/ResolveAssertions.cc	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -30,5 +30,4 @@
 #include "Common/FilterCombos.h"    // for filterCombos
 #include "Common/Indenter.h"        // for Indenter
-#include "Common/utility.h"         // for sort_mins
 #include "GenPoly/GenPoly.h"        // for getFunctionType
 #include "ResolvExpr/AlternativeFinder.h"  // for computeConversionCost
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/ResolvExpr/Resolver.cc	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -38,4 +38,5 @@
 #include "AST/SymbolTable.hpp"
 #include "AST/Type.hpp"
+#include "Common/Eval.h"                 // for eval
 #include "Common/PassVisitor.h"          // for PassVisitor
 #include "Common/SemanticError.h"        // for SemanticError
Index: src/ResolvExpr/Resolver.h
===================================================================
--- src/ResolvExpr/Resolver.h	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/ResolvExpr/Resolver.h	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -34,4 +34,5 @@
 	class Decl;
 	class DeletedExpr;
+	class Expr;
 	class Init;
 	class StmtExpr;
Index: src/SynTree/AggregateDecl.cc
===================================================================
--- src/SynTree/AggregateDecl.cc	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/SynTree/AggregateDecl.cc	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -19,4 +19,5 @@
 
 #include "Attribute.h"           // for Attribute
+#include "Common/Eval.h"         // for eval
 #include "Common/utility.h"      // for printAll, cloneAll, deleteAll
 #include "Declaration.h"         // for AggregateDecl, TypeDecl, Declaration
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/SynTree/Type.h	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -23,5 +23,6 @@
 
 #include "BaseSyntaxNode.h"  // for BaseSyntaxNode
-#include "Common/utility.h"  // for operator+
+#include "Common/Iterate.hpp"// for operator+
+#include "Common/utility.h"  // for toCString
 #include "Mutator.h"         // for Mutator
 #include "SynTree.h"         // for AST nodes
Index: src/Validate/HandleAttributes.cc
===================================================================
--- src/Validate/HandleAttributes.cc	(revision 692c1cc34a498a7e67b3530da9dae4fecc12439c)
+++ src/Validate/HandleAttributes.cc	(revision 56bb2e12591b8292ab8c8005f3bdb91bd4d89a89)
@@ -17,4 +17,5 @@
 
 #include "CompilationState.h"
+#include "Common/Eval.h"
 #include "Common/PassVisitor.h"
 #include "Common/SemanticError.h"
