Index: src/GenPoly/Lvalue.cc
===================================================================
--- src/GenPoly/Lvalue.cc	(revision 801978b5b1723c9d972a705d0172df3c7cfc721f)
+++ src/GenPoly/Lvalue.cc	(revision 373aad760273872fddca861a394d29df7f2c0882)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Dec 13 23:14:38 2019
-// Update Count     : 7
+// Last Modified By : Andrew Beach
+// Last Modified On : Mon May 16 14:09:00 2022
+// Update Count     : 8
 //
 
@@ -125,9 +125,6 @@
 	} // namespace
 
-	static bool referencesEliminated = false;
-	// used by UntypedExpr::createDeref to determine whether result type of dereference should be ReferenceType or value type.
-	bool referencesPermissable() {
-		return ! referencesEliminated;
-	}
+	// Stored elsewhere (Lvalue2, initially false).
+	extern bool referencesEliminated;
 
 	void convertLvalue( std::list< Declaration* > & translationUnit ) {
Index: src/GenPoly/Lvalue2.cc
===================================================================
--- src/GenPoly/Lvalue2.cc	(revision 373aad760273872fddca861a394d29df7f2c0882)
+++ src/GenPoly/Lvalue2.cc	(revision 373aad760273872fddca861a394d29df7f2c0882)
@@ -0,0 +1,26 @@
+//
+// 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.
+//
+// Lvalue2.cc -- Seperate Lvalue module for linking.
+//
+// Author           : Andrew Beach
+// Created On       : Mon May 16 14:05:00 2022
+// Last Modified By : Andrew Beach
+// Last Modified On : Mon May 16 14:05:00 2022
+// Update Count     : 0
+//
+
+namespace GenPoly {
+
+bool referencesEliminated = false;
+
+/// Are reference types still allowed in the AST?
+bool referencesPermissable() {
+	return !referencesEliminated;
+}
+
+
+}
Index: src/GenPoly/module.mk
===================================================================
--- src/GenPoly/module.mk	(revision 801978b5b1723c9d972a705d0172df3c7cfc721f)
+++ src/GenPoly/module.mk	(revision 373aad760273872fddca861a394d29df7f2c0882)
@@ -10,26 +10,29 @@
 ## Author           : Richard C. Bilson
 ## Created On       : Mon Jun  1 17:49:17 2015
-## Last Modified By : Peter A. Buhr
-## Last Modified On : Mon Jun  1 17:52:30 2015
-## Update Count     : 1
+## Last Modified By : Andrew Beach
+## Last Modified On : Tue May 17 14:31:00 2022
+## Update Count     : 2
 ###############################################################################
 
-SRC += GenPoly/Box.cc \
-       GenPoly/Box.h \
-       GenPoly/ErasableScopedMap.h \
-       GenPoly/FindFunction.cc \
-       GenPoly/FindFunction.h \
-       GenPoly/GenPoly.cc \
-       GenPoly/GenPoly.h \
-       GenPoly/InstantiateGeneric.cc \
-       GenPoly/InstantiateGeneric.h \
-       GenPoly/Lvalue.cc \
-       GenPoly/Lvalue.h \
-       GenPoly/ScopedSet.h \
-       GenPoly/ScrubTyVars.cc \
-       GenPoly/ScrubTyVars.h \
-       GenPoly/Specialize.cc \
-       GenPoly/Specialize.h
+SRC_GENPOLY = \
+	GenPoly/GenPoly.cc \
+	GenPoly/GenPoly.h \
+	GenPoly/Lvalue2.cc \
+	GenPoly/Lvalue.h
 
-SRCDEMANGLE += GenPoly/GenPoly.cc GenPoly/GenPoly.h GenPoly/Lvalue.cc GenPoly/Lvalue.h
+SRC += $(SRC_GENPOLY) \
+	GenPoly/Box.cc \
+	GenPoly/Box.h \
+	GenPoly/ErasableScopedMap.h \
+	GenPoly/FindFunction.cc \
+	GenPoly/FindFunction.h \
+	GenPoly/InstantiateGeneric.cc \
+	GenPoly/InstantiateGeneric.h \
+	GenPoly/Lvalue.cc \
+	GenPoly/ScopedSet.h \
+	GenPoly/ScrubTyVars.cc \
+	GenPoly/ScrubTyVars.h \
+	GenPoly/Specialize.cc \
+	GenPoly/Specialize.h
 
+SRCDEMANGLE += $(SRC_GENPOLY)
