You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
/* Generate basic block profile instrumentation and auxiliary files.
Tree-based version. See profile.c for overview. */
prepare_instrumented_value (block_stmt_iterator *bsi,
histogram_value value)
{
- tree val = value->hvalue.tree.value;
+ tree val = value->hvalue.value;
return force_gimple_operand_bsi (bsi, fold_convert (gcov_type_node, val),
true, NULL_TREE);
}
static void
tree_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base)
{
- tree stmt = value->hvalue.tree.stmt;
+ tree stmt = value->hvalue.stmt;
block_stmt_iterator bsi = bsi_for_stmt (stmt);
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
tree args, call, val;
static void
tree_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base)
{
- tree stmt = value->hvalue.tree.stmt;
+ tree stmt = value->hvalue.stmt;
block_stmt_iterator bsi = bsi_for_stmt (stmt);
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
tree args, call, val;
static void
tree_gen_one_value_profiler (histogram_value value, unsigned tag, unsigned base)
{
- tree stmt = value->hvalue.tree.stmt;
+ tree stmt = value->hvalue.stmt;
block_stmt_iterator bsi = bsi_for_stmt (stmt);
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
tree args, call, val;
static bool
do_tree_profiling (void)
{
- if (flag_tree_based_profiling
- && (profile_arc_flag || flag_test_coverage || flag_branch_probabilities))
+ if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
{
tree_register_profile_hooks ();
tree_register_value_prof_hooks ();
0 /* letter */
};
+/* Return 1 if tree-based profiling is in effect, else 0.
+ If it is, set up hooks for tree-based profiling.
+ Gate for pass_tree_profile. */
+
+static bool
+do_early_tree_profiling (void)
+{
+ return (do_tree_profiling () && (!flag_unit_at_a_time || !optimize));
+}
+
+struct tree_opt_pass pass_early_tree_profile =
+{
+ "early_tree_profile", /* name */
+ do_early_tree_profiling, /* gate */
+ tree_profiling, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_BRANCH_PROB, /* tv_id */
+ PROP_gimple_leh | PROP_cfg, /* properties_required */
+ PROP_gimple_leh | PROP_cfg, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_stmts, /* todo_flags_finish */
+ 0 /* letter */
+};
+
struct profile_hooks tree_profile_hooks =
{
tree_init_edge_profiler, /* init_edge_profiler */