Changed the location of the AOP instrumentation pass.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Thu, 1 Apr 2010 20:14:36 +0000 (16:14 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Thu, 1 Apr 2010 20:14:36 +0000 (16:14 -0400)
With the instrumentation pass occuring much earlier in compilation, it
is much less likely for optimizations to interfere with
intstrumentation.

Added PAUSE_ON_START debugging feature.

src/aop-main.c

index 4d05415a9f6eef434d0a0eaaca56013d6d375cec..1a461e18c65c402ee1b19d8e99044677c6532fae 100644 (file)
@@ -53,6 +53,8 @@
 #include "aop.h"
 #include "aop-pointcut.h"
 
+//#define PAUSE_ON_START
+
 static const char *aop_plugin_name;
 
 void
@@ -100,9 +102,9 @@ aop_register_pass (const char *pass_name, pass_callback callback)
   pass_aop->execute = callback;
 
   pass_info.pass = pass_aop;
-  pass_info.reference_pass_name = "*all_optimizations";
+  pass_info.reference_pass_name = "cfg";
   pass_info.ref_pass_instance_number = 0;
-  pass_info.pos_op = PASS_POS_INSERT_BEFORE;
+  pass_info.pos_op = PASS_POS_INSERT_AFTER;
 
   /* Safe the pointer to this object so we can free it later. */
   VEC_safe_push(aop_pass, heap, aop_pass_list, pass_aop);
@@ -152,6 +154,12 @@ plugin_init (struct plugin_name_args *plugin_info,
 {
   fprintf (stderr, "InterAspect init.\n");
 
+#ifdef PAUSE_ON_START
+  fprintf(stderr, "cc has PID %d.  Attach debugger now.\n", getpid());
+  fprintf(stderr, "[Enter to continue.]\n");
+  scanf("%*c");
+#endif
+
   aop_plugin_name = plugin_info->base_name;
 
   /* Register our cleanup function. */