From 71d9fc9b9b1cf6e3a620d5a7c4e3668497553410 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 29 Aug 2000 21:39:49 +0000 Subject: top level: * c-common.c (declare_function_name): Use func_id_node, function_id_node, and pretty_function_id_node. Do not make __func__ visible at file scope. * c-common.h (c_tree_index): Add CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, and CTI_FUNC_ID. (function_id_node, pretty_function_id_node, func_id_node): New macros. * c-decl.c (init_decl_processing): Initialize function_id_node, pretty_function_id_node, and func_id_node. (c_make_fname_decl): Correct comment. * tree.h (struct tree_identifier): Constify pointer member. * c-decl.c (pushdecl, implicit_decl_warning): Constify a char *. * c-pragma.h (struct weak_syms): Constify name and value members. (add_weak): Constify arguments. * calls.c (special_function_p): Constify a char *. (expand_call): Remove variable which is initialized and then never used. * dependence.c (struct def_use, struct induction, struct subscript): Constify 'variable' member. (get_low_bound, have_induction_variable): Constify char * argument. (find_induction_variable): Add braces to avoid dangling else. (classify_dependence): Constify char * arrays. * profile.c (output_func_start_profiler): Constify a char *. * stor-layout.c (finalize_record_size): Constify a char *. * tree.c (is_attribute_p): Constify a char *. * varasm.c (add_weak, remove_from_pending_weak_list): Constify argument. * varasm.c (make_function_rtl, make_decl_rtl): Rearrange code for comprehensibility. Do not call get_identifier if we did not change the DECL_ASSEMBLER_NAME of the decl. Use alloca to create temporary string constants, not ggc_alloc_string. No need to copy result of ASM_FORMAT_PRIVATE_NAME. Use const char * to hold IDENTIFIER_POINTERs. ch: * inout.c (add_enum_to_list): Use DECL_NAME directly, don't get its IDENTIFIER_POINTER and immediately call get_identifier on it. * lex.c (yywrap): Constify a char *. cp: * class.c (build_secondary_vtable): Constify a char *. * decl.c (init_decl_processing): Initialize function_id_node, pretty_function_id_node, and func_id_node. * input.c (struct input_source): Constify 'str'. (feed_input): Constify first argument. * mangle.c (write_identifier): Constify argument. * pt.c (mangle_class_name_for_template): Constify argument. f: * ansify.c: Use #line, not # . java: * jcf-parse.c (set_source_filename): Constify a char *. * jcf-write.c (append_innerclasses_attribute, make_class_file_name): Constify a char *. Don't recycle a variable for an unrelated purpose. * parse.y: (build_alias_initializer_parameter_list): Constify a char *. (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36055 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/dependence.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'gcc/dependence.c') diff --git a/gcc/dependence.c b/gcc/dependence.c index ac6abda19a2..141d9ac9d40 100644 --- a/gcc/dependence.c +++ b/gcc/dependence.c @@ -89,7 +89,7 @@ typedef struct def_use /* this expression */ tree expression; /* our name */ - char *variable; + const char *variable; /* def or use */ enum def_use_type type; /* status flags */ @@ -126,7 +126,7 @@ typedef struct loop typedef struct induction { /* our name */ - char *variable; + const char *variable; /* increment. Currently only +1 or -1 */ int increment; /* lower bound */ @@ -161,7 +161,7 @@ typedef struct subscript /* Y in X * i + Y */ int offset; /* our name */ - char *variable; + const char *variable; /* next subscript term. Currently null. */ struct subscript *next; } subscript; @@ -186,8 +186,8 @@ void init_dependence_analysis PARAMS ((tree)); static void build_def_use PARAMS ((tree, enum def_use_type)); static loop* add_loop PARAMS ((tree, tree, int)); static int find_induction_variable PARAMS ((tree, tree, tree, loop*)); -static int get_low_bound PARAMS ((tree, char*)); -static int have_induction_variable PARAMS ((tree, char*)); +static int get_low_bound PARAMS ((tree, const char*)); +static int have_induction_variable PARAMS ((tree, const char*)); static void link_loops PARAMS ((void)); static void get_node_dependence PARAMS ((void)); static void check_node_dependence PARAMS ((def_use*)); @@ -518,17 +518,23 @@ find_induction_variable (init_node, cond_node, incr_node, loop_def) if (TREE_CODE (TREE_OPERAND (cond_node, 0)) == VAR_DECL && IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (cond_node, 0))) == ind_ptr->variable) - if (TREE_CODE (TREE_OPERAND (cond_node, 1)) == INTEGER_CST) - ind_ptr->high_bound = TREE_INT_CST_LOW (TREE_OPERAND (cond_node, 1)); - else - ind_ptr->high_bound = ind_ptr->increment < 0 ? INT_MIN : INT_MAX; + { + if (TREE_CODE (TREE_OPERAND (cond_node, 1)) == INTEGER_CST) + ind_ptr->high_bound = + TREE_INT_CST_LOW (TREE_OPERAND (cond_node, 1)); + else + ind_ptr->high_bound = ind_ptr->increment < 0 ? INT_MIN : INT_MAX; + } else if (TREE_CODE (TREE_OPERAND (cond_node, 1)) == VAR_DECL && IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (cond_node, 1))) == ind_ptr->variable) - if (TREE_CODE (TREE_OPERAND (cond_node, 0)) == INTEGER_CST) - ind_ptr->high_bound = TREE_INT_CST_LOW (TREE_OPERAND (cond_node, 0)); - else - ind_ptr->high_bound = ind_ptr->increment < 0 ? INT_MIN : INT_MAX; + { + if (TREE_CODE (TREE_OPERAND (cond_node, 0)) == INTEGER_CST) + ind_ptr->high_bound = + TREE_INT_CST_LOW (TREE_OPERAND (cond_node, 0)); + else + ind_ptr->high_bound = ind_ptr->increment < 0 ? INT_MIN : INT_MAX; + } ind_ptr->next = 0; return 1; } @@ -540,7 +546,7 @@ find_induction_variable (init_node, cond_node, incr_node, loop_def) static int get_low_bound (node, variable) tree node; - char *variable; + const char *variable; { if (TREE_CODE (node) == SCOPE_STMT) @@ -577,7 +583,7 @@ get_low_bound (node, variable) static int have_induction_variable (outer_loop, ind_var) tree outer_loop; - char *ind_var; + const char *ind_var; { induction *ind_ptr; loop *loop_ptr; @@ -981,8 +987,8 @@ classify_dependence (icoefficients, ocoefficients, complexity, separability, int *separability; int count; { - char *iiv_used [MAX_SUBSCRIPTS]; - char *oiv_used [MAX_SUBSCRIPTS]; + const char *iiv_used [MAX_SUBSCRIPTS]; + const char *oiv_used [MAX_SUBSCRIPTS]; int ocoeff [MAX_SUBSCRIPTS]; int icoeff [MAX_SUBSCRIPTS]; int idx, cidx; -- cgit v1.2.1