No longer need a join point to find out the current function name.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Wed, 20 Oct 2010 18:24:35 +0000 (14:24 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Wed, 20 Oct 2010 18:24:35 +0000 (14:24 -0400)
src/aop-main.c
src/aop.h
test/plugin-duplicate.c
test/plugin-pointer-types.c
test/plugin-reinst-dup.c

index 1b63018c36de13ec6e96c53b277205e310b57cd3..d554d16996532e5c51381fbcb453686be627dbab 100644 (file)
@@ -453,8 +453,12 @@ aop_abort (const char *filename, int lineno, const char *function)
   fancy_abort(filename, lineno, function);
 }
 
+/**
+ * Get the name of the current function.  You can call this directly
+ * from a pass function or from any join point iterator function.
+ */
 const char *
-aop_capture_function_name (struct aop_joinpoint *jp)
+aop_get_function_name (void)
 {
   return IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
 }
index 7ef9082ca53c3e71d52fc68c552ae52a81d4ba19..9522ee09b333a6b8f11e3cdc88ae4608ad0f429a 100644 (file)
--- a/src/aop.h
+++ b/src/aop.h
@@ -261,7 +261,7 @@ enum aop_argkind {
  */
 #define AOP_DYNVAL(VAL) ATA_DYNVAL, VAL
 
-extern const char *aop_capture_function_name (struct aop_joinpoint *jp);
+extern const char *aop_get_function_name (void);
 
 extern struct aop_pointcut *aop_match_function_entry ();
 extern void aop_filter_by_in_param (struct aop_pointcut *pc, int n,
index e6ef15f48c76840fd97a12c54b239a07974f59c1..73c4f7f3613f2f2d43f147d9bea4f8f857cdc3cd 100644 (file)
@@ -10,7 +10,7 @@ static void plugin_join_on_entry(struct aop_joinpoint *jp, void *data)
 {
   const char *name;
 
-  name = aop_capture_function_name(jp);
+  name = aop_get_function_name();
   if (name != NULL && strcmp(name, "foo") == 0) {
     aop_duplicate(jp, "_distrib", AOP_TERM_ARG);
     duplicated = 1;
index 971c5eebca48cd6164af955246b6067f13cdc121..06468ea29b0eaab8995510e2555cd4cceba0daa6 100644 (file)
@@ -11,7 +11,7 @@ static void plugin_join_on_call(struct aop_joinpoint *jp, void *data)
   const char *called;
   struct aop_dynval *p;
 
-  func = aop_capture_function_name(jp);
+  func = aop_get_function_name();
   if (func == NULL || strcmp(func, "run_test") != 0)
     return;
 
index 63ac3b0f23c5f5d7389d19620fd8bad0ea6e8b22..93231aba24365358b5f5bdc23b853808d1ad3aed 100644 (file)
@@ -10,7 +10,7 @@ static void plugin_join_on_entry(struct aop_joinpoint *jp, void *data)
 {
   const char *name;
 
-  name = aop_capture_function_name(jp);
+  name = aop_get_function_name();
   if (name != NULL && strcmp(name, "foo") == 0) {
     aop_duplicate(jp, "_distrib", AOP_TERM_ARG);
     duplicated = 1;