tree call;
/* If we are not profiling, just call the function. */
- if (!profile_arc_flag && !condition_coverage_flag && !path_coverage_flag)
+ if (!coverage_instrumentation_p ())
return NULL_RTX;
/* Otherwise call the wrapper. This should be equivalent for the rest of
}
gcc_assert (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->caller->decl))
&& gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->decl)));
- if ((profile_arc_flag || condition_coverage_flag || path_coverage_flag)
+ if (coverage_instrumentation_p ()
&& ((lookup_attribute ("no_profile_instrument_function",
DECL_ATTRIBUTES (caller->decl)) == NULL_TREE)
!= (lookup_attribute ("no_profile_instrument_function",
gcc::dump_manager *dumps = m_ctxt->get_dumps ();
timevar_push (TV_DUMP);
- if (profile_arc_flag || condition_coverage_flag || path_coverage_flag
- || flag_test_coverage || flag_branch_probabilities)
+ if (coverage_instrumentation_p () || flag_test_coverage
+ || flag_branch_probabilities)
{
dumps->dump_start (pass_profile_1->static_pass_number, NULL);
end_branch_prob ();
total_num_conds);
}
}
+
+/* Return true if any cfg coverage/profiling is enabled; -fprofile-arcs
+ -fcondition-coverage -fpath-coverage. */
+bool coverage_instrumentation_p ()
+{
+ return profile_arc_flag || condition_coverage_flag || path_coverage_flag;
+}
profile.cc. */
extern struct gcov_summary *profile_info;
+/* Return true if any cfg coverage/profiling is enabled; -fprofile-arcs
+ -fcondition-coverage -fpath-coverage. */
+extern bool coverage_instrumentation_p ();
+
#endif /* PROFILE_H */
thunk = true;
/* When generate profile, expand thunk to gimple so it can be
instrumented same way as other functions. */
- if (profile_arc_flag || condition_coverage_flag || path_coverage_flag)
+ if (coverage_instrumentation_p ())
expand_thunk (node, false, true);
/* Read cgraph profile but keep function as thunk at profile-use
time. */
release_profile_file_filtering ();
/* Drop pure/const flags from instrumented functions. */
- if (profile_arc_flag || condition_coverage_flag || path_coverage_flag
- || flag_test_coverage)
+ if (coverage_instrumentation_p () || flag_test_coverage)
FOR_EACH_DEFINED_FUNCTION (node)
{
if (!gimple_has_body_p (node->decl)
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
- if (profile_arc_flag || condition_coverage_flag || path_coverage_flag
- || flag_test_coverage)
+ if (coverage_instrumentation_p () || flag_test_coverage)
FOR_EACH_BB_FN (bb, cfun)
{
gimple_stmt_iterator gsi;
disabled. */
return (!in_lto_p && !flag_auto_profile
&& (flag_branch_probabilities || flag_test_coverage
- || profile_arc_flag || condition_coverage_flag
- || path_coverage_flag)
+ || coverage_instrumentation_p ())
&& !seen_error ());
}
extern void read_thunk_profile (struct cgraph_node *);
extern void end_branch_prob (void);
+/* Return true if any cfg coverage/profiling is enabled; -fprofile-arcs
+ -fcondition-coverage -fpath-coverage. */
+extern bool coverage_instrumentation_p ();
+
#endif /* GCC_VALUE_PROF_H */