}
}
+/**
+ * InterAspect calls this function after all compilation is finished
+ * and before GCC and InterAspect data structures are destroyed. It
+ * is provided so that InterAspect plug-ins can override it (by
+ * providing their own version), giving them a last chance to clean up
+ * data structures or free up other resources.
+ *
+ * The best place to output an automatic header (using
+ * aop_write_c_header()) is in aop_finish().
+ */
+__attribute__((weak)) __attribute__((noinline)) void
+aop_finish ()
+{
+ /* This function exists only to be overridden. */
+
+ /* Weird bug: if this function is empty, GCC inlines the call to it
+ in aop_cleanup() making it impossible to override (even if we
+ explicitly specify noinline). We can trick GCC into emitting the
+ calls with this empty assembly block. */
+ __asm__ volatile ("");
+}
+
/**
* Find the value for a command-line argument passed to the plug-in.
* You can pass a key/value argument to your plug-in on the GCC
static void
aop_cleanup (void *event_date, void *data)
{
+ aop_finish ();
+
free_type_table ();
free_prototype_table ();
cleanup_passes ();