{
int i;
char *out;
+ const char *return_type;
size_t size;
struct aop_prototype *prototype = *table_entry;
htab_t prototype_strings = (htab_t)info;
out = line;
size = sizeof (line);
- BUF_PRINTF ("void %s(", prototype->name);
+ return_type = prototype->has_return_value ? "int" : "void";
+ BUF_PRINTF ("%s %s(", return_type, prototype->name);
/* Print each of the types. */
for (i = 0; i < prototype->num_params; i++)
gsi_insert_before (jp->gsi, stmt, GSI_SAME_STMT);
}
-
/* This is the default insert_after() operation for aop_pointcut
objects. It just inserts a gimple statement before the iterator in
the aop_joinpoint object. This function holds to the requirement
argp);
va_end (argp);
+ va_start (argp, func_name);
+ insert_prototype (true /* int return type */, func_name,
+ gimple_call_num_args (func_call), argp);
+
duplicate_function_body ("ia_body_index", func_call);
}
In bar: 10!
In exit advice: One
</output>
+ <prototypes>
+ int _distrib();
+ void _assign_advice();
+ void _bar_advice();
+ void _entry_advice(signed char *, ALL_SIGNED_T);
+ void _exit_advice(signed char *);
+ </prototypes>
</run>
</testcase>
return 0;
}
+void aop_finish()
+{
+ const char *header;
+ header = aop_get_arg_value("header");
+
+ if (header != NULL) {
+ int res;
+ res = aop_write_c_header(header, "_INT_HEADER_", NULL, NULL);
+ if (res != 0)
+ perror(header);
+ }
+}
+
AOP_MAIN_PROTO aop_main()
{
aop_register_pass("duplicate", plugin_duplicate);