#include <gimple.h>
#include "aop.h"
+#include "aop-duplicate.h"
#include "aop-dynval.h"
#include "aop-pointcut.h"
#include "aop-type.h"
}
}
-
/* Given an expression from the lhs of an assignment, return true
unless it is a temporary variable created by the compiler.
}
}
+static void join_on_bb_assign (basic_block bb, struct aop_pointcut *pc,
+ join_callback cb, void *callback_param)
+{
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start_bb (bb) ; !gsi_end_p (gsi) ; gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+
+ if (stmt_matches_pointcut (pc, stmt))
+ {
+ struct aop_joinpoint jp;
+ init_joinpoint (&jp, &gsi, pc, stmt);
+ cb (&jp, callback_param);
+ }
+ }
+}
+
static void
op_join_on_assign (struct aop_pointcut *pc, join_callback cb,
void *callback_param)
FOR_EACH_BB(bb)
{
- gimple_stmt_iterator gsi;
-
- for (gsi = gsi_start_bb (bb) ; !gsi_end_p (gsi) ; gsi_next (&gsi))
- {
- gimple stmt = gsi_stmt (gsi);
-
- if (stmt_matches_pointcut (pc, stmt))
- {
- struct aop_joinpoint jp;
- init_joinpoint (&jp, &gsi, pc, stmt);
- cb (&jp, callback_param);
- }
- }
+ join_on_bb_assign (bb, pc, cb, callback_param);
}
}
op_join_on_copy_assign (struct aop_pointcut *pc, int copy, join_callback cb,
void *callback_param)
{
- /* Not yet supported. */
- aop_assert(0);
+ unsigned int pair_index;
+ bb_pair *pair;
+
+ aop_assert (is_current_func_duplicated ());
+ aop_assert (pc->kind == ATP_ASSIGN);
+
+ FOR_EACH_BB_PAIR (bb_pairs, pair_index, pair)
+ {
+ basic_block bb = (copy == 0) ? pair->old : pair->new;
+
+ join_on_bb_assign (bb, pc, cb, callback_param);
+ }
}
/**