+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>
* timevar.def: Add TV_CALL_CLOBBER, TV_FLOW_SENSITIVE,
int, int *);
static rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type,
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 (rtx, struct arg_data *, int);
space from the stack such as alloca. */
static int
-special_function_p (tree fndecl, int flags)
+special_function_p (const_tree fndecl, int flags)
{
if (fndecl && DECL_NAME (fndecl)
&& IDENTIFIER_LENGTH (DECL_NAME (fndecl)) <= 17
/* Return nonzero when FNDECL represents a call to setjmp. */
int
-setjmp_call_p (tree fndecl)
+setjmp_call_p (const_tree fndecl)
{
return special_function_p (fndecl, 0) & ECF_RETURNS_TWICE;
}
/* Return true when exp contains alloca call. */
bool
-alloca_call_p (tree exp)
+alloca_call_p (const_tree exp)
{
if (TREE_CODE (exp) == CALL_EXPR
&& TREE_CODE (CALL_EXPR_FN (exp)) == ADDR_EXPR
/* Detect flags (function attributes) from the function decl or type node. */
int
-flags_from_decl_or_type (tree exp)
+flags_from_decl_or_type (const_tree exp)
{
int flags = 0;
- tree type = exp;
+ const_tree type = exp;
if (DECL_P (exp))
{
if (save_temps_flag)
{
+ char *tmp;
+
temp_filename_length = basename_length + suffix_length;
- temp_filename = alloca (temp_filename_length + 1);
- strncpy ((char *) temp_filename, input_basename, basename_length);
- strncpy ((char *) temp_filename + basename_length, suffix,
- suffix_length);
- *((char *) temp_filename + temp_filename_length) = '\0';
+ tmp = alloca (temp_filename_length + 1);
+ strncpy (tmp, input_basename, basename_length);
+ strncpy (tmp + basename_length, suffix, suffix_length);
+ tmp[temp_filename_length] = '\0';
+ temp_filename = tmp;
if (strcmp (temp_filename, input_filename) != 0)
{
#ifndef HOST_LACKS_INODE_NUMBERS
/* Print PREFIX and ADDR to FILE. */
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)
fprintf (file, "%s#", prefix);
/* Print a node in brief fashion, with just the code, address and name. */
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;
static unsigned int split_critical_edges (void);
/* 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 void tree_make_forwarder_block (edge);
static void tree_cfg2vcg (FILE *);
/* Return true if T represents a stmt that always transfers control. */
bool
-is_ctrl_stmt (tree t)
+is_ctrl_stmt (const_tree t)
{
return (TREE_CODE (t) == COND_EXPR
|| TREE_CODE (t) == SWITCH_EXPR
/* Return true if T is a computed goto. */
bool
-computed_goto_p (tree t)
+computed_goto_p (const_tree t)
{
return (TREE_CODE (t) == GOTO_EXPR
&& TREE_CODE (GOTO_DESTINATION (t)) != LABEL_DECL);
/* Return true if T is a simple local goto. */
bool
-simple_goto_p (tree t)
+simple_goto_p (const_tree t)
{
return (TREE_CODE (t) == GOTO_EXPR
&& TREE_CODE (GOTO_DESTINATION (t)) == LABEL_DECL);
Transfers of control flow associated with EH are excluded. */
bool
-tree_can_make_abnormal_goto (tree t)
+tree_can_make_abnormal_goto (const_tree t)
{
if (computed_goto_p (t))
return true;
unnecessary basic blocks that only contain a single label. */
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)
return false;
}
bool
-tree_purge_all_dead_eh_edges (bitmap blocks)
+tree_purge_all_dead_eh_edges (const_bitmap blocks)
{
bool changed = false;
unsigned i;
extern void delete_tree_cfg_annotations (void);
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 computed_goto_p (tree);
-extern bool simple_goto_p (tree);
-extern bool tree_can_make_abnormal_goto (tree);
+extern bool computed_goto_p (const_tree);
+extern bool simple_goto_p (const_tree);
+extern bool tree_can_make_abnormal_goto (const_tree);
extern basic_block single_noncomplex_succ (basic_block bb);
extern void tree_dump_bb (basic_block, FILE *, int);
extern void debug_tree_bb (basic_block);
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_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_build1 (block_stmt_iterator *, enum tree_code,
tree, tree);
decls and constants can be shared among multiple locations, so
return nothing. */
location_t
-expr_location (tree node)
+expr_location (const_tree node)
{
#ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node))
}
bool
-expr_has_location (tree node)
+expr_has_location (const_tree node)
{
#ifdef USE_MAPPED_LOCATION
return expr_location (node) != UNKNOWN_LOCATION;
#else
source_locus
#endif
-expr_locus (tree node)
+expr_locus (const_tree node)
{
#ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node))
}
const char **
-expr_filename (tree node)
+expr_filename (const_tree node)
{
#ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node))
}
int *
-expr_lineno (tree node)
+expr_lineno (const_tree node)
{
#ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node))
the innermost dimension of ARRAY. */
tree
-get_inner_array_type (tree array)
+get_inner_array_type (const_tree array)
{
tree type = TREE_TYPE (array);
are compatible. It is assumed that the parent records are compatible. */
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),
DECL_FIELD_BIT_OFFSET (f2), OEP_ONLY_CONST))
extern bool tree_expr_nonnegative_p (tree);
extern bool tree_expr_nonnegative_warnv_p (tree, bool *);
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
put the prototype here. Rtl.h does declare the prototype if
extern HOST_WIDE_INT int_cst_value (const_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 location_t expr_location (tree);
+extern location_t expr_location (const_tree);
extern void set_expr_location (tree, location_t);
-extern bool expr_has_location (tree);
+extern bool expr_has_location (const_tree);
extern
#ifdef USE_MAPPED_LOCATION
source_location *
#else
source_locus
#endif
-expr_locus (tree);
+expr_locus (const_tree);
extern void set_expr_locus (tree,
#ifdef USE_MAPPED_LOCATION
source_location *loc
source_locus loc
#endif
);
-extern const char **expr_filename (tree);
-extern int *expr_lineno (tree);
+extern const char **expr_filename (const_tree);
+extern int *expr_lineno (const_tree);
extern tree *tree_block (tree);
extern tree *generic_tree_operand (tree, int);
extern tree *generic_tree_type (tree);
/* In print-tree.c */
extern void debug_tree (tree);
#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_brief (FILE *, const char *, tree, int);
+extern void print_node_brief (FILE *, const char *, const_tree, int);
extern void indent_to (FILE *, int);
#endif
it does not necessarily fit ECF_CONST). */
#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 setjmp_call_p (tree);
-extern bool alloca_call_p (tree);
+extern int setjmp_call_p (const_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_or_pad (enum machine_mode, tree);