loci: add transparent union for list iteration

This is the first step in getting rid of both inheritance unions and header
classes. Callers can now use either e.g. of_action_t or of_object_t for list
iteration. Once all callers are converted to of_object_t the union will be
removed.
diff --git a/c_gen/templates/loci_classes.h b/c_gen/templates/loci_classes.h
index c5147cb..86fe36b 100644
--- a/c_gen/templates/loci_classes.h
+++ b/c_gen/templates/loci_classes.h
@@ -36,6 +36,22 @@
 void ${uclass.name}_push_wire_types(of_object_t *obj);
 :: #endfor
 
+/*
+ * Transparent union used for list iteration
+ *
+ * This will be removed when all callers are converted to of_object_t.
+ */
+union of_list_iter_u {
+    of_object_t *obj;
+:: for uclass in loxi_globals.unified.classes:
+:: if uclass.virtual and not uclass.superclass:
+    union ${uclass.name}_u *${uclass.name};
+:: #endif
+:: #endfor
+} __attribute__ ((__transparent_union__));
+
+typedef union of_list_iter_u of_list_iter_t;
+
 ${legacy_code}
 
 #endif