#include <tm.h>
#include <tree.h>
#include <gimple.h>
+#include <tree-flow.h>
+
#include <toplev.h>
/* Defining GENERATOR_FILE prevents real.h from also including the
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);
+ }
}
/**