From: Justin Seyster Date: Wed, 20 Oct 2010 01:19:21 +0000 (-0400) Subject: Documenation for aop_main() and aop_reigster_pass(). X-Git-Tag: release-v1.0~28^2~11 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=5f8728e55dff924d14afae8adde4876a2a32a5d3;p=interaspect.git Documenation for aop_main() and aop_reigster_pass(). --- diff --git a/src/aop-main.c b/src/aop-main.c index ccd488e..dbb5ce9 100644 --- a/src/aop-main.c +++ b/src/aop-main.c @@ -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) { diff --git a/src/aop.h b/src/aop.h index 5cbdb6c..fb077a5 100644 --- 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 + * must 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)