Commit 6ea2b70d by Kaveh R. Ghazi Committed by Kaveh Ghazi

calls.c (special_function_p, [...]): Constify.

	* calls.c (special_function_p, setjmp_call_p, alloca_call_p,
	flags_from_decl_or_type): Constify.
	* gcc.c (do_spec_1): Likewise.
	* print-tree.c (dump_addr, print_node_brief): Likewise.
	* tree-cfg.c (stmt_starts_bb_p, is_ctrl_stmt, computed_goto_p,
	simple_goto_p, tree_can_make_abnormal_goto, stmt_starts_bb_p,
	tree_purge_all_dead_eh_edges): Likewise.
	* tree-flow.h (is_ctrl_stmt, computed_goto_p, simple_goto_p,
	tree_can_make_abnormal_goto, tree_purge_all_dead_eh_edges):
	Likewise. 
	* tree.c (expr_location, expr_has_location, expr_locus,
	expr_filename, expr_lineno, get_inner_array_type,
	fields_compatible_p): Likewise.
	* tree.h (get_inner_array_type, fields_compatible_p,
	expr_location, expr_has_location, expr_locus, expr_filename,
	expr_lineno, dump_addr, print_node_brief, flags_from_decl_or_type,
	setjmp_call_p, alloca_call_p): Likewise.

From-SVN: r127017
parent d4d8c232
2007-07-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* calls.c (special_function_p, setjmp_call_p, alloca_call_p,
flags_from_decl_or_type): Constify.
* gcc.c (do_spec_1): Likewise.
* print-tree.c (dump_addr, print_node_brief): Likewise.
* tree-cfg.c (stmt_starts_bb_p, is_ctrl_stmt, computed_goto_p,
simple_goto_p, tree_can_make_abnormal_goto, stmt_starts_bb_p,
tree_purge_all_dead_eh_edges): Likewise.
* tree-flow.h (is_ctrl_stmt, computed_goto_p, simple_goto_p,
tree_can_make_abnormal_goto, tree_purge_all_dead_eh_edges):
Likewise.
* tree.c (expr_location, expr_has_location, expr_locus,
expr_filename, expr_lineno, get_inner_array_type,
fields_compatible_p): Likewise.
* tree.h (get_inner_array_type, fields_compatible_p,
expr_location, expr_has_location, expr_locus, expr_filename,
expr_lineno, dump_addr, print_node_brief, flags_from_decl_or_type,
setjmp_call_p, alloca_call_p): Likewise.
2007-07-28 Daniel Berlin <dberlin@dberlin.org> 2007-07-28 Daniel Berlin <dberlin@dberlin.org>
* timevar.def: Add TV_CALL_CLOBBER, TV_FLOW_SENSITIVE, * timevar.def: Add TV_CALL_CLOBBER, TV_FLOW_SENSITIVE,
......
...@@ -143,7 +143,7 @@ static void load_register_parameters (struct arg_data *, int, rtx *, int, ...@@ -143,7 +143,7 @@ static void load_register_parameters (struct arg_data *, int, rtx *, int,
int, int *); int, int *);
static rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type, static rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type,
enum machine_mode, int, va_list); enum machine_mode, int, va_list);
static int special_function_p (tree, int); static int special_function_p (const_tree, int);
static int check_sibcall_argument_overlap_1 (rtx); static int check_sibcall_argument_overlap_1 (rtx);
static int check_sibcall_argument_overlap (rtx, struct arg_data *, int); static int check_sibcall_argument_overlap (rtx, struct arg_data *, int);
...@@ -469,7 +469,7 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED, ...@@ -469,7 +469,7 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
space from the stack such as alloca. */ space from the stack such as alloca. */
static int static int
special_function_p (tree fndecl, int flags) special_function_p (const_tree fndecl, int flags)
{ {
if (fndecl && DECL_NAME (fndecl) if (fndecl && DECL_NAME (fndecl)
&& IDENTIFIER_LENGTH (DECL_NAME (fndecl)) <= 17 && IDENTIFIER_LENGTH (DECL_NAME (fndecl)) <= 17
...@@ -543,14 +543,14 @@ special_function_p (tree fndecl, int flags) ...@@ -543,14 +543,14 @@ special_function_p (tree fndecl, int flags)
/* Return nonzero when FNDECL represents a call to setjmp. */ /* Return nonzero when FNDECL represents a call to setjmp. */
int int
setjmp_call_p (tree fndecl) setjmp_call_p (const_tree fndecl)
{ {
return special_function_p (fndecl, 0) & ECF_RETURNS_TWICE; return special_function_p (fndecl, 0) & ECF_RETURNS_TWICE;
} }
/* Return true when exp contains alloca call. */ /* Return true when exp contains alloca call. */
bool bool
alloca_call_p (tree exp) alloca_call_p (const_tree exp)
{ {
if (TREE_CODE (exp) == CALL_EXPR if (TREE_CODE (exp) == CALL_EXPR
&& TREE_CODE (CALL_EXPR_FN (exp)) == ADDR_EXPR && TREE_CODE (CALL_EXPR_FN (exp)) == ADDR_EXPR
...@@ -564,10 +564,10 @@ alloca_call_p (tree exp) ...@@ -564,10 +564,10 @@ alloca_call_p (tree exp)
/* Detect flags (function attributes) from the function decl or type node. */ /* Detect flags (function attributes) from the function decl or type node. */
int int
flags_from_decl_or_type (tree exp) flags_from_decl_or_type (const_tree exp)
{ {
int flags = 0; int flags = 0;
tree type = exp; const_tree type = exp;
if (DECL_P (exp)) if (DECL_P (exp))
{ {
......
...@@ -4847,12 +4847,14 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) ...@@ -4847,12 +4847,14 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
if (save_temps_flag) if (save_temps_flag)
{ {
char *tmp;
temp_filename_length = basename_length + suffix_length; temp_filename_length = basename_length + suffix_length;
temp_filename = alloca (temp_filename_length + 1); tmp = alloca (temp_filename_length + 1);
strncpy ((char *) temp_filename, input_basename, basename_length); strncpy (tmp, input_basename, basename_length);
strncpy ((char *) temp_filename + basename_length, suffix, strncpy (tmp + basename_length, suffix, suffix_length);
suffix_length); tmp[temp_filename_length] = '\0';
*((char *) temp_filename + temp_filename_length) = '\0'; temp_filename = tmp;
if (strcmp (temp_filename, input_filename) != 0) if (strcmp (temp_filename, input_filename) != 0)
{ {
#ifndef HOST_LACKS_INODE_NUMBERS #ifndef HOST_LACKS_INODE_NUMBERS
......
...@@ -58,7 +58,7 @@ debug_tree (tree node) ...@@ -58,7 +58,7 @@ debug_tree (tree node)
/* Print PREFIX and ADDR to FILE. */ /* Print PREFIX and ADDR to FILE. */
void void
dump_addr (FILE *file, const char *prefix, void *addr) dump_addr (FILE *file, const char *prefix, const void *addr)
{ {
if (flag_dump_noaddr || flag_dump_unnumbered) if (flag_dump_noaddr || flag_dump_unnumbered)
fprintf (file, "%s#", prefix); fprintf (file, "%s#", prefix);
...@@ -69,7 +69,7 @@ dump_addr (FILE *file, const char *prefix, void *addr) ...@@ -69,7 +69,7 @@ dump_addr (FILE *file, const char *prefix, void *addr)
/* Print a node in brief fashion, with just the code, address and name. */ /* Print a node in brief fashion, with just the code, address and name. */
void void
print_node_brief (FILE *file, const char *prefix, tree node, int indent) print_node_brief (FILE *file, const char *prefix, const_tree node, int indent)
{ {
enum tree_code_class class; enum tree_code_class class;
......
...@@ -96,7 +96,7 @@ static edge tree_try_redirect_by_replacing_jump (edge, basic_block); ...@@ -96,7 +96,7 @@ static edge tree_try_redirect_by_replacing_jump (edge, basic_block);
static unsigned int split_critical_edges (void); static unsigned int split_critical_edges (void);
/* Various helpers. */ /* Various helpers. */
static inline bool stmt_starts_bb_p (tree, tree); static inline bool stmt_starts_bb_p (const_tree, const_tree);
static int tree_verify_flow_info (void); static int tree_verify_flow_info (void);
static void tree_make_forwarder_block (edge); static void tree_make_forwarder_block (edge);
static void tree_cfg2vcg (FILE *); static void tree_cfg2vcg (FILE *);
...@@ -2421,7 +2421,7 @@ tree_cfg2vcg (FILE *file) ...@@ -2421,7 +2421,7 @@ tree_cfg2vcg (FILE *file)
/* Return true if T represents a stmt that always transfers control. */ /* Return true if T represents a stmt that always transfers control. */
bool bool
is_ctrl_stmt (tree t) is_ctrl_stmt (const_tree t)
{ {
return (TREE_CODE (t) == COND_EXPR return (TREE_CODE (t) == COND_EXPR
|| TREE_CODE (t) == SWITCH_EXPR || TREE_CODE (t) == SWITCH_EXPR
...@@ -2465,7 +2465,7 @@ is_ctrl_altering_stmt (tree t) ...@@ -2465,7 +2465,7 @@ is_ctrl_altering_stmt (tree t)
/* Return true if T is a computed goto. */ /* Return true if T is a computed goto. */
bool bool
computed_goto_p (tree t) computed_goto_p (const_tree t)
{ {
return (TREE_CODE (t) == GOTO_EXPR return (TREE_CODE (t) == GOTO_EXPR
&& TREE_CODE (GOTO_DESTINATION (t)) != LABEL_DECL); && TREE_CODE (GOTO_DESTINATION (t)) != LABEL_DECL);
...@@ -2475,7 +2475,7 @@ computed_goto_p (tree t) ...@@ -2475,7 +2475,7 @@ computed_goto_p (tree t)
/* Return true if T is a simple local goto. */ /* Return true if T is a simple local goto. */
bool bool
simple_goto_p (tree t) simple_goto_p (const_tree t)
{ {
return (TREE_CODE (t) == GOTO_EXPR return (TREE_CODE (t) == GOTO_EXPR
&& TREE_CODE (GOTO_DESTINATION (t)) == LABEL_DECL); && TREE_CODE (GOTO_DESTINATION (t)) == LABEL_DECL);
...@@ -2486,7 +2486,7 @@ simple_goto_p (tree t) ...@@ -2486,7 +2486,7 @@ simple_goto_p (tree t)
Transfers of control flow associated with EH are excluded. */ Transfers of control flow associated with EH are excluded. */
bool bool
tree_can_make_abnormal_goto (tree t) tree_can_make_abnormal_goto (const_tree t)
{ {
if (computed_goto_p (t)) if (computed_goto_p (t))
return true; return true;
...@@ -2507,7 +2507,7 @@ tree_can_make_abnormal_goto (tree t) ...@@ -2507,7 +2507,7 @@ tree_can_make_abnormal_goto (tree t)
unnecessary basic blocks that only contain a single label. */ unnecessary basic blocks that only contain a single label. */
static inline bool static inline bool
stmt_starts_bb_p (tree t, tree prev_t) stmt_starts_bb_p (const_tree t, const_tree prev_t)
{ {
if (t == NULL_TREE) if (t == NULL_TREE)
return false; return false;
...@@ -6242,7 +6242,7 @@ tree_purge_dead_eh_edges (basic_block bb) ...@@ -6242,7 +6242,7 @@ tree_purge_dead_eh_edges (basic_block bb)
} }
bool bool
tree_purge_all_dead_eh_edges (bitmap blocks) tree_purge_all_dead_eh_edges (const_bitmap blocks)
{ {
bool changed = false; bool changed = false;
unsigned i; unsigned i;
......
...@@ -722,11 +722,11 @@ extern void free_omp_regions (void); ...@@ -722,11 +722,11 @@ extern void free_omp_regions (void);
extern void delete_tree_cfg_annotations (void); extern void delete_tree_cfg_annotations (void);
extern bool stmt_ends_bb_p (tree); extern bool stmt_ends_bb_p (tree);
extern bool is_ctrl_stmt (tree); extern bool is_ctrl_stmt (const_tree);
extern bool is_ctrl_altering_stmt (tree); extern bool is_ctrl_altering_stmt (tree);
extern bool computed_goto_p (tree); extern bool computed_goto_p (const_tree);
extern bool simple_goto_p (tree); extern bool simple_goto_p (const_tree);
extern bool tree_can_make_abnormal_goto (tree); extern bool tree_can_make_abnormal_goto (const_tree);
extern basic_block single_noncomplex_succ (basic_block bb); extern basic_block single_noncomplex_succ (basic_block bb);
extern void tree_dump_bb (basic_block, FILE *, int); extern void tree_dump_bb (basic_block, FILE *, int);
extern void debug_tree_bb (basic_block); extern void debug_tree_bb (basic_block);
...@@ -762,7 +762,7 @@ extern void add_phi_args_after_copy_bb (basic_block); ...@@ -762,7 +762,7 @@ extern void add_phi_args_after_copy_bb (basic_block);
extern void add_phi_args_after_copy (basic_block *, unsigned); extern void add_phi_args_after_copy (basic_block *, unsigned);
extern bool tree_purge_dead_abnormal_call_edges (basic_block); extern bool tree_purge_dead_abnormal_call_edges (basic_block);
extern bool tree_purge_dead_eh_edges (basic_block); extern bool tree_purge_dead_eh_edges (basic_block);
extern bool tree_purge_all_dead_eh_edges (bitmap); extern bool tree_purge_all_dead_eh_edges (const_bitmap);
extern tree gimplify_val (block_stmt_iterator *, tree, tree); extern tree gimplify_val (block_stmt_iterator *, tree, tree);
extern tree gimplify_build1 (block_stmt_iterator *, enum tree_code, extern tree gimplify_build1 (block_stmt_iterator *, enum tree_code,
tree, tree); tree, tree);
......
...@@ -3429,7 +3429,7 @@ annotate_with_locus (tree node, location_t locus) ...@@ -3429,7 +3429,7 @@ annotate_with_locus (tree node, location_t locus)
decls and constants can be shared among multiple locations, so decls and constants can be shared among multiple locations, so
return nothing. */ return nothing. */
location_t location_t
expr_location (tree node) expr_location (const_tree node)
{ {
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node)) if (GIMPLE_STMT_P (node))
...@@ -3457,7 +3457,7 @@ set_expr_location (tree node, location_t locus) ...@@ -3457,7 +3457,7 @@ set_expr_location (tree node, location_t locus)
} }
bool bool
expr_has_location (tree node) expr_has_location (const_tree node)
{ {
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
return expr_location (node) != UNKNOWN_LOCATION; return expr_location (node) != UNKNOWN_LOCATION;
...@@ -3471,7 +3471,7 @@ source_location * ...@@ -3471,7 +3471,7 @@ source_location *
#else #else
source_locus source_locus
#endif #endif
expr_locus (tree node) expr_locus (const_tree node)
{ {
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node)) if (GIMPLE_STMT_P (node))
...@@ -3519,7 +3519,7 @@ set_expr_locus (tree node, ...@@ -3519,7 +3519,7 @@ set_expr_locus (tree node,
} }
const char ** const char **
expr_filename (tree node) expr_filename (const_tree node)
{ {
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node)) if (GIMPLE_STMT_P (node))
...@@ -3533,7 +3533,7 @@ expr_filename (tree node) ...@@ -3533,7 +3533,7 @@ expr_filename (tree node)
} }
int * int *
expr_lineno (tree node) expr_lineno (const_tree node)
{ {
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node)) if (GIMPLE_STMT_P (node))
...@@ -5637,7 +5637,7 @@ build_array_type (tree elt_type, tree index_type) ...@@ -5637,7 +5637,7 @@ build_array_type (tree elt_type, tree index_type)
the innermost dimension of ARRAY. */ the innermost dimension of ARRAY. */
tree tree
get_inner_array_type (tree array) get_inner_array_type (const_tree array)
{ {
tree type = TREE_TYPE (array); tree type = TREE_TYPE (array);
...@@ -7803,7 +7803,7 @@ needs_to_live_in_memory (tree t) ...@@ -7803,7 +7803,7 @@ needs_to_live_in_memory (tree t)
are compatible. It is assumed that the parent records are compatible. */ are compatible. It is assumed that the parent records are compatible. */
bool bool
fields_compatible_p (tree f1, tree f2) fields_compatible_p (const_tree f1, const_tree f2)
{ {
if (!operand_equal_p (DECL_FIELD_BIT_OFFSET (f1), if (!operand_equal_p (DECL_FIELD_BIT_OFFSET (f1),
DECL_FIELD_BIT_OFFSET (f2), OEP_ONLY_CONST)) DECL_FIELD_BIT_OFFSET (f2), OEP_ONLY_CONST))
......
...@@ -3830,7 +3830,7 @@ extern int tree_int_cst_sign_bit (tree); ...@@ -3830,7 +3830,7 @@ extern int tree_int_cst_sign_bit (tree);
extern bool tree_expr_nonnegative_p (tree); extern bool tree_expr_nonnegative_p (tree);
extern bool tree_expr_nonnegative_warnv_p (tree, bool *); extern bool tree_expr_nonnegative_warnv_p (tree, bool *);
extern bool may_negate_without_overflow_p (tree); extern bool may_negate_without_overflow_p (tree);
extern tree get_inner_array_type (tree); extern tree get_inner_array_type (const_tree);
/* From expmed.c. Since rtl.h is included after tree.h, we can't /* From expmed.c. Since rtl.h is included after tree.h, we can't
put the prototype here. Rtl.h does declare the prototype if put the prototype here. Rtl.h does declare the prototype if
...@@ -4597,19 +4597,19 @@ extern tree build_range_type (tree, tree, tree); ...@@ -4597,19 +4597,19 @@ extern tree build_range_type (tree, tree, tree);
extern HOST_WIDE_INT int_cst_value (const_tree); extern HOST_WIDE_INT int_cst_value (const_tree);
extern tree build_addr (tree, tree); extern tree build_addr (tree, tree);
extern bool fields_compatible_p (tree, tree); extern bool fields_compatible_p (const_tree, const_tree);
extern tree find_compatible_field (tree, tree); extern tree find_compatible_field (tree, tree);
extern location_t expr_location (tree); extern location_t expr_location (const_tree);
extern void set_expr_location (tree, location_t); extern void set_expr_location (tree, location_t);
extern bool expr_has_location (tree); extern bool expr_has_location (const_tree);
extern extern
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
source_location * source_location *
#else #else
source_locus source_locus
#endif #endif
expr_locus (tree); expr_locus (const_tree);
extern void set_expr_locus (tree, extern void set_expr_locus (tree,
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
source_location *loc source_location *loc
...@@ -4617,8 +4617,8 @@ extern void set_expr_locus (tree, ...@@ -4617,8 +4617,8 @@ extern void set_expr_locus (tree,
source_locus loc source_locus loc
#endif #endif
); );
extern const char **expr_filename (tree); extern const char **expr_filename (const_tree);
extern int *expr_lineno (tree); extern int *expr_lineno (const_tree);
extern tree *tree_block (tree); extern tree *tree_block (tree);
extern tree *generic_tree_operand (tree, int); extern tree *generic_tree_operand (tree, int);
extern tree *generic_tree_type (tree); extern tree *generic_tree_type (tree);
...@@ -4652,9 +4652,9 @@ extern void print_rtl (FILE *, const_rtx); ...@@ -4652,9 +4652,9 @@ extern void print_rtl (FILE *, const_rtx);
/* In print-tree.c */ /* In print-tree.c */
extern void debug_tree (tree); extern void debug_tree (tree);
#ifdef BUFSIZ #ifdef BUFSIZ
extern void dump_addr (FILE*, const char *, void *); extern void dump_addr (FILE*, const char *, const void *);
extern void print_node (FILE *, const char *, tree, int); extern void print_node (FILE *, const char *, tree, int);
extern void print_node_brief (FILE *, const char *, tree, int); extern void print_node_brief (FILE *, const char *, const_tree, int);
extern void indent_to (FILE *, int); extern void indent_to (FILE *, int);
#endif #endif
...@@ -4695,11 +4695,11 @@ extern tree build_duplicate_type (tree); ...@@ -4695,11 +4695,11 @@ extern tree build_duplicate_type (tree);
it does not necessarily fit ECF_CONST). */ it does not necessarily fit ECF_CONST). */
#define ECF_NOVOPS 1024 #define ECF_NOVOPS 1024
extern int flags_from_decl_or_type (tree); extern int flags_from_decl_or_type (const_tree);
extern int call_expr_flags (tree); extern int call_expr_flags (tree);
extern int setjmp_call_p (tree); extern int setjmp_call_p (const_tree);
extern bool alloca_call_p (tree); extern bool alloca_call_p (const_tree);
extern bool must_pass_in_stack_var_size (enum machine_mode, tree); extern bool must_pass_in_stack_var_size (enum machine_mode, tree);
extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, tree); extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, tree);
......
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