Index: libcfa/src/bits/collection.hfa
===================================================================
--- libcfa/src/bits/collection.hfa	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ libcfa/src/bits/collection.hfa	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -7,4 +7,6 @@
 
 inline {
+	// PUBLIC
+
 	void ?{}( Colable & co ) with( co ) {
 		next = 0p;
@@ -16,7 +18,9 @@
 	}
 
-	Colable * getNext( Colable & co ) with( co ) {
-		return next;
+	Colable & getNext( Colable & co ) with( co ) {
+		return *next;
 	}
+
+	// PRIVATE
 
 	Colable *& Next( Colable * cp ) {
@@ -24,4 +28,5 @@
 	}
 
+	// wrappers to make Collection have T
 	forall( dtype T ) {
 		T *& Next( T * n ) {
Index: libcfa/src/bits/multi_list.cfa
===================================================================
--- libcfa/src/bits/multi_list.cfa	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ libcfa/src/bits/multi_list.cfa	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -57,5 +57,5 @@
 
 	SeqIter(TaskDL) sqiter;
-	TaskDL & dl;
+	TaskDL & dl;										// iterator index
 	TaskSL & sl;
 
Index: libcfa/src/bits/queue.hfa
===================================================================
--- libcfa/src/bits/queue.hfa	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ libcfa/src/bits/queue.hfa	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -28,14 +28,14 @@
 
 		T * succ( Queue(T) & q, T * n ) with( q ) {		// pre: *n in *q
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( ! listed( n ) ) abort( "(Queue &)%p.succ( %p ) : Node is not on a list.", &q, n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			return (Next( n ) == n) ? 0p : Next( n );
 		} // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *q
 
 		void addHead( Queue(T) & q, T & n ) with( q ) {
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( listed( &n ) ) abort( "(Queue &)%p.addHead( %p ) : Node is already on another list.", &q, &n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			if ( last ) {
 				Next( &n ) = &head( q );
@@ -43,16 +43,16 @@
 			} else {
 				root = last = &n;
-				Next( &n ) = &n;							// last node points to itself
+				Next( &n ) = &n;						// last node points to itself
 			}
 		}
 
 		void addTail( Queue(T) & q, T & n ) with( q ) {
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( listed( &n ) ) abort( "(Queue &)%p.addTail( %p ) : Node is already on another list.", &q, &n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			if ( last ) Next( last ) = &n;
 			else root = &n;
 			last = &n;
-			Next( &n ) = &n;								// last node points to itself
+			Next( &n ) = &n;							// last node points to itself
 		}
 
@@ -78,7 +78,7 @@
 
 		void remove( Queue(T) & q, T & n ) with( q ) {	// O(n)
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( ! listed( (Colable &)n ) ) abort( "(Queue &)%p.remove( %p ) : Node is not on a list.", &q, &n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			T * prev = 0p;
 			T * curr = (T *)root;
@@ -96,8 +96,8 @@
 					break;
 				}
-#ifdef __CFA_DEBUG__
 				// not found => error
-				if (curr == last) abort( "(Queue &)%p.remove( %p ) : Node is not in list.", &q, &n );
-#endif // __CFA_DEBUG__
+				#ifdef __CFA_DEBUG__
+				if ( curr == last ) abort( "(Queue &)%p.remove( %p ) : Node is not in list.", &q, &n );
+				#endif // __CFA_DEBUG__
 				prev = curr;
 				curr = Next( curr );
@@ -125,7 +125,7 @@
 		// Node "n" must be in the "from" list.
 		void split( Queue(T) & q, Queue(T) & from, T & n ) with( q ) {
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( ! listed( (Colable &)n ) ) abort( "(Queue &)%p.split( %p ) : Node is not on a list.", &q, &n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			Queue(T) to;
 			to.root = from.root;						// start of "to" list
@@ -177,6 +177,2 @@
 	} // distribution
 } // distribution
-
-// Local Variables: //
-// compile-command: "cfa queue.cfa" //
-// End: //
Index: libcfa/src/bits/queue_example.cfa
===================================================================
--- libcfa/src/bits/queue_example.cfa	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ libcfa/src/bits/queue_example.cfa	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -107,6 +107,2 @@
 	}
 }
-
-// Local Variables: //
-// compile-command: "cfa queue_example.cfa" //
-// End: //
Index: libcfa/src/bits/sequence.hfa
===================================================================
--- libcfa/src/bits/sequence.hfa	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ libcfa/src/bits/sequence.hfa	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -9,6 +9,8 @@
 
 inline {
+	// PUBLIC
+
 	void ?{}( Seqable & sq ) with( sq ) {
-		((Colable &) sq){};
+		((Colable &)sq){};
 		back = 0p;
 	} // post: ! listed()
@@ -18,7 +20,16 @@
 	}
 
+	// PRIVATE
+
 	Seqable *& Back( Seqable * sq ) {
 		return sq->back;
 	}
+
+	// wrappers to make Collection have T
+	forall( dtype T ) {
+		T *& Back( T * n ) {
+			return (T *)Back( (Seqable *)n );
+		}
+	} // distribution
 } // distribution
 
@@ -34,13 +45,9 @@
 		} // post: empty() & head() == 0 | !empty() & head() in *s
 
-		T *& Back( T * n ) {
-			return (T *)Back( (Seqable *)n );
-		}
-
 		void ?{}( Sequence(T) &, const Sequence(T) & ) = void; // no copy
 		Sequence(T) & ?=?( const Sequence(T) & ) = void; // no assignment
 
 		void ?{}( Sequence(T) & s ) with( s ) {	
-			((Collection &) s){};
+			((Collection &)s){};
 		}	// post: isEmpty().
 
@@ -50,9 +57,9 @@
 		}	// post: empty() & tail() == 0 | !empty() & tail() in *s
 
-		// Return a pointer to the element after *n, or 0p if there isn't one.
+		// Return a pointer to the element after *n, or 0p if list empty.
 		T * succ( Sequence(T) & s, T * n ) with( s ) {	// pre: *n in *s
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( ! listed( n ) ) abort( "(Sequence &)%p.succ( %p ) : Node is not on a list.", &s, n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			return Next( n ) == &head( s ) ? 0p : Next( n );
 		} // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *s
@@ -60,7 +67,7 @@
 		// Return a pointer to the element before *n, or 0p if there isn't one.
 		T * pred( Sequence(T) & s, T * n ) with( s ) {	// pre: *n in *s
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( ! listed( n ) ) abort( "(Sequence &)%p.pred( %p ) : Node is not on a list.", &s, n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			return n == &head( s ) ? 0p : Back( n );
 		}	// post: n == head() & head(n) == 0 | n != head() & *pred(n) in *s
@@ -69,7 +76,7 @@
 		// Insert *n into the sequence before *bef, or at the end if bef == 0.
 		void insertBef( Sequence(T) & s, T & n, T & bef ) with( s ) { // pre: !n->listed() & *bef in *s
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( listed( &n ) ) abort( "(Sequence &)%p.insertBef( %p, %p ) : Node is already on another list.", &s, n, &bef );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			if ( &bef == &head( s ) ) {					// must change root
 				if ( root ) {
@@ -101,7 +108,7 @@
 		// Insert *n into the sequence after *aft, or at the beginning if aft == 0.
 		void insertAft( Sequence(T) & s, T & aft, T & n ) with( s ) {	// pre: !n->listed() & *aft in *s
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( listed( &n ) ) abort( "(Sequence &)%p.insertAft( %p, %p ) : Node is already on another list.", &s, &aft, &n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			if ( ! &aft ) {								// must change root
 				if ( root ) {
@@ -130,7 +137,7 @@
 		// pre: n->listed() & *n in *s
 		void remove( Sequence(T) & s, T & n ) with( s ) { // O(1)
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( ! listed( &n ) ) abort( "(Sequence &)%p.remove( %p ) : Node is not on a list.", &s, &n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			if ( &n == &head( s ) ) {
 				if ( Next( &head( s ) ) == &head( s ) ) root = 0p;
@@ -188,7 +195,7 @@
 		// Node "n" must be in the "from" list.
 		void split( Sequence(T) & s, Sequence(T) & from, T & n ) with( s ) {
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( ! listed( &n ) ) abort( "(Sequence &)%p.split( %p ) : Node is not on a list.", &s, &n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			Sequence(T) to;
 			to.root = from.root;						// start of "to" list
@@ -199,5 +206,5 @@
 				Back( &head( from ) ) = Back( &head( to ) ); // fix "from" list
 		 		Next( Back( &head( to ) ) ) = &head( from );
-				Next( &n ) = &head( to );					// fix "to" list
+				Next( &n ) = &head( to );				// fix "to" list
 				Back( &head( to ) ) = &n;
 			} // if
@@ -214,5 +221,5 @@
 		// passing the sequence, traversing would require its length. Thus the iterator needs a pointer to the sequence
 		// to pass to succ/pred. Both stack and queue just encounter 0p since the lists are not circular.
-		Sequence(T) * seq;
+		Sequence(T) * seq;								// FIX ME: cannot be reference
 	};
 
@@ -224,5 +231,5 @@
 
 		void ?{}( SeqIter(T) & si, Sequence(T) & s ) with( si ) {
-			((ColIter &) si){};
+			((ColIter &)si){};
 			seq = &s;
 			curr = &head( s );
@@ -230,5 +237,5 @@
 
 		void ?{}( SeqIter(T) & si, Sequence(T) & s, T & start ) with( si ) {
-			((ColIter &) si){};
+			((ColIter &)si){};
 			seq = &s;
 			curr = &start;
@@ -255,15 +262,15 @@
 		inline ColIter;
 		// See above for explanation.
-		Sequence(T) * seq;
+		Sequence(T) * seq;								// FIX ME: cannot be reference
 	};
 
 	inline {
 		void ?{}( SeqIterRev(T) & si ) with( si ) {	
-			((ColIter &) si){};
+			((ColIter &)si){};
 			seq = 0p;
 		} // post: elts = null.
 
 		void ?{}( SeqIterRev(T) & si, Sequence(T) & s ) with( si ) {	
-			((ColIter &) si){};
+			((ColIter &)si){};
 			seq = &s;
 			curr = &tail( s );
@@ -271,5 +278,5 @@
 
 		void ?{}( SeqIterRev(T) & si, Sequence(T) & s, T & start ) with( si ) {	
-			((ColIter &) si){};
+			((ColIter &)si){};
 			seq = &s;
 			curr = &start;
@@ -291,6 +298,2 @@
 	} // distribution
 } // distribution
-
-// Local Variables: //
-// compile-command: "cfa sequence.hfa" //
-// End: //
Index: libcfa/src/bits/sequence_example.cfa
===================================================================
--- libcfa/src/bits/sequence_example.cfa	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ libcfa/src/bits/sequence_example.cfa	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -137,6 +137,2 @@
 	}
 }
-
-// Local Variables: //
-// compile-command: "cfa sequence_example.cfa" //
-// End: //
Index: libcfa/src/bits/stack.hfa
===================================================================
--- libcfa/src/bits/stack.hfa	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ libcfa/src/bits/stack.hfa	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -26,7 +26,7 @@
 
 		void addHead( Stack(T) & s, T & n ) with( s ) {
-#ifdef __CFA_DEBUG__
+			#ifdef __CFA_DEBUG__
 			if ( listed( (Colable &)(n) ) ) abort( "(Stack &)%p.addHead( %p ) : Node is already on another list.", &s, n );
-#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			Next( &n ) = &head( s ) ? &head( s ) : &n;
 			root = &n;
@@ -44,5 +44,5 @@
 			T & t = head( s );
 			if ( root ) {
-				root = ( T *)Next(root);
+				root = ( T *)Next( root );
 				if ( &head( s ) == &t ) root = 0p;		// only one element ?
 				Next( &t ) = 0p;
@@ -92,6 +92,2 @@
 	} // distribution
 } // distribution
-
-// Local Variables: //
-// compile-command: "make install" //
-// End: //
Index: libcfa/src/bits/stack_example.cfa
===================================================================
--- libcfa/src/bits/stack_example.cfa	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ libcfa/src/bits/stack_example.cfa	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -107,6 +107,2 @@
 	}
 }
-
-// Local Variables: //
-// compile-command: "cfa stack_example.cfa" //
-// End: //
Index: src/Common/CodeLocationTools.cpp
===================================================================
--- src/Common/CodeLocationTools.cpp	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
+++ src/Common/CodeLocationTools.cpp	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -0,0 +1,124 @@
+//
+// 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.
+//
+// CodeLocationTools.cpp -- Additional tools for code locations.
+//
+// Author           : Andrew Beach
+// Created On       : Fri Dec  4 15:42:00 2020
+// Last Modified By : Andrew Beach
+// Last Modified On : Mon Dec  7 15:15:00 2020
+// Update Count     : 0
+//
+
+#include "CodeLocationTools.hpp"
+
+#include <type_traits>
+
+#include "AST/Pass.hpp"
+#include "AST/TranslationUnit.hpp"
+#include "Common/CodeLocation.h"
+
+namespace {
+
+template<typename node_t>
+struct has_code_location : public std::is_base_of<ast::ParseNode, node_t> {};
+
+template<typename node_t, bool has_location>
+struct __GetCL;
+
+template<typename node_t>
+struct __GetCL<node_t, true> {
+	static inline CodeLocation const * get( node_t const * node ) {
+		return &node->location;
+	}
+
+	static inline CodeLocation * get( node_t * node ) {
+		return &node->location;
+	}
+};
+
+template<typename node_t>
+struct __GetCL<node_t, false> {
+	static inline CodeLocation * get( node_t const * ) {
+		return nullptr;
+	}
+};
+
+template<typename node_t>
+CodeLocation const * get_code_location( node_t const * node ) {
+	return __GetCL< node_t, has_code_location< node_t >::value >::get( node );
+}
+
+template<typename node_t>
+CodeLocation * get_code_location( node_t * node ) {
+	return __GetCL< node_t, has_code_location< node_t >::value >::get( node );
+}
+
+// Fill every location with a nearby (parent) location.
+class FillCore : public ast::WithGuards {
+	CodeLocation const * parent;
+public:
+	FillCore() : parent( nullptr ) {}
+
+	template<typename node_t>
+	node_t const * previsit( node_t const * node ) {
+		GuardValue( parent );
+		CodeLocation const * location = get_code_location( node );
+		if ( location && location->isUnset() ) {
+			assert( parent );
+			node_t * newNode = ast::mutate( node );
+			CodeLocation * newLocation = get_code_location( newNode );
+			assert( newLocation );
+			*newLocation = *parent;
+			parent = newLocation;
+			return newNode;
+		} else if ( location ) {
+			parent = location;
+		}
+		return node;
+	}
+};
+
+// Collect pointers to all the nodes with unset code locations.
+class CollectCore {
+	std::list< ast::ptr< ast::Node > > & unset;
+public:
+	CollectCore( std::list< ast::ptr< ast::Node > > & unset ) :
+		unset( unset )
+	{}
+
+	template<typename node_t>
+	void previsit( node_t const * node ) {
+		CodeLocation const * location = get_code_location( node );
+		if ( location && location->isUnset() ) {
+			unset.push_back( node );
+		}
+	}
+};
+
+} // namespace
+
+void checkAllCodeLocations( ast::TranslationUnit const & unit ) {
+	std::list< ast::ptr< ast::Node > > unsetNodes;
+	{
+		ast::Pass<CollectCore> collector( unsetNodes );
+		for ( auto node : unit.decls ) {
+			node->accept( collector );
+		}
+	}
+	if ( unsetNodes.empty() ) {
+		return;
+	}
+
+	std::cerr << "Total nodes without a set code location: "
+		<< unsetNodes.size() << std::endl;
+
+	assert( unsetNodes.empty() );
+}
+
+void forceFillCodeLocations( ast::TranslationUnit & unit ) {
+	ast::Pass<FillCore>::run( unit );
+}
Index: src/Common/CodeLocationTools.hpp
===================================================================
--- src/Common/CodeLocationTools.hpp	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
+++ src/Common/CodeLocationTools.hpp	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -0,0 +1,29 @@
+//
+// 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.
+//
+// CodeLocationTools.hpp -- Additional tools for code locations.
+//
+// Author           : Andrew Beach
+// Created On       : Fri Dec  4 15:35:00 2020
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Dec  4 16:18:00 2020
+// Update Count     : 0
+//
+
+#pragma once
+
+// Additional tools for code locations.
+
+namespace ast {
+	struct TranslationUnit;
+}
+
+/// Search the translation unit for unset code locations and print information
+/// on them. Abort if any unset code locations are found.
+void checkAllCodeLocations( ast::TranslationUnit const & unit );
+
+// Assign a nearby code-location to any unset code locations in the forest.
+void forceFillCodeLocations( ast::TranslationUnit & unit );
Index: src/Common/module.mk
===================================================================
--- src/Common/module.mk	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ src/Common/module.mk	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -18,4 +18,6 @@
       Common/Assert.cc \
       Common/CodeLocation.h \
+      Common/CodeLocationTools.hpp \
+      Common/CodeLocationTools.cpp \
       Common/CompilerError.h \
       Common/Debug.h \
Index: src/main.cc
===================================================================
--- src/main.cc	(revision 33a129a073c822863cde7aa42ee208fcb6123ad2)
+++ src/main.cc	(revision 3f917925807c38d75c18f4c6f071168a7136c6e5)
@@ -10,6 +10,6 @@
 // Created On       : Fri May 15 23:12:02 2015
 // Last Modified By : Andrew Beach
-// Last Modified On : Tue Dec  1 14:52:00 2020
-// Update Count     : 638
+// Last Modified On : Mon Dec  7 15:29:00 2020
+// Update Count     : 639
 //
 
@@ -40,4 +40,5 @@
 #include "CodeTools/ResolvProtoDump.h"      // for dumpAsResolvProto
 #include "CodeTools/TrackLoc.h"             // for fillLocations
+#include "Common/CodeLocationTools.hpp"     // for forceFillCodeLocations
 #include "Common/CompilerError.h"           // for CompilerError
 #include "Common/Stats.h"
@@ -353,9 +354,5 @@
 			} // if
 
-			// TODO: This is a quick fix to get the build working.
-			// Get rid of fillLocations or at least make a new-ast version.
-			translationUnit = convert( move( transUnit ) );
-			CodeTools::fillLocations( translationUnit );
-			transUnit = convert( move( translationUnit ) );
+			forceFillCodeLocations( transUnit );
 
 			PASS( "Fix Init", InitTweak::fix(transUnit, buildingLibrary()));
