#include "aop-pointcut.h"
#include "aop-type.h"
+const char *
+aop_capture_lhs_name (struct aop_joinpoint *jp)
+{
+ gimple stmt;
+ tree lhs;
+
+ aop_assert (jp->pc->kind == ATP_ASSIGN);
+
+ stmt = gsi_stmt (*jp->gsi);
+ aop_assert (gimple_has_lhs (stmt));
+ lhs = gimple_get_lhs (stmt);
+
+ if (TREE_CODE (lhs) == SSA_NAME)
+ lhs = SSA_NAME_VAR (lhs);
+
+ if (lhs != NULL && DECL_P (lhs))
+ {
+ tree name = DECL_NAME (lhs);
+ if (name != NULL)
+ return IDENTIFIER_POINTER (name);
+ else
+ return NULL;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
static bool
stmt_matches_pointcut (struct aop_pointcut *pc, gimple stmt)
{
extern struct aop_pointcut *aop_match_assignment_by_type (struct aop_type *type);
+extern const char *aop_capture_lhs_name (struct aop_joinpoint *jp);
+
extern void aop_register_pass (const char *pass_name, pass_callback callback);
extern void aop_join_on (struct aop_pointcut *pc, join_callback callback);
extern void aop_main ();