Index: libcfa/src/exception.hfa
===================================================================
--- libcfa/src/exception.hfa	(revision e68d09236d814efe89f3e680ef44217ed691df67)
+++ libcfa/src/exception.hfa	(revision e68d09236d814efe89f3e680ef44217ed691df67)
@@ -0,0 +1,106 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// exception.hfa -- User facing tools for working with exceptions.
+//
+// Author           : Andrew Beach
+// Created On       : Thu Apr  7 10:25:00 2020
+// Last Modified By : Andrew Beach
+// Last Modified On : Thu Apr  7 10:25:00 2020
+// Update Count     : 0
+//
+
+// Everything below this line should be considered a patch while the exception
+// objects themselves are designed and  created and should be removed in time.
+// -----------------------------------------------------------------------------------------------
+
+// All internals helper macros begin with an underscore.
+#define _CLOSE(...) __VA_ARGS__ }
+#define _GLUE2(left, right) left##right
+#define _GLUE3(left, middle, right) left##middle##right
+#define _EXC_DISPATCH(to, ...) to(__VA_ARGS__,__cfaehm_base_exception_t,)
+
+// FWD_TRIVIAL_EXCEPTION(exception_name);
+// Declare a trivial exception, one that adds no fields or features.
+// This will make the exception visible and may go in a .hfa or .cfa file.
+#define FWD_TRIVIAL_EXCEPTION(...) _EXC_DISPATCH(_FWD_TRIVIAL_EXCEPTION, __VA_ARGS__)
+// INST_TRIVIAL_EXCEPTION(exception_name);
+// Create the trival exception. This must be used exactly once and should be used in a .cfa file,
+// as it creates the unique instance of the virtual table.
+#define INST_TRIVIAL_EXCEPTION(...) _EXC_DISPATCH(_INST_TRIVIAL_EXCEPTION, __VA_ARGS__)
+// TRIVIAL_EXCEPTION(exception_name[, parent_name]);
+// Does both of the above, a short hand if the exception is only used in one .cfa file.
+// For legacy reasons this is the only one that official supports having a parent other than the
+// base exception. This feature may be removed or changed.
+#define TRIVIAL_EXCEPTION(...) \
+	_EXC_DISPATCH(_FWD_TRIVIAL_EXCEPTION, __VA_ARGS__); \
+	_EXC_DISPATCH(_INST_TRIVIAL_EXCEPTION, __VA_ARGS__)
+#define _FWD_TRIVIAL_EXCEPTION(exception_name, parent_name, ...) \
+	_VTABLE_DECLARATION(exception_name, parent_name)(); \
+	struct exception_name { \
+		VTABLE_FIELD(exception_name); \
+	}; \
+	void ?{}(exception_name & this); \
+	const char * _GLUE2(exception_name,_msg)(exception_name * this)
+#define _INST_TRIVIAL_EXCEPTION(exception_name, parent_name, ...) \
+	void ?{}(exception_name & this) { \
+		VTABLE_INIT(this, exception_name); \
+	} \
+	const char * _GLUE2(exception_name,_msg)(exception_name * this) { \
+		return #exception_name; \
+	} \
+	_VTABLE_INSTANCE(exception_name, parent_name,)(_GLUE2(exception_name,_msg))
+
+// DATA_EXCEPTION(exception_name)(fields...);
+// Forward declare an exception that adds fields but no features. The added fields go in the
+// second argument list. The virtual table instance must be provided later (see VTABLE_INSTANCE).
+#define DATA_EXCEPTION(...) _EXC_DISPATCH(_DATA_EXCEPTION, __VA_ARGS__)
+#define _DATA_EXCEPTION(exception_name, parent_name, ...) \
+	_VTABLE_DECLARATION(exception_name, parent_name)(); \
+	struct exception_name { VTABLE_FIELD(exception_name); _CLOSE
+
+// VTABLE_DECLARATION(exception_name)([new_features...]);
+// Declare a virtual table type for an exception with exception_name. You may also add features
+// (fields on the virtual table) by including them in the second list.
+#define VTABLE_DECLARATION(...) _EXC_DISPATCH(_VTABLE_DECLARATION, __VA_ARGS__)
+#define _VTABLE_DECLARATION(exception_name, parent_name, ...) \
+	struct exception_name; \
+	VTABLE_TYPE(exception_name); \
+	extern VTABLE_TYPE(exception_name) VTABLE_NAME(exception_name); \
+	VTABLE_TYPE(exception_name) { \
+		VTABLE_TYPE(parent_name) const * parent; \
+		size_t size; \
+		void (*copy)(exception_name * this, exception_name * other); \
+		void (*free)(exception_name & this); \
+		const char * (*msg)(exception_name * this); \
+		_CLOSE
+
+// VTABLE_INSTANCE(exception_name)(msg [, others...]);
+// Create the instance of the virtual table. There must be exactly one instance of a virtual table
+// for each exception type. This fills in most of the fields of the virtual table (uses ?=? and
+// ^?{}) but you must provide the message function and any other fields added in the declaration.
+#define VTABLE_INSTANCE(...) _EXC_DISPATCH(_VTABLE_INSTANCE, __VA_ARGS__)
+#define _VTABLE_INSTANCE(exception_name, parent_name, ...) \
+	void _GLUE2(exception_name,_copy)(exception_name * this, exception_name * other) { \
+		*this = *other; \
+	} \
+	VTABLE_TYPE(exception_name) VTABLE_NAME(exception_name) @= { \
+		&VTABLE_NAME(parent_name), sizeof(exception_name), \
+		_GLUE2(exception_name,_copy), ^?{}, \
+		_CLOSE
+
+// VTABLE_TYPE(exception_name) | VTABLE_NAME(exception_name)
+// Get the name of the vtable type or the name of the vtable instance for an exception type.
+#define VTABLE_TYPE(exception_name) struct _GLUE2(exception_name,_vtable)
+#define VTABLE_NAME(exception_name) _GLUE3(_,exception_name,_vtable_instance)
+
+// VTABLE_FIELD(exception_name);
+// The declaration of the virtual table field. Should be the first declaration in a virtual type.
+#define VTABLE_FIELD(exception_name) VTABLE_TYPE(exception_name) const * virtual_table
+
+// VTABLE_INIT(object_reference, exception_name);
+// Sets a virtual table field on an object to the virtual table instance for the type.
+#define VTABLE_INIT(this, exception_name) (this).virtual_table = &VTABLE_NAME(exception_name)
Index: tests/exceptions/.expect/data-except.txt
===================================================================
--- tests/exceptions/.expect/data-except.txt	(revision e68d09236d814efe89f3e680ef44217ed691df67)
+++ tests/exceptions/.expect/data-except.txt	(revision e68d09236d814efe89f3e680ef44217ed691df67)
@@ -0,0 +1,4 @@
+paired(3, 13)
+paired(3, 13)
+paired(3, 13)
+paired(4, 13)
Index: tests/exceptions/conditional.cfa
===================================================================
--- tests/exceptions/conditional.cfa	(revision d6566c1e01e9959b41be886482b3c7587a4fb829)
+++ tests/exceptions/conditional.cfa	(revision e68d09236d814efe89f3e680ef44217ed691df67)
@@ -4,8 +4,8 @@
 // up the non-trivial exception is reasonable to do.
 
-#include "except-mac.hfa"
+#include <exception.hfa>
 #include <stdio.h>
 
-DECLARE_EXCEPT(num_error, BASE_EXCEPT,
+VTABLE_DECLARATION(num_error)(
 	int (*code)(num_error *this);
 );
@@ -36,7 +36,4 @@
     this.num = other.num;
 }
-void copy(num_error * this, num_error * other) {
-	*this = *other;
-}
 void ^?{}(num_error & this) {
     if( this.msg ) free( this.msg );
@@ -46,6 +43,7 @@
 }
 
-VTABLE_INSTANCE(num_error, BASE_EXCEPT, copy, ^?{},
-	num_error_msg, num_error_code
+VTABLE_INSTANCE(num_error)(
+	num_error_msg,
+	num_error_code,
 );
 
@@ -58,5 +56,5 @@
 
 	try {
-		THROW(&exc);
+		throw &exc;
 	} catch (num_error * error ; 3 == error->virtual_table->code( error )) {
 		caught_num_error(3, error);
@@ -66,5 +64,5 @@
 
 	try {
-		THROW_RESUME(&exc);
+		throwResume &exc;
 	} catchResume (num_error * error ; 3 == error->virtual_table->code( error )) {
 		caught_num_error(3, error);
Index: tests/exceptions/data-except.cfa
===================================================================
--- tests/exceptions/data-except.cfa	(revision e68d09236d814efe89f3e680ef44217ed691df67)
+++ tests/exceptions/data-except.cfa	(revision e68d09236d814efe89f3e680ef44217ed691df67)
@@ -0,0 +1,50 @@
+// Test exceptions that add data but no functionality.
+
+#include <exception.hfa>
+
+DATA_EXCEPTION(paired)(
+	int first;
+	int second;
+);
+
+void ?{}(paired & this, int first, int second) {
+	VTABLE_INIT(this, paired);
+	this.first = first;
+	this.second = second;
+}
+
+void copy(paired * this, paired * other) {
+	*this = *other;
+}
+
+const char * paired_msg(paired * this) {
+	return "paired";
+}
+
+VTABLE_INSTANCE(paired)(paired_msg);
+
+void throwPaired(int first, int second) {
+	paired exc = {first, second};
+}
+
+int main(int argc, char * argv[]) {
+	paired except = {3, 13};
+
+	try {
+		throw &except;
+	} catch (paired * exc) {
+		printf("%s(%d, %d)\n", paired_msg(exc), exc->first, exc->second);
+		++exc->first;
+	}
+
+	printf("%s(%d, %d)\n", paired_msg(&except), except.first, except.second);
+
+	try {
+		throwResume &except;
+	} catchResume (paired * exc) {
+		printf("%s(%d, %d)\n", paired_msg(exc), exc->first, exc->second);
+		++exc->first;
+	}
+
+	printf("%s(%d, %d)\n", paired_msg(&except), except.first, except.second);
+}
Index: sts/exceptions/except-mac.hfa
===================================================================
--- tests/exceptions/except-mac.hfa	(revision d6566c1e01e9959b41be886482b3c7587a4fb829)
+++ 	(revision )
@@ -1,81 +1,0 @@
-// Macros to try and make declaring and using exceptions easier
-// No, these are not part of the language, they replace the virtual system.
-
-// Internal use:
-#define GLUE2(left, right) left##right
-#define GLUE3(left, middle, right) left##middle##right
-
-// The fully qualified name of the base exception type:
-#define BASE_EXCEPT __cfaehm_base_exception_t
-
-// Get the name of the vtable type and vtable instance for an exception type:
-#define TABLE(name) GLUE2(name,_vtable)
-#define INSTANCE(name) GLUE3(_,name,_vtable_instance)
-
-// Throws and the bit of overhead:
-#define THROW(expr) throw ((BASE_EXCEPT *)(expr))
-#define THROW_RESUME(expr) throwResume ((BASE_EXCEPT *)(expr))
-
-
-
-// The following macros are for defining your own new exception types.
-
-// Declare vtable and forward declare the exception type and vtable instance.
-// This should start a new exception declaration.
-// ... argument is the additional vtable fields.
-#define DECLARE_EXCEPT(except_name,parent_name,...) \
-struct except_name; \
-struct TABLE(except_name) { \
-	struct TABLE(parent_name) const * parent; \
-	size_t size; \
-	void (*copy)(except_name *this, except_name * other); \
-	void (*free)(except_name &this); \
-	const char * (*msg)(except_name *this); \
-	__VA_ARGS__ \
-}; \
-extern TABLE(except_name) INSTANCE(except_name)
-
-// The first field of the exception structure should be created with this.
-#define VTABLE_FIELD(except_name) \
-struct TABLE(except_name) const * virtual_table
-
-// In each constructor the vtable must be initialized.
-#define VTABLE_INIT(this_name,except_name) \
-this_name.virtual_table = &INSTANCE(except_name)
-
-// Declare the vtable instance. This should end an exception declaration.
-// ... argument is the remaining vtable field values.
-#define VTABLE_INSTANCE(except_name,parent_name,copy,free,msg,...) \
-TABLE(except_name) INSTANCE(except_name) @= { \
-	&INSTANCE(parent_name), sizeof(except_name), \
-	copy, free, msg, ## __VA_ARGS__ \
-}
-
-// Same, but used declarators for arguments.
-#define VTABLE_INSTANCE_KEY(except_name,parent_name,copy,free,msg,...) \
-TABLE(except_name) INSTANCE(except_name) @= { \
-	.parent : &INSTANCE(parent_name), .size : sizeof(except_name), \
-	.copy : copy, .free : free, .msg : msg, ## __VA_ARGS__ \
-}
-
-
-
-// Declare a trivial exception, one that adds no features:
-#define _TRIVIAL_EXCEPTION(name, parent_name, ...) \
-DECLARE_EXCEPT(name,parent_name,); \
-struct name { \
-	VTABLE_FIELD(name); \
-}; \
-const char * GLUE2(name,_msg)(name * this) { \
-    return #name; \
-} \
-void GLUE2(name,_copy)(name * this, name * other) { \
-    this->virtual_table = other->virtual_table; \
-} \
-void ?{}(name & this) { \
-	VTABLE_INIT(this,name); \
-} \
-VTABLE_INSTANCE(name,parent_name,GLUE2(name,_copy),^?{},GLUE2(name,_msg),)
-
-// TRIVIAL_EXCEPTION(name_of_exception, [parent_exception])
-#define TRIVIAL_EXCEPTION(...) _TRIVIAL_EXCEPTION(__VA_ARGS__,BASE_EXCEPT,)
Index: tests/exceptions/finally.cfa
===================================================================
--- tests/exceptions/finally.cfa	(revision d6566c1e01e9959b41be886482b3c7587a4fb829)
+++ tests/exceptions/finally.cfa	(revision e68d09236d814efe89f3e680ef44217ed691df67)
@@ -1,5 +1,5 @@
 // Finally Clause Tests
 
-#include "except-mac.hfa"
+#include <exception.hfa>
 #include "except-io.hfa"
 
@@ -12,5 +12,5 @@
 		try {
 			printf("termination throw\n");
-			THROW(&exc);
+			throw &exc;
 		} finally {
 			loud_exit a = "termination inner finally";
@@ -28,5 +28,5 @@
 		try {
 			printf("resumption throw\n");
-			THROW_RESUME(&exc);
+			throwResume &exc;
 		} finally {
 			loud_exit a = "resumption inner finally";
Index: tests/exceptions/interact.cfa
===================================================================
--- tests/exceptions/interact.cfa	(revision d6566c1e01e9959b41be886482b3c7587a4fb829)
+++ tests/exceptions/interact.cfa	(revision e68d09236d814efe89f3e680ef44217ed691df67)
@@ -1,5 +1,5 @@
 // Testing Interactions Between Termination and Resumption
 
-#include "except-mac.hfa"
+#include <exception.hfa>
 #include "except-io.hfa"
 
@@ -10,5 +10,5 @@
 	// Resume falls back to terminate.
 	try {
-		THROW_RESUME(&(star){});
+		throwResume &(star){};
 	} catch (star *) {
 		printf("caught as termination\n");
@@ -17,5 +17,5 @@
 	try {
 		loud_region a = "try block with resume throw";
-		THROW_RESUME(&(star){});
+		throwResume &(star){};
 	} catch (star *) {
 		printf("caught as termination\n");
@@ -29,5 +29,5 @@
 	try {
 		try {
-			THROW(&(star){});
+			throw &(star){};
 		} catchResume (star *) {
 			printf("resume catch on terminate\n");
@@ -43,5 +43,5 @@
 	try {
 		try {
-			THROW_RESUME(&(star){});
+			throwResume &(star){};
 		} catch (star *) {
 			printf("terminate catch on resume\n");
@@ -58,5 +58,5 @@
 		try {
 			try {
-				THROW(&(star){});
+				throw &(star){};
 			} catchResume (star *) {
 				printf("inner resume catch (error)\n");
@@ -64,5 +64,5 @@
 		} catch (star * error) {
 			printf("termination catch, will resume\n");
-			THROW_RESUME(error);
+			throwResume error;
 		}
 	} catchResume (star *) {
@@ -75,5 +75,5 @@
 		try {
 			try {
-				THROW_RESUME(&(star){});
+				throwResume &(star){};
 			} catch (star *) {
 				printf("inner termination catch\n");
@@ -81,5 +81,5 @@
 		} catchResume (star * error) {
 			printf("resumption catch, will terminate\n");
-			THROW(error);
+			throw error;
 		}
 	} catch (star *) {
@@ -94,10 +94,10 @@
 				try {
 					printf("throwing resume moon\n");
-					THROW_RESUME(&(moon){});
+					throwResume &(moon){};
 				} catch (star *) {
 					printf("termination catch\n");
 				}
 				printf("throwing resume star\n");
-				THROW_RESUME(&(star){});
+				throwResume &(star){};
 			} catchResume (star *) {
 				printf("resumption star catch\n");
@@ -105,5 +105,5 @@
 		} catchResume (moon *) {
 			printf("resumption moon catch, will terminate\n");
-			THROW(&(star){});
+			throw &(star){};
 		}
 	} catchResume (star *) {
Index: tests/exceptions/resume.cfa
===================================================================
--- tests/exceptions/resume.cfa	(revision d6566c1e01e9959b41be886482b3c7587a4fb829)
+++ tests/exceptions/resume.cfa	(revision e68d09236d814efe89f3e680ef44217ed691df67)
@@ -1,5 +1,5 @@
 // Resumption Exception Tests
 
-#include "except-mac.hfa"
+#include <exception.hfa>
 #include "except-io.hfa"
 
@@ -14,5 +14,5 @@
 		loud_exit a = "simple try clause";
 		printf("simple throw\n");
-		THROW_RESUME(&(zen){});
+		throwResume &(zen){};
 		printf("end of try clause\n");
 	} catchResume (zen * error) {
@@ -25,5 +25,5 @@
 	try {
 		printf("throwing child exception\n");
-		THROW_RESUME(&(moment_of){});
+		throwResume &(moment_of){};
 	} catchResume (zen *) {
 		printf("inner parent match\n");
@@ -36,5 +36,5 @@
 	try {
 		try {
-			THROW_RESUME(&(yin){});
+			throwResume &(yin){};
 		} catchResume (zen *) {
 			printf("caught yin as zen\n");
@@ -52,5 +52,5 @@
 			loud_exit a = "rethrow inner try";
 			printf("rethrow inner try\n");
-			THROW_RESUME(&(zen){});
+			throwResume &(zen){};
 		} catchResume (zen *) {
 			loud_exit a = "rethrowing catch clause";
@@ -67,8 +67,8 @@
 	try {
 		try {
-			THROW_RESUME(&(yin){});
+			throwResume &(yin){};
 		} catchResume (yin *) {
 			printf("caught yin, will throw yang\n");
-			THROW_RESUME(&(yang){});
+			throwResume &(yang){};
 		} catchResume (yang *) {
 			printf("caught exception from same try\n");
@@ -83,10 +83,10 @@
 		try {
 			printf("throwing first exception\n");
-			THROW_RESUME(&(yin){});
+			throwResume &(yin){};
 		} catchResume (yin *) {
 			printf("caught first exception\n");
 			try {
 				printf("throwing second exception\n");
-				THROW_RESUME(&(yang){});
+				throwResume &(yang){};
 			} catchResume (yang *) {
 				printf("caught second exception\n");
@@ -104,10 +104,10 @@
 	try {
 		try {
-			THROW_RESUME(&(zen){});
-			THROW_RESUME(&(zen){});
+			throwResume &(zen){};
+			throwResume &(zen){};
 		} catchResume (zen *) {
 			printf("inner catch\n");
 		}
-		THROW_RESUME(&(zen){});
+		throwResume &(zen){};
 	} catchResume (zen *) {
 		printf("outer catch\n");
Index: tests/exceptions/terminate.cfa
===================================================================
--- tests/exceptions/terminate.cfa	(revision d6566c1e01e9959b41be886482b3c7587a4fb829)
+++ tests/exceptions/terminate.cfa	(revision e68d09236d814efe89f3e680ef44217ed691df67)
@@ -1,5 +1,5 @@
 // Termination Exception Tests
 
-#include "except-mac.hfa"
+#include <exception.hfa>
 #include "except-io.hfa"
 
@@ -14,5 +14,5 @@
 		loud_exit a = "simple try clause";
 		printf("simple throw\n");
-		THROW(&(zen){});
+		throw &(zen){};
 		printf("end of try clause\n");
 	} catch (zen * error) {
@@ -25,5 +25,5 @@
 	try {
 		printf("throwing child exception\n");
-		THROW(&(moment_of){});
+		throw &(moment_of){};
 	} catch (zen *) {
 		printf("inner parent match\n");
@@ -36,5 +36,5 @@
 	try {
 		try {
-			THROW(&(yin){});
+			throw &(yin){};
 		} catch (zen *) {
 			printf("caught yin as zen\n");
@@ -52,5 +52,5 @@
 			loud_exit a = "rethrow inner try";
 			printf("rethrow inner try\n");
-			THROW(&(zen){});
+			throw &(zen){};
 		} catch (zen *) {
 			loud_exit a = "rethrowing catch clause";
@@ -67,8 +67,8 @@
 	try {
 		try {
-			THROW(&(yin){});
+			throw &(yin){};
 		} catch (yin *) {
 			printf("caught yin, will throw yang\n");
-			THROW(&(yang){});
+			throw &(yang){};
 		} catch (yang *) {
 			printf("caught exception from same try\n");
@@ -83,10 +83,10 @@
 		try {
 			printf("throwing first exception\n");
-			THROW(&(yin){});
+			throw &(yin){};
 		} catch (yin *) {
 			printf("caught first exception\n");
 			try {
 				printf("throwing second exception\n");
-				THROW(&(yang){});
+				throw &(yang){};
 			} catch (yang *) {
 				printf("caught second exception\n");
@@ -104,10 +104,10 @@
 	try {
 		try {
-			THROW(&(zen){});
-			THROW(&(zen){});
+			throw &(zen){};
+			throw &(zen){};
 		} catch (zen *) {
 			printf("inner catch\n");
 		}
-		THROW(&(zen){});
+		throw &(zen){};
 	} catch (zen *) {
 		printf("outer catch\n");
