Remove MAY_HAVE_DEBUG_MARKER_STMTS and MAY_HAVE_DEBUG_BIND_STMTS.

The macros correspond 1:1 to an option flags and make it harder
to find all usages of the flags.

gcc/c-family/ChangeLog:

	* c-gimplify.c (genericize_c_loop): Use option directly.

gcc/c/ChangeLog:

	* c-parser.c (add_debug_begin_stmt): Use option directly.

gcc/ChangeLog:

	* cfgexpand.c (pass_expand::execute): Use option directly.
	* function.c (allocate_struct_function): Likewise.
	* gimple-low.c (lower_function_body): Likewise.
	(lower_stmt): Likewise.
	* gimple-ssa-backprop.c (backprop::prepare_change): Likewise.
	* ipa-param-manipulation.c (ipa_param_adjustments::modify_call): Likewise.
	* ipa-split.c (split_function): Likewise.
	* lto-streamer-in.c (input_function): Likewise.
	* sese.c (sese_insert_phis_for_liveouts): Likewise.
	* ssa-iterators.h (num_imm_uses): Likewise.
	* tree-cfg.c (make_blocks): Likewise.
	(gimple_merge_blocks): Likewise.
	* tree-inline.c (tree_function_versioning): Likewise.
	* tree-loop-distribution.c (generate_loops_for_partition): Likewise.
	* tree-sra.c (analyze_access_subtree): Likewise.
	* tree-ssa-dce.c (remove_dead_stmt): Likewise.
	* tree-ssa-loop-ivopts.c (remove_unused_ivs): Likewise.
	* tree-ssa-phiopt.c (spaceship_replacement): Likewise.
	* tree-ssa-reassoc.c (reassoc_remove_stmt): Likewise.
	* tree-ssa-tail-merge.c (tail_merge_optimize): Likewise.
	* tree-ssa-threadedge.c (propagate_threaded_block_debug_into): Likewise.
	* tree-ssa.c (gimple_replace_ssa_lhs): Likewise.
	(target_for_debug_bind): Likewise.
	(insert_debug_temp_for_var_def): Likewise.
	(insert_debug_temps_for_defs): Likewise.
	(reset_debug_uses): Likewise.
	* tree-ssanames.c (release_ssa_name_fn): Likewise.
	* tree-vect-loop-manip.c (adjust_vec_debug_stmts): Likewise.
	(adjust_debug_stmts): Likewise.
	(adjust_phi_and_debug_stmts): Likewise.
	(vect_do_peeling): Likewise.
	* tree-vect-loop.c (vect_transform_loop_stmt): Likewise.
	(vect_transform_loop): Likewise.
	* tree.h (MAY_HAVE_DEBUG_MARKER_STMTS): Remove
	(MAY_HAVE_DEBUG_BIND_STMTS): Remove.
	(MAY_HAVE_DEBUG_STMTS): Use options directly.

gcc/cp/ChangeLog:

	* parser.c (add_debug_begin_stmt): Use option directly.
This commit is contained in:
Martin Liska 2021-10-15 16:34:34 +02:00
parent e28afbb90f
commit 206b22d021
27 changed files with 41 additions and 46 deletions

View File

@ -295,7 +295,7 @@ genericize_c_loop (tree *stmt_p, location_t start_locus, tree cond, tree body,
finish_bc_block (&stmt_list, bc_continue, clab);
if (incr)
{
if (MAY_HAVE_DEBUG_MARKER_STMTS && incr_locus != UNKNOWN_LOCATION)
if (debug_nonbind_markers_p && incr_locus != UNKNOWN_LOCATION)
{
tree d = build0 (DEBUG_BEGIN_STMT, void_type_node);
SET_EXPR_LOCATION (d, expr_loc_or_loc (incr, start_locus));
@ -305,7 +305,7 @@ genericize_c_loop (tree *stmt_p, location_t start_locus, tree cond, tree body,
}
append_to_statement_list (entry, &stmt_list);
if (MAY_HAVE_DEBUG_MARKER_STMTS && cond_locus != UNKNOWN_LOCATION)
if (debug_nonbind_markers_p && cond_locus != UNKNOWN_LOCATION)
{
tree d = build0 (DEBUG_BEGIN_STMT, void_type_node);
SET_EXPR_LOCATION (d, cond_locus);

View File

@ -1791,7 +1791,7 @@ static void
add_debug_begin_stmt (location_t loc)
{
/* Don't add DEBUG_BEGIN_STMTs outside of functions, see PR84721. */
if (!MAY_HAVE_DEBUG_MARKER_STMTS || !building_stmt_list_p ())
if (!debug_nonbind_markers_p || !building_stmt_list_p ())
return;
tree stmt = build0 (DEBUG_BEGIN_STMT, void_type_node);

View File

@ -6587,7 +6587,7 @@ pass_expand::execute (function *fun)
timevar_pop (TV_OUT_OF_SSA);
SA.partition_to_pseudo = XCNEWVEC (rtx, SA.map->num_partitions);
if (MAY_HAVE_DEBUG_BIND_STMTS && flag_tree_ter)
if (flag_var_tracking_assignments && flag_tree_ter)
{
gimple_stmt_iterator gsi;
FOR_EACH_BB_FN (bb, cfun)

View File

@ -11684,7 +11684,7 @@ cp_parser_lambda_body (cp_parser* parser, tree lambda_expr)
static void
add_debug_begin_stmt (location_t loc)
{
if (!MAY_HAVE_DEBUG_MARKER_STMTS)
if (!debug_nonbind_markers_p)
return;
if (DECL_DECLARED_CONCEPT_P (current_function_decl))
/* A concept is never expanded normally. */

View File

@ -4872,7 +4872,7 @@ allocate_struct_function (tree fndecl, bool abstract_p)
disabled. The markers make little sense without the variable
binding annotations among them. */
cfun->debug_nonbind_markers = lang_hooks.emits_begin_stmt
&& MAY_HAVE_DEBUG_MARKER_STMTS;
&& debug_nonbind_markers_p;
}
/* This is like allocate_struct_function, but pushes a new cfun for FNDECL

View File

@ -114,7 +114,7 @@ lower_function_body (void)
/* If we had begin stmt markers from e.g. PCH, but this compilation
doesn't want them, lower_stmt will have cleaned them up; we can
now clear the flag that indicates we had them. */
if (!MAY_HAVE_DEBUG_MARKER_STMTS && cfun->debug_nonbind_markers)
if (!debug_nonbind_markers_p && cfun->debug_nonbind_markers)
{
/* This counter needs not be exact, but before lowering it will
most certainly be. */
@ -316,7 +316,7 @@ lower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data)
/* Propagate fallthruness. */
/* If the function (e.g. from PCH) had debug stmts, but they're
disabled for this compilation, remove them. */
if (!MAY_HAVE_DEBUG_MARKER_STMTS)
if (!debug_nonbind_markers_p)
gsi_remove (gsi, true);
else
gsi_next (gsi);

View File

@ -737,7 +737,7 @@ strip_sign_op (tree rhs)
void
backprop::prepare_change (tree var)
{
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
insert_debug_temp_for_var_def (NULL, var);
reset_flow_sensitive_info (var);
}

View File

@ -832,7 +832,7 @@ ipa_param_adjustments::modify_call (cgraph_edge *cs,
vector to say for debug info that if parameter parm had been passed,
it would have value parm_Y(D). */
tree old_decl = gimple_call_fndecl (stmt);
if (MAY_HAVE_DEBUG_BIND_STMTS && old_decl && callee_decl)
if (flag_var_tracking_assignments && old_decl && callee_decl)
{
vec<tree, va_gc> **debug_args = NULL;
unsigned i = 0;

View File

@ -1465,7 +1465,7 @@ split_function (basic_block return_bb, class split_point *split_point,
{
vec<tree, va_gc> **debug_args = NULL;
unsigned i = 0, len = 0;
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
{
debug_args = decl_debug_args_lookup (node->decl);
if (debug_args)
@ -1479,11 +1479,11 @@ split_function (basic_block return_bb, class split_point *split_point,
gimple *def_temp;
/* This needs to be done even without
MAY_HAVE_DEBUG_BIND_STMTS, otherwise if it didn't exist
flag_var_tracking_assignments, otherwise if it didn't exist
before, we'd end up with different SSA_NAME_VERSIONs
between -g and -g0. */
arg = get_or_create_ssa_default_def (cfun, parm);
if (!MAY_HAVE_DEBUG_BIND_STMTS || debug_args == NULL)
if (!flag_var_tracking_assignments || debug_args == NULL)
continue;
while (i < len && (**debug_args)[i] != DECL_ORIGIN (parm))

View File

@ -1454,8 +1454,8 @@ input_function (tree fn_decl, class data_in *data_in,
{
if (is_gimple_debug (stmt)
&& (gimple_debug_nonbind_marker_p (stmt)
? !MAY_HAVE_DEBUG_MARKER_STMTS
: !MAY_HAVE_DEBUG_BIND_STMTS))
? !debug_nonbind_markers_p
: !flag_var_tracking_assignments))
remove = true;
/* In case the linemap overflows locations can be dropped
to zero. Thus do not keep nonsensical inline entry markers

View File

@ -205,7 +205,7 @@ void
sese_insert_phis_for_liveouts (sese_info_p region, basic_block bb,
edge false_e, edge true_e)
{
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
sese_reset_debug_liveouts (region);
unsigned i;

View File

@ -456,7 +456,7 @@ num_imm_uses (const_tree var)
const ssa_use_operand_t *ptr;
unsigned int num = 0;
if (!MAY_HAVE_DEBUG_BIND_STMTS)
if (!flag_var_tracking_assignments)
{
for (ptr = start->next; ptr != start; ptr = ptr->next)
if (USE_STMT (ptr))

View File

@ -614,7 +614,7 @@ make_blocks (gimple_seq seq)
latest (earliest we find) label, and moving debug stmts that are
not separated from it by nondebug nonlabel stmts after the
label. */
if (MAY_HAVE_DEBUG_MARKER_STMTS)
if (debug_nonbind_markers_p)
{
gimple_stmt_iterator label = gsi_none ();
@ -2139,7 +2139,7 @@ gimple_merge_blocks (basic_block a, basic_block b)
gsi_insert_before (&dest_gsi, stmt, GSI_NEW_STMT);
}
/* Other user labels keep around in a form of a debug stmt. */
else if (!DECL_ARTIFICIAL (label) && MAY_HAVE_DEBUG_BIND_STMTS)
else if (!DECL_ARTIFICIAL (label) && flag_var_tracking_assignments)
{
gimple *dbg = gimple_build_debug_bind (label,
integer_zero_node,

View File

@ -6432,7 +6432,7 @@ tree_function_versioning (tree old_decl, tree new_decl,
}
}
if (param_body_adjs && MAY_HAVE_DEBUG_BIND_STMTS)
if (param_body_adjs && flag_var_tracking_assignments)
{
vec<tree, va_gc> **debug_args = NULL;
unsigned int len = 0;

View File

@ -1000,7 +1000,7 @@ generate_loops_for_partition (class loop *loop, partition *partition,
/* Remove stmts not in the PARTITION bitmap. */
bbs = get_loop_body_in_dom_order (loop);
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
for (i = 0; i < loop->num_nodes; i++)
{
basic_block bb = bbs[i];

View File

@ -2588,7 +2588,7 @@ analyze_access_subtree (struct access *root, struct access *parent,
gcc_checking_assert (!root->grp_scalar_read
&& !root->grp_assignment_read);
sth_created = true;
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
{
root->grp_to_be_debug_replaced = 1;
root->replacement_decl = create_access_replacement (root);

View File

@ -1143,7 +1143,7 @@ remove_dead_stmt (gimple_stmt_iterator *i, basic_block bb,
/* If this is a store into a variable that is being optimized away,
add a debug bind stmt if possible. */
if (MAY_HAVE_DEBUG_BIND_STMTS
if (flag_var_tracking_assignments
&& gimple_assign_single_p (stmt)
&& is_gimple_val (gimple_assign_rhs1 (stmt)))
{

View File

@ -7670,7 +7670,7 @@ remove_unused_ivs (struct ivopts_data *data, bitmap toremove)
tree def = info->iv->ssa_name;
if (MAY_HAVE_DEBUG_BIND_STMTS && SSA_NAME_DEF_STMT (def))
if (flag_var_tracking_assignments && SSA_NAME_DEF_STMT (def))
{
imm_use_iterator imm_iter;
use_operand_p use_p;

View File

@ -2403,7 +2403,7 @@ spaceship_replacement (basic_block cond_bb, basic_block middle_bb,
}
update_stmt (use_stmt);
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
{
use_operand_p use_p;
imm_use_iterator iter;

View File

@ -233,7 +233,7 @@ reassoc_remove_stmt (gimple_stmt_iterator *gsi)
{
gimple *stmt = gsi_stmt (*gsi);
if (!MAY_HAVE_DEBUG_BIND_STMTS || gimple_code (stmt) == GIMPLE_PHI)
if (!flag_var_tracking_assignments || gimple_code (stmt) == GIMPLE_PHI)
return gsi_remove (gsi, true);
gimple_stmt_iterator prev = *gsi;

View File

@ -1796,7 +1796,7 @@ tail_merge_optimize (unsigned int todo)
if (nr_bbs_removed_total > 0)
{
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
{
calculate_dominance_info (CDI_DOMINATORS);
update_debug_stmts ();

View File

@ -645,7 +645,7 @@ jump_threader::simplify_control_stmt_condition_1
void
propagate_threaded_block_debug_into (basic_block dest, basic_block src)
{
if (!MAY_HAVE_DEBUG_BIND_STMTS)
if (!flag_var_tracking_assignments)
return;
if (!single_pred_p (dest))

View File

@ -220,7 +220,7 @@ flush_pending_stmts (edge e)
void
gimple_replace_ssa_lhs (gimple *stmt, tree nlhs)
{
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
{
tree lhs = gimple_get_lhs (stmt);
@ -242,7 +242,7 @@ gimple_replace_ssa_lhs (gimple *stmt, tree nlhs)
tree
target_for_debug_bind (tree var)
{
if (!MAY_HAVE_DEBUG_BIND_STMTS)
if (!flag_var_tracking_assignments)
return NULL_TREE;
if (TREE_CODE (var) == SSA_NAME)
@ -307,7 +307,7 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
int usecount = 0;
tree value = NULL;
if (!MAY_HAVE_DEBUG_BIND_STMTS)
if (!flag_var_tracking_assignments)
return;
/* If this name has already been registered for replacement, do nothing
@ -499,7 +499,7 @@ insert_debug_temps_for_defs (gimple_stmt_iterator *gsi)
ssa_op_iter op_iter;
def_operand_p def_p;
if (!MAY_HAVE_DEBUG_BIND_STMTS)
if (!flag_var_tracking_assignments)
return;
stmt = gsi_stmt (*gsi);
@ -525,7 +525,7 @@ reset_debug_uses (gimple *stmt)
imm_use_iterator imm_iter;
gimple *use_stmt;
if (!MAY_HAVE_DEBUG_BIND_STMTS)
if (!flag_var_tracking_assignments)
return;
FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, op_iter, SSA_OP_DEF)

View File

@ -560,7 +560,7 @@ release_ssa_name_fn (struct function *fn, tree var)
int saved_ssa_name_version = SSA_NAME_VERSION (var);
use_operand_p imm = &(SSA_NAME_IMM_USE_NODE (var));
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
insert_debug_temp_for_var_def (NULL, var);
if (flag_checking)

View File

@ -201,7 +201,7 @@ adjust_debug_stmts_now (adjust_info *ai)
static void
adjust_vec_debug_stmts (void)
{
if (!MAY_HAVE_DEBUG_BIND_STMTS)
if (!flag_var_tracking_assignments)
return;
gcc_assert (adjust_vec.exists ());
@ -223,7 +223,7 @@ adjust_debug_stmts (tree from, tree to, basic_block bb)
{
adjust_info ai;
if (MAY_HAVE_DEBUG_BIND_STMTS
if (flag_var_tracking_assignments
&& TREE_CODE (from) == SSA_NAME
&& ! SSA_NAME_IS_DEFAULT_DEF (from)
&& ! virtual_operand_p (from))
@ -251,7 +251,7 @@ adjust_phi_and_debug_stmts (gimple *update_phi, edge e, tree new_def)
SET_PHI_ARG_DEF (update_phi, e->dest_idx, new_def);
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
adjust_debug_stmts (orig_def, PHI_RESULT (update_phi),
gimple_bb (update_phi));
}
@ -2696,7 +2696,7 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1,
vop_to_rename = create_lcssa_for_virtual_phi (orig_loop);
}
if (MAY_HAVE_DEBUG_BIND_STMTS)
if (flag_var_tracking_assignments)
{
gcc_assert (!adjust_vec.exists ());
adjust_vec.create (32);

View File

@ -9228,7 +9228,7 @@ vect_transform_loop_stmt (loop_vec_info loop_vinfo, stmt_vec_info stmt_info,
dump_printf_loc (MSG_NOTE, vect_location,
"------>vectorizing statement: %G", stmt_info->stmt);
if (MAY_HAVE_DEBUG_BIND_STMTS && !STMT_VINFO_LIVE_P (stmt_info))
if (flag_var_tracking_assignments && !STMT_VINFO_LIVE_P (stmt_info))
vect_loop_kill_debug_uses (loop, stmt_info);
if (!STMT_VINFO_RELEVANT_P (stmt_info)
@ -9602,7 +9602,7 @@ vect_transform_loop (loop_vec_info loop_vinfo, gimple *loop_vectorized_call)
if (!stmt_info)
continue;
if (MAY_HAVE_DEBUG_BIND_STMTS && !STMT_VINFO_LIVE_P (stmt_info))
if (flag_var_tracking_assignments && !STMT_VINFO_LIVE_P (stmt_info))
vect_loop_kill_debug_uses (loop, stmt_info);
if (!STMT_VINFO_RELEVANT_P (stmt_info)

View File

@ -1174,14 +1174,9 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
#define VL_EXP_OPERAND_LENGTH(NODE) \
((int)TREE_INT_CST_LOW (VL_EXP_CHECK (NODE)->exp.operands[0]))
/* Nonzero if gimple_debug_nonbind_marker_p() may possibly hold. */
#define MAY_HAVE_DEBUG_MARKER_STMTS debug_nonbind_markers_p
/* Nonzero if gimple_debug_bind_p() (and thus
gimple_debug_source_bind_p()) may possibly hold. */
#define MAY_HAVE_DEBUG_BIND_STMTS flag_var_tracking_assignments
/* Nonzero if is_gimple_debug() may possibly hold. */
#define MAY_HAVE_DEBUG_STMTS \
(MAY_HAVE_DEBUG_MARKER_STMTS || MAY_HAVE_DEBUG_BIND_STMTS)
(debug_nonbind_markers_p || flag_var_tracking_assignments)
/* In a LOOP_EXPR node. */
#define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)