Index: .gitignore
===================================================================
--- .gitignore	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ .gitignore	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -28,7 +28,8 @@
 
 # src executables, for lib and bin
-src/driver/cc1
+src/driver/as
 src/driver/cfa
 src/driver/cfa-cpp
+src/driver/cc1
 
 src/prelude/bootloader.c
Index: driver/Makefile.am
===================================================================
--- driver/Makefile.am	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ driver/Makefile.am	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -11,6 +11,6 @@
 ## Created On       : Sun May 31 08:49:31 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Mon Apr 30 17:44:17 2018
-## Update Count     : 11
+## Last Modified On : Thu Aug  2 12:18:25 2018
+## Update Count     : 14
 ###############################################################################
 
@@ -35,9 +35,7 @@
 # put into lib for now
 cc1libdir = ${CFA_LIBDIR}
-cc1lib_PROGRAMS = cc1
+cc1lib_PROGRAMS = as cc1
+as_SOURCES = as.cc
 cc1_SOURCES = cc1.cc
 
-# cfa-cpp$(EXEEXT): $(top_builddir)/driver/cfa-cpp$(EXEEXT)
-# 	cp $(<) $(@)
-
 MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME) @CFA_PREFIX@/lib/${cc1lib_PROGRAMS}
Index: driver/Makefile.in
===================================================================
--- driver/Makefile.in	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ driver/Makefile.in	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -93,5 +93,5 @@
 host_triplet = @host@
 noinst_PROGRAMS = cfa$(EXEEXT)
-cc1lib_PROGRAMS = cc1$(EXEEXT)
+cc1lib_PROGRAMS = as$(EXEEXT) cc1$(EXEEXT)
 subdir = driver
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -107,4 +107,7 @@
 am__installdirs = "$(DESTDIR)$(cc1libdir)"
 PROGRAMS = $(cc1lib_PROGRAMS) $(noinst_PROGRAMS)
+am_as_OBJECTS = as.$(OBJEXT)
+as_OBJECTS = $(am_as_OBJECTS)
+as_LDADD = $(LDADD)
 am_cc1_OBJECTS = cc1.$(OBJEXT)
 cc1_OBJECTS = $(am_cc1_OBJECTS)
@@ -142,6 +145,6 @@
 am__v_CXXLD_0 = @echo "  CXXLD   " $@;
 am__v_CXXLD_1 = 
-SOURCES = $(cc1_SOURCES) $(cfa_SOURCES)
-DIST_SOURCES = $(cc1_SOURCES) $(cfa_SOURCES)
+SOURCES = $(as_SOURCES) $(cc1_SOURCES) $(cfa_SOURCES)
+DIST_SOURCES = $(as_SOURCES) $(cc1_SOURCES) $(cfa_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
@@ -302,8 +305,6 @@
 # put into lib for now
 cc1libdir = ${CFA_LIBDIR}
+as_SOURCES = as.cc
 cc1_SOURCES = cc1.cc
-
-# cfa-cpp$(EXEEXT): $(top_builddir)/driver/cfa-cpp$(EXEEXT)
-# 	cp $(<) $(@)
 MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME) @CFA_PREFIX@/lib/${cc1lib_PROGRAMS}
 all: all-am
@@ -386,4 +387,8 @@
 	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
 
+as$(EXEEXT): $(as_OBJECTS) $(as_DEPENDENCIES) $(EXTRA_as_DEPENDENCIES) 
+	@rm -f as$(EXEEXT)
+	$(AM_V_CXXLD)$(CXXLINK) $(as_OBJECTS) $(as_LDADD) $(LIBS)
+
 cc1$(EXEEXT): $(cc1_OBJECTS) $(cc1_DEPENDENCIES) $(EXTRA_cc1_DEPENDENCIES) 
 	@rm -f cc1$(EXEEXT)
@@ -400,4 +405,5 @@
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/as.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cc1.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfa.Po@am__quote@
Index: driver/cfa.cc
===================================================================
--- driver/cfa.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ driver/cfa.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -402,4 +402,8 @@
 		args[nargs] = "--undefined=__cfaabi_appready_startup";
 		nargs += 1;
+		args[nargs] = "-Xlinker";
+		nargs += 1;
+		args[nargs] = "--undefined=__cfaabi_dbg_record";
+		nargs += 1;
 
 		// include the cfa library in case it's needed
Index: libcfa/prelude/builtins.c
===================================================================
--- libcfa/prelude/builtins.c	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ libcfa/prelude/builtins.c	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -10,6 +10,6 @@
 // Created On       : Fri Jul 21 16:21:03 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb  8 12:47:59 2018
-// Update Count     : 19
+// Last Modified On : Sun Aug  5 21:40:38 2018
+// Update Count     : 20
 //
 
@@ -22,5 +22,5 @@
 
 void exit( int status, const char fmt[], ... ) __attribute__ (( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ ));
-void abort ( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
+void abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
 
 // increment/decrement unification
Index: libcfa/src/bits/locks.hfa
===================================================================
--- libcfa/src/bits/locks.hfa	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ libcfa/src/bits/locks.hfa	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -64,4 +64,10 @@
 		extern void disable_interrupts();
 		extern void enable_interrupts_noPoll();
+
+		#ifdef __CFA_DEBUG__
+			void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name);
+		#else
+			#define __cfaabi_dbg_record(x, y)
+		#endif
 	}
 
@@ -71,11 +77,4 @@
 		this.lock = 0;
 	}
-
-
-	#ifdef __CFA_DEBUG__
-		void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name);
-	#else
-		#define __cfaabi_dbg_record(x, y)
-	#endif
 
 	// Lock the spinlock, return false if already acquired
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ libcfa/src/concurrency/kernel.cfa	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -833,7 +833,9 @@
 // Debug
 __cfaabi_dbg_debug_do(
-	void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name) {
-		this.prev_name = prev_name;
-		this.prev_thrd = kernelTLS.this_thread;
+	extern "C" {
+		void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name) {
+			this.prev_name = prev_name;
+			this.prev_thrd = kernelTLS.this_thread;
+		}
 	}
 )
Index: libcfa/src/startup.cfa
===================================================================
--- libcfa/src/startup.cfa	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ libcfa/src/startup.cfa	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -40,5 +40,7 @@
 
 struct __spinlock_t;
-void __cfaabi_dbg_record(struct __spinlock_t & this, const char * prev_name) __attribute__(( weak )) {}
+extern "C" {
+	void __cfaabi_dbg_record(struct __spinlock_t & this, const char * prev_name) __attribute__(( weak )) {}
+}
 
 // Local Variables: //
Index: src/CodeGen/GenType.cc
===================================================================
--- src/CodeGen/GenType.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/CodeGen/GenType.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -27,7 +27,6 @@
 namespace CodeGen {
 	struct GenType : public WithVisitorRef<GenType>, public WithShortCircuiting {
-		GenType( const std::string &typeString, bool pretty = false, bool genC = false, bool lineMarks = false );
-		std::string get_typeString() const { return typeString; }
-		void set_typeString( const std::string &newValue ) { typeString = newValue; }
+		std::string typeString;
+		GenType( const std::string &typeString, bool pretty, bool genC, bool lineMarks );
 
 		void previsit( BaseSyntaxNode * );
@@ -58,8 +57,7 @@
 		void genArray( const Type::Qualifiers &qualifiers, Type *base, Expression *dimension, bool isVarLen, bool isStatic );
 
-		std::string typeString;
-		bool pretty = false; // pretty print
-		bool genC = false;   // generating C code?
-		bool lineMarks = false;
+		bool pretty = false;    // pretty print
+		bool genC = false;      // generating C code?
+		bool lineMarks = false; // lineMarks on for CodeGenerator?
 	};
 
@@ -74,5 +72,5 @@
 
 		type->accept( gt );
-		return os.str() + gt.pass.get_typeString();
+		return os.str() + gt.pass.typeString;
 	}
 
Index: src/Common/Eval.cc
===================================================================
--- src/Common/Eval.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
+++ src/Common/Eval.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -0,0 +1,96 @@
+//
+// 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.
+//
+// utility.h --
+//
+// Author           : Richard C. Bilson
+// Created On       : Mon May 18 07:44:20 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May  6 22:24:16 2018
+// Update Count     : 40
+//
+
+#include <utility> // for pair
+
+#include "Common/PassVisitor.h"
+#include "InitTweak/InitTweak.h"
+#include "SynTree/Expression.h"
+
+struct Eval : public WithShortCircuiting {
+	long long int value = 0;
+	bool valid = true;
+
+	void previsit( BaseSyntaxNode * ) { visit_children = false; }
+	void postvisit( BaseSyntaxNode * ) { valid = false; }
+
+	void postvisit( ConstantExpr * expr ) {
+		value = expr->intValue();
+	}
+
+	void postvisit( CastExpr * expr ) {
+		auto arg = eval(expr->arg);
+		valid = arg.second;
+		value = arg.first;
+		// TODO: perform type conversion on value if valid
+	}
+
+	void postvisit( VariableExpr * expr ) {
+		if ( EnumInstType * inst = dynamic_cast<EnumInstType *>(expr->result) ) {
+			if ( EnumDecl * decl = inst->baseEnum ) {
+				if ( decl->valueOf( expr->var, value ) ) { // value filled by valueOf
+					return;
+				}
+			}
+		}
+		valid = false;
+	}
+
+	void postvisit( ApplicationExpr * expr ) {
+		DeclarationWithType * function = InitTweak::getFunction(expr);
+		if ( ! function || function->linkage != LinkageSpec::Intrinsic ) { valid = false; return; }
+		const std::string & fname = function->name;
+		assertf( expr->args.size() == 1 || expr->args.size() == 2, "Intrinsic function with %zd arguments: %s", expr->args.size(), fname.c_str() );
+		std::pair<long long int, bool> arg1, arg2;
+		arg1 = eval(expr->args.front());
+		valid = valid && arg1.second;
+		if ( ! valid ) return;
+		if ( expr->args.size() == 2 ) {
+			arg2 = eval(expr->args.back());
+			valid = valid && arg2.second;
+			if ( ! valid ) return;
+		}
+		if (fname == "?+?") {
+			value = arg1.first + arg2.first;
+		} else if (fname == "?-?") {
+			value = arg1.first - arg2.first;
+		} else if (fname == "?*?") {
+			value = arg1.first * arg2.first;
+		} else if (fname == "?/?") {
+			value = arg1.first / arg2.first;
+		} else if (fname == "?%?") {
+			value = arg1.first % arg2.first;
+		} else {
+			valid = false;
+		}
+		// TODO: implement other intrinsic functions
+	}
+};
+
+std::pair<long long int, bool> eval(Expression * expr) {
+	PassVisitor<Eval> ev;
+	if (expr) {
+		expr->accept(ev);
+		return std::make_pair(ev.pass.value, ev.pass.valid);
+	} else {
+		return std::make_pair(0, false);
+	}
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/Common/SemanticError.h
===================================================================
--- src/Common/SemanticError.h	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/Common/SemanticError.h	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -58,4 +58,5 @@
 	{"aggregate-forward-decl" , "forward declaration of nested aggregate: %s"  , Severity::Warn},
 	{"superfluous-decl"       , "declaration does not allocate storage: %s"    , Severity::Warn},
+	{"gcc-attributes"         , "invalid attribute: %s"                        , Severity::Warn},
 };
 
@@ -66,4 +67,5 @@
 	AggrForwardDecl,
 	SuperfluousDecl,
+	GccAttributes,
 	NUMBER_OF_WARNINGS, // This MUST be the last warning
 };
Index: src/Common/module.mk
===================================================================
--- src/Common/module.mk	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/Common/module.mk	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -19,3 +19,4 @@
        Common/DebugMalloc.cc \
        Common/Assert.cc \
-       Common/Heap.cc
+       Common/Heap.cc \
+       Common/Eval.cc
Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/Common/utility.h	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -31,4 +31,6 @@
 #include "Common/Indenter.h"
 
+class Expression;
+
 template< typename T >
 static inline T * maybeClone( const T *orig ) {
@@ -456,4 +458,7 @@
 } // ilog2
 
+// -----------------------------------------------------------------------------
+/// evaluates expr as a long long int. If second is false, expr could not be evaluated
+std::pair<long long int, bool> eval(Expression * expr);
 
 // Local Variables: //
Index: src/CompilationState.cc
===================================================================
--- src/CompilationState.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
+++ src/CompilationState.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -0,0 +1,45 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// CompilationState.cc --
+//
+// Author           : Rob Schluntz
+// Created On       : Mon Ju1 30 10:47:01 2018
+// Last Modified By : Rob Schluntz
+// Last Modified On : Mon Ju1 30 10:46:25 2018
+// Update Count     : 2
+//
+
+bool
+	astp = false,
+	bresolvep = false,
+	bboxp = false,
+	bcodegenp = false,
+	ctorinitp = false,
+	declstatsp = false,
+	exprp = false,
+	expraltp = false,
+	genericsp = false,
+	libcfap = false,
+	nopreludep = false,
+	noprotop = false,
+	nomainp = false,
+	parsep = false,
+	resolvep = false,
+	symtabp = false,
+	treep = false,
+	tuplep = false,
+	validp = false,
+	errorp = false,
+	codegenp = false,
+	prettycodegenp = false,
+	linemarks = false;
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End:  //
Index: src/CompilationState.h
===================================================================
--- src/CompilationState.h	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
+++ src/CompilationState.h	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -0,0 +1,51 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// CompilationState.h --
+//
+// Author           : Rob Schluntz
+// Created On       : Mon Ju1 30 10:47:01 2018
+// Last Modified By : Rob Schluntz
+// Last Modified On : Mon Ju1 30 10:46:25 2018
+// Update Count     : 2
+//
+
+extern int yydebug;                   // set for -g flag (Grammar)
+extern bool
+	astp,
+	bresolvep,
+	bboxp,
+	bcodegenp,
+	ctorinitp,
+	declstatsp,
+	exprp,
+	expraltp,
+	genericsp,
+	libcfap,
+	nopreludep,
+	noprotop,
+	nomainp,
+	parsep,
+	resolvep,
+	symtabp,
+	treep,
+	tuplep,
+	validp,
+	errorp,
+	codegenp,
+	prettycodegenp,
+	linemarks;
+
+// is the compiler building prelude or libcfa?
+inline bool buildingLibrary() {
+	return libcfap | treep;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End:  //
Index: src/InitTweak/FixGlobalInit.cc
===================================================================
--- src/InitTweak/FixGlobalInit.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/InitTweak/FixGlobalInit.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -37,5 +37,5 @@
 	class GlobalFixer : public WithShortCircuiting {
 	  public:
-		GlobalFixer( const std::string & name, bool inLibrary );
+		GlobalFixer( bool inLibrary );
 
 		void previsit( ObjectDecl *objDecl );
@@ -52,6 +52,6 @@
 	};
 
-	void fixGlobalInit( std::list< Declaration * > & translationUnit, const std::string & name, bool inLibrary ) {
-		PassVisitor<GlobalFixer> visitor( name, inLibrary );
+	void fixGlobalInit( std::list< Declaration * > & translationUnit, bool inLibrary ) {
+		PassVisitor<GlobalFixer> visitor( inLibrary );
 		acceptAll( translationUnit, visitor );
 		GlobalFixer & fixer = visitor.pass;
@@ -70,15 +70,5 @@
 	}
 
-  std::string globalFunctionName( const std::string & name ) {
-  	// get basename
-  	std::string ret = name.substr( 0, name.find( '.' ) );
-  	// replace invalid characters with _
-		static std::string invalid = "/-@";
-  	replace_if( ret.begin(), ret.end(), []( char c ) { return invalid.find(c) != std::string::npos; }, '_' );
-  	return ret;
-  }
-
-	GlobalFixer::GlobalFixer( const std::string & name, bool inLibrary ) : tempNamer( "_global_init" ) {
-		std::string fixedName = globalFunctionName( name );
+	GlobalFixer::GlobalFixer( bool inLibrary ) : tempNamer( "_global_init" ) {
 		std::list< Expression * > ctorParameters;
 		std::list< Expression * > dtorParameters;
@@ -90,10 +80,12 @@
 			// for library code are run before constructors and destructors for user code,
 			// specify a priority when building the library. Priorities 0-100 are reserved by gcc.
-			ctorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) );
-			dtorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) );
+			// Priorities 101-200 are reserved by cfa, so use priority 200 for CFA library globals,
+			// allowing room for overriding with a higher priority.
+			ctorParameters.push_back( new ConstantExpr( Constant::from_int( 200 ) ) );
+			dtorParameters.push_back( new ConstantExpr( Constant::from_int( 200 ) ) );
 		}
-		initFunction = new FunctionDecl( "_init_" + fixedName, Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() );
+		initFunction = new FunctionDecl( "__global_init__", Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() );
 		initFunction->get_attributes().push_back( new Attribute( "constructor", ctorParameters ) );
-		destroyFunction = new FunctionDecl( "_destroy_" + fixedName, Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() );
+		destroyFunction = new FunctionDecl( "__global_destroy__", Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() );
 		destroyFunction->get_attributes().push_back( new Attribute( "destructor", dtorParameters ) );
 	}
@@ -110,23 +102,23 @@
 		if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
 			// a decision should have been made by the resolver, so ctor and init are not both non-NULL
-			assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
+			assert( ! ctorInit->ctor || ! ctorInit->init );
 
-			Statement * dtor = ctorInit->get_dtor();
+			Statement * dtor = ctorInit->dtor;
 			if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) {
 				// don't need to call intrinsic dtor, because it does nothing, but
 				// non-intrinsic dtors must be called
 				destroyStatements.push_front( dtor );
-				ctorInit->set_dtor( NULL );
+				ctorInit->dtor = nullptr;
 			} // if
-			if ( Statement * ctor = ctorInit->get_ctor() ) {
+			if ( Statement * ctor = ctorInit->ctor ) {
 				initStatements.push_back( ctor );
-				objDecl->set_init( NULL );
-				ctorInit->set_ctor( NULL );
-			} else if ( Initializer * init = ctorInit->get_init() ) {
-				objDecl->set_init( init );
-				ctorInit->set_init( NULL );
+				objDecl->init = nullptr;
+				ctorInit->ctor = nullptr;
+			} else if ( Initializer * init = ctorInit->init ) {
+				objDecl->init = init;
+				ctorInit->init = nullptr;
 			} else {
 				// no constructor and no initializer, which is okay
-				objDecl->set_init( NULL );
+				objDecl->init = nullptr;
 			} // if
 			delete ctorInit;
Index: src/InitTweak/FixGlobalInit.h
===================================================================
--- src/InitTweak/FixGlobalInit.h	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/InitTweak/FixGlobalInit.h	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -22,12 +22,8 @@
 
 namespace InitTweak {
-  /// Moves global initialization into an _init function that is unique to the translation unit.
-  /// Sets the priority of the initialization function depending on whether the initialization
-  /// function is for library code.
-  void fixGlobalInit( std::list< Declaration * > & translationUnit, const std::string & name, bool inLibrary );
-
-  /// Apply transformations to a file name to get a valid C identifier which will be used as
-  /// the name of the generated initializer function.
-  std::string globalFunctionName( const std::string & name );
+	/// Moves global initialization into an _init function that is unique to the translation unit.
+	/// Sets the priority of the initialization function depending on whether the initialization
+	/// function is for library code.
+	void fixGlobalInit( std::list< Declaration * > & translationUnit, bool inLibrary );
 } // namespace
 
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/InitTweak/FixInit.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -238,10 +238,10 @@
 	} // namespace
 
-	void fix( std::list< Declaration * > & translationUnit, const std::string & filename, bool inLibrary ) {
+	void fix( std::list< Declaration * > & translationUnit, bool inLibrary ) {
 		PassVisitor<SelfAssignChecker> checker;
 		acceptAll( translationUnit, checker );
 
 		// fixes ConstructorInit for global variables. should happen before fixInitializers.
-		InitTweak::fixGlobalInit( translationUnit, filename, inLibrary );
+		InitTweak::fixGlobalInit( translationUnit, inLibrary );
 
 		UnqCount unqCount;
Index: src/InitTweak/FixInit.h
===================================================================
--- src/InitTweak/FixInit.h	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/InitTweak/FixInit.h	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -24,5 +24,5 @@
   /// replace constructor initializers with expression statements
   /// and unwrap basic C-style initializers
-	void fix( std::list< Declaration * > & translationUnit, const std::string & name, bool inLibrary );
+	void fix( std::list< Declaration * > & translationUnit, bool inLibrary );
 } // namespace
 
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/InitTweak/InitTweak.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -408,5 +408,5 @@
 		return allofCtorDtor( stmt, []( Expression * callExpr ){
 			if ( ApplicationExpr * appExpr = isIntrinsicCallExpr( callExpr ) ) {
-				FunctionType *funcType = GenPoly::getFunctionType( appExpr->get_function()->get_result() );
+				FunctionType *funcType = GenPoly::getFunctionType( appExpr->function->result );
 				assert( funcType );
 				return funcType->get_parameters().size() == 1;
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/Makefile.am	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -19,5 +19,6 @@
 
 SRC = main.cc \
-      MakeLibCfa.cc
+      MakeLibCfa.cc \
+      CompilationState.cc
 
 MAINTAINERCLEANFILES =
@@ -37,4 +38,5 @@
 include SynTree/module.mk
 include Tuples/module.mk
+include Validate/module.mk
 include Virtual/module.mk
 
Index: src/Makefile.in
===================================================================
--- src/Makefile.in	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/Makefile.in	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -23,4 +23,7 @@
 #SRC +=  ArgTweak/Rewriter.cc \
 #	ArgTweak/Mutate.cc
+
+######################### -*- Mode: Makefile-Gmake -*- ########################
+###############################################################################
 
 ######################### -*- Mode: Makefile-Gmake -*- ########################
@@ -150,12 +153,13 @@
 am__dirstamp = $(am__leading_dot)dirstamp
 am__objects_1 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \
-	CodeGen/Generate.$(OBJEXT) CodeGen/CodeGenerator.$(OBJEXT) \
-	CodeGen/GenType.$(OBJEXT) CodeGen/FixNames.$(OBJEXT) \
-	CodeGen/FixMain.$(OBJEXT) CodeGen/OperatorTable.$(OBJEXT) \
-	CodeTools/DeclStats.$(OBJEXT) CodeTools/TrackLoc.$(OBJEXT) \
-	Concurrency/Keywords.$(OBJEXT) Concurrency/Waitfor.$(OBJEXT) \
-	Common/SemanticError.$(OBJEXT) Common/UniqueName.$(OBJEXT) \
-	Common/DebugMalloc.$(OBJEXT) Common/Assert.$(OBJEXT) \
-	Common/Heap.$(OBJEXT) ControlStruct/LabelGenerator.$(OBJEXT) \
+	CompilationState.$(OBJEXT) CodeGen/Generate.$(OBJEXT) \
+	CodeGen/CodeGenerator.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \
+	CodeGen/FixNames.$(OBJEXT) CodeGen/FixMain.$(OBJEXT) \
+	CodeGen/OperatorTable.$(OBJEXT) CodeTools/DeclStats.$(OBJEXT) \
+	CodeTools/TrackLoc.$(OBJEXT) Concurrency/Keywords.$(OBJEXT) \
+	Concurrency/Waitfor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \
+	Common/UniqueName.$(OBJEXT) Common/DebugMalloc.$(OBJEXT) \
+	Common/Assert.$(OBJEXT) Common/Heap.$(OBJEXT) \
+	Common/Eval.$(OBJEXT) ControlStruct/LabelGenerator.$(OBJEXT) \
 	ControlStruct/LabelFixer.$(OBJEXT) \
 	ControlStruct/MLEMutator.$(OBJEXT) \
@@ -216,4 +220,5 @@
 	Tuples/TupleAssignment.$(OBJEXT) \
 	Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \
+	Validate/HandleAttributes.$(OBJEXT) \
 	Virtual/ExpandCasts.$(OBJEXT)
 am____driver_cfa_cpp_OBJECTS = $(am__objects_1)
@@ -308,7 +313,8 @@
 	$(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk \
 	$(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk \
-	$(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk \
-	$(top_srcdir)/automake/depcomp $(top_srcdir)/automake/ylwrap \
-	Parser/lex.cc Parser/parser.cc Parser/parser.hh
+	$(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk \
+	$(srcdir)/Virtual/module.mk $(top_srcdir)/automake/depcomp \
+	$(top_srcdir)/automake/ylwrap Parser/lex.cc Parser/parser.cc \
+	Parser/parser.hh
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
@@ -440,5 +446,5 @@
 # create object files in directory with source files
 AUTOMAKE_OPTIONS = subdir-objects
-SRC = main.cc MakeLibCfa.cc CodeGen/Generate.cc \
+SRC = main.cc MakeLibCfa.cc CompilationState.cc CodeGen/Generate.cc \
 	CodeGen/CodeGenerator.cc CodeGen/GenType.cc \
 	CodeGen/FixNames.cc CodeGen/FixMain.cc \
@@ -447,5 +453,5 @@
 	Concurrency/Waitfor.cc Common/SemanticError.cc \
 	Common/UniqueName.cc Common/DebugMalloc.cc Common/Assert.cc \
-	Common/Heap.cc ControlStruct/LabelGenerator.cc \
+	Common/Heap.cc Common/Eval.cc ControlStruct/LabelGenerator.cc \
 	ControlStruct/LabelFixer.cc ControlStruct/MLEMutator.cc \
 	ControlStruct/Mutate.cc ControlStruct/ForExprMutator.cc \
@@ -489,5 +495,6 @@
 	SynTree/Attribute.cc SynTree/DeclReplacer.cc \
 	Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \
-	Tuples/Explode.cc Virtual/ExpandCasts.cc
+	Tuples/Explode.cc Validate/HandleAttributes.cc \
+	Virtual/ExpandCasts.cc
 MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \
 	${cfa_cpplib_PROGRAMS}}
@@ -508,5 +515,5 @@
 .SUFFIXES:
 .SUFFIXES: .cc .ll .o .obj .yy
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -528,5 +535,5 @@
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk $(am__empty):
+$(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -633,4 +640,6 @@
 	Common/$(DEPDIR)/$(am__dirstamp)
 Common/Heap.$(OBJEXT): Common/$(am__dirstamp) \
+	Common/$(DEPDIR)/$(am__dirstamp)
+Common/Eval.$(OBJEXT): Common/$(am__dirstamp) \
 	Common/$(DEPDIR)/$(am__dirstamp)
 ControlStruct/$(am__dirstamp):
@@ -864,4 +873,12 @@
 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \
 	Tuples/$(DEPDIR)/$(am__dirstamp)
+Validate/$(am__dirstamp):
+	@$(MKDIR_P) Validate
+	@: > Validate/$(am__dirstamp)
+Validate/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) Validate/$(DEPDIR)
+	@: > Validate/$(DEPDIR)/$(am__dirstamp)
+Validate/HandleAttributes.$(OBJEXT): Validate/$(am__dirstamp) \
+	Validate/$(DEPDIR)/$(am__dirstamp)
 Virtual/$(am__dirstamp):
 	@$(MKDIR_P) Virtual
@@ -894,4 +911,5 @@
 	-rm -f SynTree/*.$(OBJEXT)
 	-rm -f Tuples/*.$(OBJEXT)
+	-rm -f Validate/*.$(OBJEXT)
 	-rm -f Virtual/*.$(OBJEXT)
 
@@ -899,4 +917,5 @@
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CompilationState.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MakeLibCfa.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@@ -911,4 +930,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Assert.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/DebugMalloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Eval.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Heap.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/SemanticError.Po@am__quote@
@@ -1005,4 +1025,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/TupleAssignment.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/TupleExpansion.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@Validate/$(DEPDIR)/HandleAttributes.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Virtual/$(DEPDIR)/ExpandCasts.Po@am__quote@
 
@@ -1171,4 +1192,6 @@
 	-rm -f Tuples/$(DEPDIR)/$(am__dirstamp)
 	-rm -f Tuples/$(am__dirstamp)
+	-rm -f Validate/$(DEPDIR)/$(am__dirstamp)
+	-rm -f Validate/$(am__dirstamp)
 	-rm -f Virtual/$(DEPDIR)/$(am__dirstamp)
 	-rm -f Virtual/$(am__dirstamp)
@@ -1187,5 +1210,5 @@
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Virtual/$(DEPDIR)
+	-rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
@@ -1233,5 +1256,5 @@
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Virtual/$(DEPDIR)
+	-rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/Parser/ParseNode.h	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 13:28:16 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 20 14:56:30 2018
-// Update Count     : 850
+// Last Modified On : Sat Aug  4 09:39:40 2018
+// Update Count     : 853
 //
 
@@ -132,4 +132,5 @@
 	void printOneLine( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {}
 
+	Expression *get_expr() const { return expr.get(); }
 	template<typename T>
 	bool isExpressionType() const {	return nullptr != dynamic_cast<T>(expr.get()); }
@@ -390,6 +391,6 @@
 Statement * build_expr( ExpressionNode * ctl );
 
-struct IfCtl {
-	IfCtl( DeclarationNode * decl, ExpressionNode * condition ) :
+struct IfCtrl {
+	IfCtrl( DeclarationNode * decl, ExpressionNode * condition ) :
 		init( decl ? new StatementNode( decl ) : nullptr ), condition( condition ) {}
 
@@ -398,8 +399,8 @@
 };
 
-struct ForCtl {
-	ForCtl( ExpressionNode * expr, ExpressionNode * condition, ExpressionNode * change ) :
+struct ForCtrl {
+	ForCtrl( ExpressionNode * expr, ExpressionNode * condition, ExpressionNode * change ) :
 		init( new StatementNode( build_expr( expr ) ) ), condition( condition ), change( change ) {}
-	ForCtl( DeclarationNode * decl, ExpressionNode * condition, ExpressionNode * change ) :
+	ForCtrl( DeclarationNode * decl, ExpressionNode * condition, ExpressionNode * change ) :
 		init( new StatementNode( decl ) ), condition( condition ), change( change ) {}
 
@@ -409,12 +410,12 @@
 };
 
-Expression * build_if_control( IfCtl * ctl, std::list< Statement * > & init );
-Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt );
+Expression * build_if_control( IfCtrl * ctl, std::list< Statement * > & init );
+Statement * build_if( IfCtrl * ctl, StatementNode * then_stmt, StatementNode * else_stmt );
 Statement * build_switch( bool isSwitch, ExpressionNode * ctl, StatementNode * stmt );
 Statement * build_case( ExpressionNode * ctl );
 Statement * build_default();
-Statement * build_while( IfCtl * ctl, StatementNode * stmt );
+Statement * build_while( IfCtrl * ctl, StatementNode * stmt );
 Statement * build_do_while( ExpressionNode * ctl, StatementNode * stmt );
-Statement * build_for( ForCtl * forctl, StatementNode * stmt );
+Statement * build_for( ForCtrl * forctl, StatementNode * stmt );
 Statement * build_branch( BranchStmt::Type kind );
 Statement * build_branch( std::string * identifier, BranchStmt::Type kind );
Index: src/Parser/StatementNode.cc
===================================================================
--- src/Parser/StatementNode.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/Parser/StatementNode.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 14:59:41 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jun  5 08:58:34 2018
-// Update Count     : 362
+// Last Modified On : Sat Aug  4 09:39:25 2018
+// Update Count     : 363
 //
 
@@ -78,5 +78,5 @@
 } // build_expr
 
-Expression * build_if_control( IfCtl * ctl, std::list< Statement * > & init ) {
+Expression * build_if_control( IfCtrl * ctl, std::list< Statement * > & init ) {
 	if ( ctl->init != 0 ) {
 		buildMoveList( ctl->init, init );
@@ -100,5 +100,5 @@
 } // build_if_control
 
-Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ) {
+Statement * build_if( IfCtrl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ) {
 	Statement * thenb, * elseb = nullptr;
 	std::list< Statement * > branches;
@@ -145,5 +145,5 @@
 } // build_default
 
-Statement * build_while( IfCtl * ctl, StatementNode * stmt ) {
+Statement * build_while( IfCtrl * ctl, StatementNode * stmt ) {
 	std::list< Statement * > branches;
 	buildMoveList< Statement, StatementNode >( stmt, branches );
@@ -164,5 +164,5 @@
 } // build_do_while
 
-Statement * build_for( ForCtl * forctl, StatementNode * stmt ) {
+Statement * build_for( ForCtrl * forctl, StatementNode * stmt ) {
 	std::list< Statement * > branches;
 	buildMoveList< Statement, StatementNode >( stmt, branches );
Index: src/Parser/lex.ll
===================================================================
--- src/Parser/lex.ll	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/Parser/lex.ll	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -10,6 +10,6 @@
  * Created On       : Sat Sep 22 08:58:10 2001
  * Last Modified By : Peter A. Buhr
- * Last Modified On : Wed Jun 20 09:08:28 2018
- * Update Count     : 682
+ * Last Modified On : Wed Aug  8 17:23:17 2018
+ * Update Count     : 685
  */
 
@@ -410,4 +410,5 @@
 ">>="			{ NAMEDOP_RETURN(RSassign); }
 
+"~="			{ NAMEDOP_RETURN(Erange); }				// CFA
 "@="			{ NAMEDOP_RETURN(ATassign); }			// CFA
 
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/Parser/parser.yy	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Jul 25 15:54:35 2018
-// Update Count     : 3841
+// Last Modified On : Wed Aug  8 17:50:07 2018
+// Update Count     : 3998
 //
 
@@ -186,4 +186,12 @@
 } // fieldDecl
 
+ForCtrl * forCtrl( ExpressionNode * type, string * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
+	return new ForCtrl(
+		distAttr( DeclarationNode::newTypeof( type ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ),
+		new ExpressionNode( build_binary_val( compop, new ExpressionNode( build_varref( new string( *index ) ) ), comp ) ),
+		new ExpressionNode( build_binary_val( OperKinds::PlusAssn, new ExpressionNode( build_varref( new string( *index ) ) ), inc ) ) );
+} // forCtrl
+
+
 bool forall = false, yyy = false;						// aggregate have one or more forall qualifiers ?
 
@@ -217,6 +225,7 @@
 	WaitForStmt * wfs;
 	Expression * constant;
-	IfCtl * ifctl;
-	ForCtl * fctl;
+	IfCtrl * ifctl;
+	ForCtrl * fctl;
+	enum OperKinds compop;
 	LabelNode * label;
 	InitializerNode * in;
@@ -281,4 +290,5 @@
 %token ANDassign	ERassign	ORassign				// &=	^=	|=
 
+%token Erange											// ~=
 %token ATassign											// @=
 
@@ -303,4 +313,5 @@
 %type<ifctl> if_control_expression
 %type<fctl> for_control_expression
+%type<compop> inclexcl
 %type<en> subrange
 %type<decl> asm_name_opt
@@ -1049,11 +1060,11 @@
 if_control_expression:
 	comma_expression
-		{ $$ = new IfCtl( nullptr, $1 ); }
+		{ $$ = new IfCtrl( nullptr, $1 ); }
 	| c_declaration										// no semi-colon
-		{ $$ = new IfCtl( $1, nullptr ); }
+		{ $$ = new IfCtrl( $1, nullptr ); }
 	| cfa_declaration									// no semi-colon
-		{ $$ = new IfCtl( $1, nullptr ); }
+		{ $$ = new IfCtrl( $1, nullptr ); }
 	| declaration comma_expression						// semi-colon separated
-		{ $$ = new IfCtl( $1, $2 ); }
+		{ $$ = new IfCtrl( $1, $2 ); }
  	;
 
@@ -1111,6 +1122,10 @@
 	WHILE '(' push if_control_expression ')' statement pop
 		{ $$ = new StatementNode( build_while( $4, $6 ) ); }
+	| WHILE '(' ')' statement							// CFA => while ( 1 )
+		{ $$ = new StatementNode( build_while( new IfCtrl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), $4 ) ); }
 	| DO statement WHILE '(' comma_expression ')' ';'
 		{ $$ = new StatementNode( build_do_while( $5, $2 ) ); }
+	| DO statement WHILE '(' ')' ';'					// CFA => do while( 1 )
+		{ $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), $2 ) ); }
 	| FOR '(' push for_control_expression ')' statement pop
 		{ $$ = new StatementNode( build_for( $4, $6 ) ); }
@@ -1118,8 +1133,67 @@
 
 for_control_expression:
-	comma_expression_opt ';' comma_expression_opt ';' comma_expression_opt
-		{ $$ = new ForCtl( $1, $3, $5 ); }
-	| declaration comma_expression_opt ';' comma_expression_opt // C99
-		{ $$ = new ForCtl( $1, $2, $4 ); }
+	comma_expression_opt								// CFA
+		{
+			if ( ! $1 ) {								// => for ( ;; )
+				$$ = new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr );
+			} else {
+				$$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), OperKinds::LThan, $1->clone(),
+							 new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) );
+			} // if
+		}
+	| constant_expression inclexcl constant_expression	// CFA
+		{ $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); }
+	| constant_expression inclexcl constant_expression '~' constant_expression // CFA
+		{ $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); }
+	| comma_expression_opt ';' comma_expression			// CFA
+		{
+			if ( ! $1 ) {
+				SemanticError( yylloc, "Missing loop index." ); $$ = nullptr;
+			} else if ( ! $3 ) {
+				SemanticError( yylloc, "Missing loop range." ); $$ = nullptr;
+			} else {
+				if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) {
+					$$ = forCtrl( $3, new string( identifier->name ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), OperKinds::LThan, $3->clone(),
+								 new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) );
+				} else {
+					SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr;
+				} // if
+			} // if
+		}
+	| comma_expression_opt ';' constant_expression inclexcl constant_expression // CFA
+		{
+			if ( ! $1 ) {
+				SemanticError( yylloc, "Missing loop index." ); $$ = nullptr;
+			} else {
+				if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) {
+					$$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) );
+				} else {
+					SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr;
+				} // if
+			} // if
+		}
+	| comma_expression_opt ';' constant_expression inclexcl constant_expression '~' constant_expression // CFA
+		{
+			if ( ! $1 ) {
+				SemanticError( yylloc, "Missing loop index." ); $$ = nullptr;
+			} else {
+				if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) {
+					$$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, $7 );
+				} else {
+					SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr;
+				} // if
+			} // if
+		}
+	| comma_expression_opt ';' comma_expression_opt ';' comma_expression_opt
+		{ $$ = new ForCtrl( $1, $3, $5 ); }
+	| declaration comma_expression_opt ';' comma_expression_opt // C99, declaration has ';'
+		{ $$ = new ForCtrl( $1, $2, $4 ); }
+ 	;
+
+inclexcl:
+	'~'
+		{ $$ = OperKinds::LThan; }
+	| Erange
+		{ $$ = OperKinds::LEThan; }
  	;
 
Index: src/ResolvExpr/CurrentObject.cc
===================================================================
--- src/ResolvExpr/CurrentObject.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/ResolvExpr/CurrentObject.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -139,8 +139,8 @@
 		ArrayIterator( ArrayType * at ) : array( at ) {
 			PRINT( std::cerr << "Creating array iterator: " << at << std::endl; )
-			base = at->get_base();
+			base = at->base;
 			memberIter = createMemberIterator( base );
-			if ( at->isVarLen ) SemanticError( at, "VLA initialization does not support @=" );
-			setSize( at->get_dimension() );
+			if ( at->isVarLen ) SemanticError( at, "VLA initialization does not support @=: " );
+			setSize( at->dimension );
 		}
 
@@ -150,23 +150,10 @@
 
 	private:
-		void setSize( Expression * expr ) {
-			if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) {
-				try {
-					size = constExpr->intValue();
-					PRINT( std::cerr << "array type with size: " << size << std::endl; )
-				} catch ( SemanticErrorException & ) {
-					SemanticError( expr, "Constant expression of non-integral type in array dimension: " );
-				}
-			}	else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
-				setSize( castExpr->get_arg() ); // xxx - need to perform the conversion specified by the cast
-			} else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) {
-				if ( EnumInstType * inst = dynamic_cast< EnumInstType * > ( varExpr->result ) ) {
-					long long int value;
-					if ( inst->baseEnum->valueOf( varExpr->var, value ) ) {
-						size = value;
-					}
-				}
+		void setSize( Expression * expr ) { // replace this logic with an eval call
+			auto res = eval(expr);
+			if (res.second) {
+				size = res.first;
 			} else {
-				assertf( false, "unhandled expression in setSize: %s", toString( expr ).c_str() ); // xxx - if not a constant expression, it's not simple to determine how long the array actually is, which is necessary for initialization to be done correctly -- fix this
+				SemanticError( expr->location, toString("Array designator must be a constant expression: ", expr) );
 			}
 		}
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/SymTab/Validate.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -61,4 +61,5 @@
 #include "Parser/LinkageSpec.h"        // for C
 #include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "ResolvExpr/Resolver.h"       // for findSingleExpression
 #include "SymTab/Autogen.h"            // for SizeType
 #include "SynTree/Attribute.h"         // for noAttributes, Attribute
@@ -72,4 +73,5 @@
 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
 #include "SynTree/Visitor.h"           // for Visitor
+#include "Validate/HandleAttributes.h" // for handleAttributes
 
 class CompoundStmt;
@@ -247,5 +249,5 @@
 	};
 
-	struct ArrayLength {
+	struct ArrayLength : public WithIndexer {
 		/// for array types without an explicit length, compute the length and store it so that it
 		/// is known to the rest of the phases. For example,
@@ -258,4 +260,5 @@
 
 		void previsit( ObjectDecl * objDecl );
+		void previsit( ArrayType * arrayType );
 	};
 
@@ -312,4 +315,5 @@
 		acceptAll( translationUnit, finder ); // xxx - remove this pass soon
 		mutateAll( translationUnit, labelAddrFixer );
+		Validate::handleAttributes( translationUnit );
 	}
 
@@ -734,4 +738,13 @@
 				forwardEnums.erase( fwds );
 			} // if
+
+			for ( Declaration * member : enumDecl->members ) {
+				ObjectDecl * field = strict_dynamic_cast<ObjectDecl *>( member );
+				if ( field->init ) {
+					// need to resolve enumerator initializers early so that other passes that determine if an expression is constexpr have the appropriate information.
+					SingleInit * init = strict_dynamic_cast<SingleInit *>( field->init );
+					ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer );
+				}
+			}
 		} // if
 	}
@@ -1232,8 +1245,20 @@
 	void ArrayLength::previsit( ObjectDecl * objDecl ) {
 		if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->type ) ) {
-			if ( at->get_dimension() ) return;
+			if ( at->dimension ) return;
 			if ( ListInit * init = dynamic_cast< ListInit * >( objDecl->init ) ) {
-				at->set_dimension( new ConstantExpr( Constant::from_ulong( init->initializers.size() ) ) );
-			}
+				at->dimension = new ConstantExpr( Constant::from_ulong( init->initializers.size() ) );
+			}
+		}
+	}
+
+	void ArrayLength::previsit( ArrayType * type ) {
+		if ( type->dimension ) {
+			// need to resolve array dimensions early so that constructor code can correctly determine
+			// if a type is a VLA (and hence whether its elements need to be constructed)
+			ResolvExpr::findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer );
+
+			// must re-evaluate whether a type is a VLA, now that more information is available
+			// (e.g. the dimension may have been an enumerator, which was unknown prior to this step)
+			type->isVarLen = ! InitTweak::isConstExpr( type->dimension );
 		}
 	}
Index: src/SynTree/AggregateDecl.cc
===================================================================
--- src/SynTree/AggregateDecl.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/SynTree/AggregateDecl.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -86,19 +86,4 @@
 std::string TraitDecl::typeString() const { return "trait"; }
 
-namespace {
-	long long int getConstValue( Expression * expr ) {
-		if ( CastExpr * castExpr = dynamic_cast< CastExpr * > ( expr ) ) {
-			return getConstValue( castExpr->arg );
-		} else if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) {
-			return constExpr->intValue();
-		// can be -1, +1, etc.
-		// } else if ( UntypedExpr * untypedExpr = dynamic_cast< UntypedExpr * >( expr ) ) {
-		// 	if ( untypedExpr-> )
-		} else {
-			assertf( false, "Unhandled expression type in getConstValue for enumerators: %s", toString( expr ).c_str() );
-		}
-	}
-}
-
 bool EnumDecl::valueOf( Declaration * enumerator, long long int & value ) {
 	if ( enumValues.empty() ) {
@@ -108,5 +93,7 @@
 			if ( field->init ) {
 				SingleInit * init = strict_dynamic_cast< SingleInit * >( field->init );
-				currentValue = getConstValue( init->value );
+				auto result = eval( init->value );
+				if ( ! result.second ) SemanticError( init->location, toString( "Non-constexpr in initialization of enumerator: ", field ) );
+				currentValue = result.first;
 			}
 			assertf( enumValues.count( field->name ) == 0, "Enum %s has multiple members with the name %s", name.c_str(), field->name.c_str() );
Index: src/Validate/HandleAttributes.cc
===================================================================
--- src/Validate/HandleAttributes.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
+++ src/Validate/HandleAttributes.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -0,0 +1,85 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// HandleAttributes.cc --
+//
+// Author           : Rob Schluntz
+// Created On       : Fri Jul 27 10:15:06 2018
+// Last Modified By : Rob Schluntz
+// Last Modified On : Fri Jul 27 10:16:43 2018
+// Update Count     : 2
+//
+
+#include "HandleAttributes.h"
+
+#include "CompilationState.h"
+#include "Common/PassVisitor.h"
+#include "Common/SemanticError.h"
+#include "ResolvExpr/Resolver.h"
+#include "SynTree/Attribute.h"
+#include "SynTree/Declaration.h"
+#include "SynTree/Type.h"
+
+namespace Validate {
+	namespace {
+		struct HandleAttributes : public WithIndexer {
+			void previsit( ObjectDecl * decl );
+			void previsit( FunctionDecl * decl );
+		};
+	} // namespace
+
+	void handleAttributes( std::list< Declaration * > &translationUnit ) {
+		PassVisitor<HandleAttributes> handler;
+		acceptAll( translationUnit, handler );
+	}
+
+	namespace {
+		void HandleAttributes::previsit( ObjectDecl * decl ) {
+			for ( Attribute * attr : decl->attributes ) {
+				std::string name = attr->normalizedName();
+				if (name == "init_priority") {
+					// TODO: implement C++-like init_priority attribute
+				}
+			}
+		}
+
+		void HandleAttributes::previsit( FunctionDecl * decl ) {
+			for ( Attribute * attr : decl->attributes ) {
+				std::string name = attr->normalizedName();
+				if (name == "constructor" || name == "destructor") {
+					if (attr->parameters.size() == 1) {
+						Expression *& arg = attr->parameters.front();
+						ResolvExpr::findSingleExpression( arg, new BasicType( Type::Qualifiers(), BasicType::LongLongSignedInt ), indexer );
+						auto result = eval(arg);
+						if (! result.second) {
+							SemanticWarning(attr->location, Warning::GccAttributes,
+								toCString( name, " priorities must be integers from 0 to 65535 inclusive: ", arg ) );
+							return;
+						}
+						auto priority = result.first;
+						if (priority < 101) {
+							SemanticWarning(attr->location, Warning::GccAttributes,
+								toCString( name, " priorities from 0 to 100 are reserved for the implementation" ) );
+						} else if (priority < 201 && ! buildingLibrary()) {
+							SemanticWarning(attr->location, Warning::GccAttributes,
+								toCString( name, " priorities from 101 to 200 are reserved for the implementation" ) );
+						}
+					} else if (attr->parameters.size() > 1) {
+						SemanticWarning(attr->location, Warning::GccAttributes, toCString( "too many arguments to ", name, " attribute" ) );
+					} else {
+						SemanticWarning(attr->location, Warning::GccAttributes, toCString( "too few arguments to ", name, " attribute" ) );
+					}
+				}
+			}
+		}
+	} // namespace
+} // namespace Validate
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/Validate/HandleAttributes.h
===================================================================
--- src/Validate/HandleAttributes.h	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
+++ src/Validate/HandleAttributes.h	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -0,0 +1,30 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// HandleAttributes.h --
+//
+// Author           : Rob Schluntz
+// Created On       : Fri Jul 27 10:10:10 2018
+// Last Modified By : Rob Schluntz
+// Last Modified On : Fri Jul 27 10:12:53 2018
+// Update Count     : 2
+//
+
+#pragma once
+
+#include <list>  // for list
+
+class Declaration;
+
+namespace Validate {
+	void handleAttributes( std::list< Declaration * > &translationUnit );
+} // namespace Validate
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/Validate/module.mk
===================================================================
--- src/Validate/module.mk	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
+++ src/Validate/module.mk	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -0,0 +1,17 @@
+######################### -*- Mode: Makefile-Gmake -*- ########################
+##
+## Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
+##
+## The contents of this file are covered under the licence agreement in the
+## file "LICENCE" distributed with Cforall.
+##
+## module.mk --
+##
+## Author           : Rob Schluntz
+## Created On       : Fri Jul 27 10:10:10 2018
+## Last Modified By : Rob Schluntz
+## Last Modified On : Fri Jul 27 10:10:26 2018
+## Update Count     : 2
+###############################################################################
+
+SRC += Validate/HandleAttributes.cc
Index: src/driver/as.cc
===================================================================
--- src/driver/as.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
+++ src/driver/as.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -0,0 +1,72 @@
+// 
+// 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.
+// 
+// as.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Wed Aug  1 10:49:42 2018
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug  2 17:50:09 2018
+// Update Count     : 90
+// 
+
+#include <cstdio>										// perror
+#include <cstdlib>										// exit
+#include <fcntl.h>										// open
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/mman.h>									// mmap
+#include <string.h>
+
+//#define __DEBUG_H__
+
+int main( const int argc, const char * argv[] ) {
+	#ifdef __DEBUG_H__
+	for ( int i = 0; i < argc; i += 1 ) {
+		cerr << argv[i] << endl;
+	} // for
+	#endif // __DEBUG_H__
+
+	int fd = open( argv[argc - 1], O_RDWR );
+	if ( fd < 0 ) { perror( "open" ); exit( EXIT_FAILURE ); };
+
+	struct stat mystat = {};
+	if ( fstat( fd, &mystat ) ) { perror( "fstat" ); exit( EXIT_FAILURE ); };
+	off_t size = mystat.st_size;
+
+	char * start = (char *)mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
+	if ( start == (void *)-1 ) { perror( "mmap" ); exit( EXIT_FAILURE ); };
+
+	if ( char * cursor = strstr( start, ".Ldebug_info0:" ) ) { // debug information ?
+		// Expand file by one byte to hold 2 character Cforall language code.
+		if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); };
+
+		for ( int i = 0; i < 8; i += 1 ) {				// move N (magic) lines forward
+			cursor = strstr( cursor, "\n" ) + 1;
+		} // for
+
+		cursor -= 2;									// backup over "c\n" language value
+		if ( *(cursor - 1) != 'x' ) { fprintf( stderr, "invalid C language code\n" ); exit( EXIT_FAILURE ); };
+
+		memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right
+
+		*(cursor) = '2';								// replace C language value with CFA
+		*(cursor + 1) = '5';
+	} // if
+
+	if ( munmap( start, size ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk
+
+	argv[0] = "as";
+	execvp( argv[0], (char * const *)argv );			// should not return
+	perror( "CFA Translator error: cpp level, execvp" );
+	exit( EXIT_FAILURE );								// tell gcc not to go any further
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "g++ -Wall -Wextra as.c -o as" //
+// End: //
Index: src/main.cc
===================================================================
--- src/main.cc	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ src/main.cc	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -28,4 +28,5 @@
 #include <string>                           // for char_traits, operator<<
 
+#include "CompilationState.h"
 #include "../config.h"                      // for CFA_LIBDIR
 #include "CodeGen/FixMain.h"                // for FixMain
@@ -72,30 +73,4 @@
 DeclarationNode * parseTree = nullptr;					// program parse tree
 
-extern int yydebug;										// set for -g flag (Grammar)
-bool
-	astp = false,
-	bresolvep = false,
-	bboxp = false,
-	bcodegenp = false,
-	ctorinitp = false,
-	declstatsp = false,
-	exprp = false,
-	expraltp = false,
-	genericsp = false,
-	libcfap = false,
-	nopreludep = false,
-	noprotop = false,
-	nomainp = false,
-	parsep = false,
-	resolvep = false,									// used in AlternativeFinder
-	symtabp = false,
-	treep = false,
-	tuplep = false,
-	validp = false,
-	errorp = false,
-	codegenp = false,
-	prettycodegenp = false,
-	linemarks = false;
-
 std::string PreludeDirector = "";
 
@@ -303,5 +278,5 @@
 
 		// fix ObjectDecl - replaces ConstructorInit nodes
-		PASS( "fixInit", InitTweak::fix( translationUnit, filename, libcfap || treep ) );
+		PASS( "fixInit", InitTweak::fix( translationUnit, buildingLibrary() ) );
 		if ( ctorinitp ) {
 			dump ( translationUnit );
Index: tests/.expect/attributes.x64.txt
===================================================================
--- tests/.expect/attributes.x64.txt	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ tests/.expect/attributes.x64.txt	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -316,6 +316,6 @@
     ((void)sizeof(__attribute__ ((unused,unused)) signed int ));
     ((void)sizeof(__attribute__ ((unused,unused,unused,unused)) signed int **));
-    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int [5]));
-    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int (*)[10]));
+    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int [((unsigned long int )5)]));
+    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int (*)[((unsigned long int )10)]));
     ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int ()));
     struct __attribute__ ((unused)) __anonymous3 {
Index: tests/.expect/attributes.x86.txt
===================================================================
--- tests/.expect/attributes.x86.txt	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ tests/.expect/attributes.x86.txt	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -316,6 +316,6 @@
     ((void)sizeof(__attribute__ ((unused,unused)) signed int ));
     ((void)sizeof(__attribute__ ((unused,unused,unused,unused)) signed int **));
-    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int [5]));
-    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int (*)[10]));
+    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int [((unsigned int )5)]));
+    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int (*)[((unsigned int )10)]));
     ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int ()));
     struct __attribute__ ((unused)) __anonymous3 {
Index: tests/function-operator.c
===================================================================
--- tests/function-operator.c	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ tests/function-operator.c	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -10,6 +10,6 @@
 // Created On       : Fri Aug 25 15:21:11 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Dec  7 12:42:26 2017
-// Update Count     : 6
+// Last Modified On : Thu Aug  2 09:27:53 2018
+// Update Count     : 8
 //
 
@@ -92,5 +92,5 @@
 void ?{}(ostream_iterator & iter, ofstream * out) {
 	iter.out = new(out);
-		}
+}
 // no destructor, memory leak. This is necessary for this to work at the moment, since
 // *? requires its parameter by value and returns a reference.
@@ -168,4 +168,7 @@
 	transform(begin(x), end(x), begin(x), &times2);
 	copy(begin(x), end(x), out_iter);
+
+	// REMOVE WHEN ?* PROBLEM FIXED.
+	delete(out_iter.out);
 }
 
Index: tests/sum.c
===================================================================
--- tests/sum.c	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ tests/sum.c	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -11,6 +11,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Jun  3 19:23:41 2018
-// Update Count     : 278
+// Last Modified On : Thu Aug  2 08:03:09 2018
+// Update Count     : 279
 //
 
@@ -115,4 +115,5 @@
 	sout | "sum from" | low | "to" | High | "is"
 		 | sum( size, gs.x ) | ", check" | (int)s | endl; // add field array in generic type
+	delete( gs.x );
 } // main
 
Index: tests/tuple/tupleVariadic.c
===================================================================
--- tests/tuple/tupleVariadic.c	(revision 7a7ab420255dadabf1a7c4c246e7a087ca8e23cd)
+++ tests/tuple/tupleVariadic.c	(revision 9aa9126e40385076b70bce81cfd5925a9c8b56ee)
@@ -9,8 +9,10 @@
 // Author           : Rob Schluntz
 // Created On       : Fri Dec 16 10:25:35 2016
-// Last Modified By : Rob Schluntz
-// Last Modified On : Fri Dec 21 14:42:48 2016
-// Update Count     : 2
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Aug  2 09:24:04 2018
+// Update Count     : 6
 //
+
+#include <stdlib>
 
 void func(void) {
@@ -28,7 +30,4 @@
 	printf("called process(double) %g\n", x);
 }
-
-forall( dtype T, ttype Params | sized(T) | { void ?{}(T &, Params); } )
-T * new(Params p);
 
 struct array {
@@ -66,4 +65,8 @@
 	a.data[2] = a2;
 	printf("called ?{} with a: %d %d %d\n", a0, a1, a2);
+}
+
+void ^?{}(array & a) {
+	free(a.data);
 }
 
@@ -126,4 +129,11 @@
 		bar(x);
 	}
+
+	delete(ptr);
+	delete(x4);
+	delete(x3);
+	delete(x2);
+	delete(x1);
+	delete(x0);
 }
 
@@ -131,3 +141,2 @@
 // tab-width: 4 //
 // End: //
-
