Commit fdd5680c by David Malcolm Committed by David Malcolm

df: make df_problem instances "const"

The various struct df_problem instances are constant data; mark them
as such.

gcc/ChangeLog:
	* df-core.c (df_add_problem): Make the problem param be const.
	(df_remove_problem): Make local "problem" be const.
	* df-problems.c (problem_RD): Make const.
	(problem_LR): Likewise.
	(problem_LIVE): Likewise.
	(problem_MIR): Likewise.
	(problem_CHAIN): Likewise.
	(problem_WORD_LR): Likewise.
	(problem_NOTE): Likewise.
	(problem_MD): Likewise.
	* df-scan.c (problem_SCAN): Likewise.
	* df.h (struct df_problem): Make field "dependent_problem" be
	const.
	(struct dataflow): Likewise for field "problem".
	(df_add_problem): Make param const.

From-SVN: r235524
parent 98544adc
2016-04-27 David Malcolm <dmalcolm@redhat.com>
* df-core.c (df_add_problem): Make the problem param be const.
(df_remove_problem): Make local "problem" be const.
* df-problems.c (problem_RD): Make const.
(problem_LR): Likewise.
(problem_LIVE): Likewise.
(problem_MIR): Likewise.
(problem_CHAIN): Likewise.
(problem_WORD_LR): Likewise.
(problem_NOTE): Likewise.
(problem_MD): Likewise.
* df-scan.c (problem_SCAN): Likewise.
* df.h (struct df_problem): Make field "dependent_problem" be
const.
(struct dataflow): Likewise for field "problem".
(df_add_problem): Make param const.
2016-04-27 Uros Bizjak <ubizjak@gmail.com> 2016-04-27 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_spill_class): Enable for TARGET_SSE2 when * config/i386/i386.c (ix86_spill_class): Enable for TARGET_SSE2 when
......
...@@ -411,7 +411,7 @@ struct df_d *df; ...@@ -411,7 +411,7 @@ struct df_d *df;
/* Add PROBLEM (and any dependent problems) to the DF instance. */ /* Add PROBLEM (and any dependent problems) to the DF instance. */
void void
df_add_problem (struct df_problem *problem) df_add_problem (const struct df_problem *problem)
{ {
struct dataflow *dflow; struct dataflow *dflow;
int i; int i;
...@@ -584,7 +584,7 @@ df_set_blocks (bitmap blocks) ...@@ -584,7 +584,7 @@ df_set_blocks (bitmap blocks)
void void
df_remove_problem (struct dataflow *dflow) df_remove_problem (struct dataflow *dflow)
{ {
struct df_problem *problem; const struct df_problem *problem;
int i; int i;
if (!dflow) if (!dflow)
......
...@@ -668,7 +668,7 @@ df_rd_bottom_dump (basic_block bb, FILE *file) ...@@ -668,7 +668,7 @@ df_rd_bottom_dump (basic_block bb, FILE *file)
/* All of the information associated with every instance of the problem. */ /* All of the information associated with every instance of the problem. */
static struct df_problem problem_RD = static const struct df_problem problem_RD =
{ {
DF_RD, /* Problem id. */ DF_RD, /* Problem id. */
DF_FORWARD, /* Direction. */ DF_FORWARD, /* Direction. */
...@@ -1190,7 +1190,7 @@ df_lr_verify_solution_end (void) ...@@ -1190,7 +1190,7 @@ df_lr_verify_solution_end (void)
/* All of the information associated with every instance of the problem. */ /* All of the information associated with every instance of the problem. */
static struct df_problem problem_LR = static const struct df_problem problem_LR =
{ {
DF_LR, /* Problem id. */ DF_LR, /* Problem id. */
DF_BACKWARD, /* Direction. */ DF_BACKWARD, /* Direction. */
...@@ -1718,7 +1718,7 @@ df_live_verify_solution_end (void) ...@@ -1718,7 +1718,7 @@ df_live_verify_solution_end (void)
/* All of the information associated with every instance of the problem. */ /* All of the information associated with every instance of the problem. */
static struct df_problem problem_LIVE = static const struct df_problem problem_LIVE =
{ {
DF_LIVE, /* Problem id. */ DF_LIVE, /* Problem id. */
DF_FORWARD, /* Direction. */ DF_FORWARD, /* Direction. */
...@@ -2169,7 +2169,7 @@ df_mir_verify_solution_end (void) ...@@ -2169,7 +2169,7 @@ df_mir_verify_solution_end (void)
/* All of the information associated with every instance of the problem. */ /* All of the information associated with every instance of the problem. */
static struct df_problem problem_MIR = static const struct df_problem problem_MIR =
{ {
DF_MIR, /* Problem id. */ DF_MIR, /* Problem id. */
DF_FORWARD, /* Direction. */ DF_FORWARD, /* Direction. */
...@@ -2641,7 +2641,7 @@ df_chain_insn_bottom_dump (const rtx_insn *insn, FILE *file) ...@@ -2641,7 +2641,7 @@ df_chain_insn_bottom_dump (const rtx_insn *insn, FILE *file)
} }
} }
static struct df_problem problem_CHAIN = static const struct df_problem problem_CHAIN =
{ {
DF_CHAIN, /* Problem id. */ DF_CHAIN, /* Problem id. */
DF_NONE, /* Direction. */ DF_NONE, /* Direction. */
...@@ -3008,7 +3008,7 @@ df_word_lr_bottom_dump (basic_block bb, FILE *file) ...@@ -3008,7 +3008,7 @@ df_word_lr_bottom_dump (basic_block bb, FILE *file)
/* All of the information associated with every instance of the problem. */ /* All of the information associated with every instance of the problem. */
static struct df_problem problem_WORD_LR = static const struct df_problem problem_WORD_LR =
{ {
DF_WORD_LR, /* Problem id. */ DF_WORD_LR, /* Problem id. */
DF_BACKWARD, /* Direction. */ DF_BACKWARD, /* Direction. */
...@@ -3683,7 +3683,7 @@ df_note_free (void) ...@@ -3683,7 +3683,7 @@ df_note_free (void)
/* All of the information associated every instance of the problem. */ /* All of the information associated every instance of the problem. */
static struct df_problem problem_NOTE = static const struct df_problem problem_NOTE =
{ {
DF_NOTE, /* Problem id. */ DF_NOTE, /* Problem id. */
DF_NONE, /* Direction. */ DF_NONE, /* Direction. */
...@@ -4693,7 +4693,7 @@ df_md_bottom_dump (basic_block bb, FILE *file) ...@@ -4693,7 +4693,7 @@ df_md_bottom_dump (basic_block bb, FILE *file)
df_print_regset (file, &bb_info->out); df_print_regset (file, &bb_info->out);
} }
static struct df_problem problem_MD = static const struct df_problem problem_MD =
{ {
DF_MD, /* Problem id. */ DF_MD, /* Problem id. */
DF_FORWARD, /* Direction. */ DF_FORWARD, /* Direction. */
......
...@@ -396,7 +396,7 @@ df_scan_start_block (basic_block bb, FILE *file) ...@@ -396,7 +396,7 @@ df_scan_start_block (basic_block bb, FILE *file)
#endif #endif
} }
static struct df_problem problem_SCAN = static const struct df_problem problem_SCAN =
{ {
DF_SCAN, /* Problem id. */ DF_SCAN, /* Problem id. */
DF_NONE, /* Direction. */ DF_NONE, /* Direction. */
......
...@@ -275,7 +275,7 @@ struct df_problem { ...@@ -275,7 +275,7 @@ struct df_problem {
df_dump_insn_problem_function dump_insn_bottom_fun; df_dump_insn_problem_function dump_insn_bottom_fun;
df_verify_solution_start verify_start_fun; df_verify_solution_start verify_start_fun;
df_verify_solution_end verify_end_fun; df_verify_solution_end verify_end_fun;
struct df_problem *dependent_problem; const struct df_problem *dependent_problem;
unsigned int block_info_elt_size; unsigned int block_info_elt_size;
/* The timevar id associated with this pass. */ /* The timevar id associated with this pass. */
...@@ -290,7 +290,7 @@ struct df_problem { ...@@ -290,7 +290,7 @@ struct df_problem {
/* The specific instance of the problem to solve. */ /* The specific instance of the problem to solve. */
struct dataflow struct dataflow
{ {
struct df_problem *problem; /* The problem to be solved. */ const struct df_problem *problem; /* The problem to be solved. */
/* Array indexed by bb->index, that contains basic block problem and /* Array indexed by bb->index, that contains basic block problem and
solution specific information. */ solution specific information. */
...@@ -948,7 +948,7 @@ extern struct df_d *df; ...@@ -948,7 +948,7 @@ extern struct df_d *df;
/* Functions defined in df-core.c. */ /* Functions defined in df-core.c. */
extern void df_add_problem (struct df_problem *); extern void df_add_problem (const struct df_problem *);
extern int df_set_flags (int); extern int df_set_flags (int);
extern int df_clear_flags (int); extern int df_clear_flags (int);
extern void df_set_blocks (bitmap); extern void df_set_blocks (bitmap);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment