Documenation for aop_main() and aop_reigster_pass().
authorJustin Seyster <jseyster@cs.sunysb.edu>
Wed, 20 Oct 2010 01:19:21 +0000 (21:19 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Wed, 20 Oct 2010 01:19:21 +0000 (21:19 -0400)
src/aop-main.c
src/aop.h

index ccd488ead06782301a38e2263dec4854efac15d7..dbb5ce97df96e45fe48203435611db9e7222a0db 100644 (file)
@@ -326,6 +326,21 @@ static struct opt_pass template_pass = {
   .todo_flags_finish = TODO_update_ssa,
 };
 
+/**
+ * Register an instrumentation pass with GCC.  Most InterAspect-based
+ * plug-ins will call this function once (from aop_main()) to register
+ * the a pass that will do all the instrumentation work.
+ *
+ * In GCC, a pass is a function that gets called once for each
+ * compiled function in the target program.  Each time the pass
+ * function executes, it directly modifies the current function.
+ *
+ * Passes added with aop_register_pass() will be executed in the order
+ * they are added.
+ *
+ * \param pass_name A name for the pass.
+ * \param callback The pass function to register.
+ */
 void
 aop_register_pass (const char *pass_name, pass_callback callback)
 {
index 5cbdb6c130c50d89beb6a5dc62a3bc226304927e..fb077a53596917aec2dade666d40243d392feb9a 100644 (file)
--- a/src/aop.h
+++ b/src/aop.h
@@ -197,6 +197,13 @@ extern void aop_join_on (struct aop_pointcut *pc, join_callback callback,
                         void *callback_param);
 extern void aop_join_on_copy (struct aop_pointcut *pc, int copy,
                              join_callback callback, void *callback_param);
+
+/**
+ * The aop_main() function is the only function that a client plug-in
+ * <i>must</i> define in order to link with InterAspect.  InterAspect
+ * will call aop_main() right at the beginning of compilation, giving
+ * it the opportunity to register a pass using aop_register_pass().
+ */
 extern void aop_main ();
 
 extern void aop_abort (const char *filename, int lineno, const char *function)