From 914c58c59847f9b8884bf85e4c72527dc6fce60f Mon Sep 17 00:00:00 2001 From: Justin Seyster Date: Wed, 27 Oct 2010 20:09:01 -0400 Subject: [PATCH] Fixed bug where entry pointcut wouldn't know the filename/lineno. In this case, if the user called aop_duplicate() with a captured in_param. --- src/aop-weave.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/aop-weave.c b/src/aop-weave.c index 711e753..ca8fc02 100644 --- a/src/aop-weave.c +++ b/src/aop-weave.c @@ -41,6 +41,8 @@ #include #include #include +#include + #include /* Defining GENERATOR_FILE prevents real.h from also including the @@ -456,12 +458,22 @@ insert_stmts_at_entry (VEC(gimple, heap) *stmt_list) int i; edge in_edge; gimple stmt; + gimple entry_stmt; + + entry_stmt = first_stmt (ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun)->next_bb); /* Get the edge for the main entry point. */ in_edge = single_succ_edge (ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun)); for (i = 0; VEC_iterate (gimple, stmt_list, i, stmt); i++) - gsi_insert_on_edge_immediate (in_edge, stmt); + { + /* This is so entry pointcut functions can still tell what the + line number/filename is for this function's entry. */ + if (first_stmt != NULL) + gimple_set_location (stmt, gimple_location (entry_stmt)); + + gsi_insert_on_edge_immediate (in_edge, stmt); + } } /** -- 2.34.1