From d3e3972c5c370807f5e14cb35019eb5700a9158a Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 26 Apr 2000 18:31:55 +0000 Subject: [PATCH] dwarf2out.c (dw_cfi_oprnd_struct, [...]): Constify a char*. * dwarf2out.c (dw_cfi_oprnd_struct, dw_fde_struct, add_fde_cfi, reg_save, dwarf2out_frame_debug_expr, dwarf2out_def_cfa, dwarf2out_window_save, dwarf2out_args_size, dwarf2out_reg_save, dwarf2out_return_save, dwarf2out_return_reg, dwarf2out_stack_adjust, dwarf2out_frame_debug, primary_filename, add_AT_lbl_id, add_AT_lbl_offset, type_tag, decl_start_label, gen_compile_unit_die, dwarf2out_init): Constify a char*. * dwarf2out.h (dwarf2out_init): Likewise. * dwarfout.c (filename_entry, primary_filename, last_filename, type_tag, output_compile_unit_die, dwarfout_init): Likewise. * tree.h (dwarf2out_def_cfa, dwarf2out_window_save, dwarf2out_args_size, dwarf2out_reg_save, dwarf2out_return_save, dwarf2out_return_reg): Likewise. From-SVN: r33448 --- gcc/ChangeLog | 19 +++++++++++++++ gcc/dwarf2out.c | 64 ++++++++++++++++++++++++------------------------- gcc/dwarf2out.h | 3 +-- gcc/dwarfout.c | 18 +++++++------- gcc/tree.h | 24 +++++++++---------- 5 files changed, 73 insertions(+), 55 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 45e7c5f4e598..faf97d64793d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +2000-04-26 Kaveh R. Ghazi + + * dwarf2out.c (dw_cfi_oprnd_struct, dw_fde_struct, add_fde_cfi, + reg_save, dwarf2out_frame_debug_expr, dwarf2out_def_cfa, + dwarf2out_window_save, dwarf2out_args_size, dwarf2out_reg_save, + dwarf2out_return_save, dwarf2out_return_reg, + dwarf2out_stack_adjust, dwarf2out_frame_debug, primary_filename, + add_AT_lbl_id, add_AT_lbl_offset, type_tag, decl_start_label, + gen_compile_unit_die, dwarf2out_init): Constify a char*. + + * dwarf2out.h (dwarf2out_init): Likewise. + + * dwarfout.c (filename_entry, primary_filename, last_filename, + type_tag, output_compile_unit_die, dwarfout_init): Likewise. + + * tree.h (dwarf2out_def_cfa, dwarf2out_window_save, + dwarf2out_args_size, dwarf2out_reg_save, dwarf2out_return_save, + dwarf2out_return_reg): Likewise. + 2000-04-26 Andreas Jaeger * extend.texi (Function Attributes): Fix description of pure diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 79bffccce90a..bf93491cfc02 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -104,7 +104,7 @@ typedef union dw_cfi_oprnd_struct { unsigned long dw_cfi_reg_num; long int dw_cfi_offset; - char *dw_cfi_addr; + const char *dw_cfi_addr; } dw_cfi_oprnd; @@ -125,9 +125,9 @@ dw_cfi_node; typedef struct dw_fde_struct { - char *dw_fde_begin; - char *dw_fde_current_label; - char *dw_fde_end; + const char *dw_fde_begin; + const char *dw_fde_current_label; + const char *dw_fde_end; dw_cfi_ref dw_fde_cfi; int nothrow; } @@ -221,18 +221,18 @@ static unsigned long size_of_uleb128 PARAMS ((unsigned long)); static unsigned long size_of_sleb128 PARAMS ((long)); static void output_uleb128 PARAMS ((unsigned long)); static void output_sleb128 PARAMS ((long)); -static void add_fde_cfi PARAMS ((char *, dw_cfi_ref)); +static void add_fde_cfi PARAMS ((const char *, dw_cfi_ref)); static void lookup_cfa_1 PARAMS ((dw_cfi_ref, unsigned long *, long *)); static void lookup_cfa PARAMS ((unsigned long *, long *)); -static void reg_save PARAMS ((char *, unsigned, unsigned, - long)); +static void reg_save PARAMS ((const char *, unsigned, + unsigned, long)); static void initial_return_save PARAMS ((rtx)); static void output_cfi PARAMS ((dw_cfi_ref, dw_fde_ref)); static void output_call_frame_info PARAMS ((int)); static unsigned int reg_number PARAMS ((rtx)); static void dwarf2out_stack_adjust PARAMS ((rtx)); -static void dwarf2out_frame_debug_expr PARAMS ((rtx, char *)); +static void dwarf2out_frame_debug_expr PARAMS ((rtx, const char *)); /* Definitions of defaults for assembler-dependent names of various pseudo-ops and section names. @@ -715,7 +715,7 @@ dwarf2out_cfi_label () static void add_fde_cfi (label, cfi) - register char *label; + register const char *label; register dw_cfi_ref cfi; { if (label) @@ -815,7 +815,7 @@ static long old_args_size; void dwarf2out_def_cfa (label, reg, offset) - register char *label; + register const char *label; register unsigned reg; register long offset; { @@ -867,7 +867,7 @@ dwarf2out_def_cfa (label, reg, offset) static void reg_save (label, reg, sreg, offset) - register char * label; + register const char *label; register unsigned reg; register unsigned sreg; register long offset; @@ -916,7 +916,7 @@ reg_save (label, reg, sreg, offset) void dwarf2out_window_save (label) - register char * label; + register const char *label; { register dw_cfi_ref cfi = new_cfi (); cfi->dw_cfi_opc = DW_CFA_GNU_window_save; @@ -928,7 +928,7 @@ dwarf2out_window_save (label) void dwarf2out_args_size (label, size) - char *label; + const char *label; long size; { register dw_cfi_ref cfi; @@ -948,7 +948,7 @@ dwarf2out_args_size (label, size) void dwarf2out_reg_save (label, reg, offset) - register char * label; + register const char *label; register unsigned reg; register long offset; { @@ -960,7 +960,7 @@ dwarf2out_reg_save (label, reg, offset) void dwarf2out_return_save (label, offset) - register char * label; + register const char *label; register long offset; { reg_save (label, DWARF_FRAME_RETURN_COLUMN, -1, offset); @@ -971,7 +971,7 @@ dwarf2out_return_save (label, offset) void dwarf2out_return_reg (label, sreg) - register char * label; + register const char *label; register unsigned sreg; { reg_save (label, DWARF_FRAME_RETURN_COLUMN, sreg, 0); @@ -1041,7 +1041,7 @@ dwarf2out_stack_adjust (insn) rtx insn; { long offset; - char *label; + const char *label; if (! asynchronous_exceptions && GET_CODE (insn) == CALL_INSN) { @@ -1146,7 +1146,7 @@ static long cfa_temp_value; static void dwarf2out_frame_debug_expr (expr, label) rtx expr; - char *label; + const char *label; { rtx src, dest; long offset; @@ -1353,7 +1353,7 @@ void dwarf2out_frame_debug (insn) rtx insn; { - char *label; + const char *label; rtx src; if (insn == NULL_RTX) @@ -2229,7 +2229,7 @@ static unsigned file_table_in_use; /* Local pointer to the name of the main input file. Initialized in dwarf2out_init. */ -static char *primary_filename; +static const char *primary_filename; /* A pointer to the base of a table of references to DIE's that describe declarations. The table is indexed by DECL_UID() which is a unique @@ -2406,10 +2406,10 @@ static void add_AT_addr PARAMS ((dw_die_ref, rtx)); static void add_AT_lbl_id PARAMS ((dw_die_ref, enum dwarf_attribute, - char *)); + const char *)); static void add_AT_lbl_offset PARAMS ((dw_die_ref, enum dwarf_attribute, - char *)); + const char *)); static dw_attr_ref get_AT PARAMS ((dw_die_ref, enum dwarf_attribute)); static const char *get_AT_low_pc PARAMS ((dw_die_ref)); @@ -2502,10 +2502,10 @@ static dw_die_ref scope_die_for PARAMS ((tree, dw_die_ref)); static void pop_decl_scope PARAMS ((void)); static void add_type_attribute PARAMS ((dw_die_ref, tree, int, int, dw_die_ref)); -static char *type_tag PARAMS ((tree)); +static const char *type_tag PARAMS ((tree)); static tree member_declared_type PARAMS ((tree)); #if 0 -static char *decl_start_label PARAMS ((tree)); +static const char *decl_start_label PARAMS ((tree)); #endif static void gen_array_type_die PARAMS ((tree, dw_die_ref)); static void gen_set_type_die PARAMS ((tree, dw_die_ref)); @@ -3767,7 +3767,7 @@ static inline void add_AT_lbl_id (die, attr_kind, lbl_id) register dw_die_ref die; register enum dwarf_attribute attr_kind; - register char *lbl_id; + register const char *lbl_id; { register dw_attr_ref attr = (dw_attr_ref) xmalloc (sizeof (dw_attr_node)); @@ -3784,7 +3784,7 @@ static inline void add_AT_lbl_offset (die, attr_kind, label) register dw_die_ref die; register enum dwarf_attribute attr_kind; - register char *label; + register const char *label; { register dw_attr_ref attr = (dw_attr_ref) xmalloc (sizeof (dw_attr_node)); @@ -7634,11 +7634,11 @@ add_type_attribute (object_die, type, decl_const, decl_volatile, context_die) a pointer to the (string) tag name for the given type, or zero if the type was declared without a tag. */ -static char * +static const char * type_tag (type) register tree type; { - register char *name = 0; + register const char *name = 0; if (TYPE_NAME (type) != 0) { @@ -7679,12 +7679,12 @@ member_declared_type (member) from the DECL_NAME name used in the source file. */ #if 0 -static char * +static const char * decl_start_label (decl) register tree decl; { rtx x; - char *fnname; + const char *fnname; x = DECL_RTL (decl); if (GET_CODE (x) != MEM) abort (); @@ -8674,7 +8674,7 @@ gen_compile_unit_die (filename) { register dw_die_ref die; char producer[250]; - char *wd = getpwd (); + const char *wd = getpwd (); int language; die = new_die (DW_TAG_compile_unit, NULL); @@ -9835,7 +9835,7 @@ dwarf2out_undef (lineno, buffer) void dwarf2out_init (asm_out_file, main_input_filename) register FILE *asm_out_file; - register char *main_input_filename; + register const char *main_input_filename; { /* Remember the name of the primary input file. */ primary_filename = main_input_filename; diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index 4b975b61eda0..7496f9dcdf2d 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -18,8 +18,7 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern void dwarf2out_init PARAMS ((FILE *asm_out_file, - char *main_input_filename)); +extern void dwarf2out_init PARAMS ((FILE *, const char *)); extern void dwarf2out_finish PARAMS ((void)); extern void dwarf2out_define PARAMS ((unsigned, const char *)); diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index fafbcaa926fb..a8b2a4ae5c10 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -161,7 +161,7 @@ extern int flag_traditional; struct filename_entry { unsigned number; - char * name; + const char * name; }; typedef struct filename_entry filename_entry; @@ -189,11 +189,11 @@ static unsigned ft_entries; /* Local pointer to the name of the main input file. Initialized in dwarfout_init. */ -static char *primary_filename; +static const char *primary_filename; /* Pointer to the most recent filename for which we produced some line info. */ -static char *last_filename; +static const char *last_filename; /* Counter to generate unique names for DIEs. */ @@ -379,7 +379,7 @@ static inline void src_coords_attribute PARAMS ((unsigned, unsigned)); static inline void pure_or_virtual_attribute PARAMS ((tree)); static void name_and_src_coords_attributes PARAMS ((tree)); static void type_attribute PARAMS ((tree, int, int)); -static char *type_tag PARAMS ((tree)); +static const char *type_tag PARAMS ((tree)); static inline void dienum_push PARAMS ((void)); static inline void dienum_pop PARAMS ((void)); static inline tree member_declared_type PARAMS ((tree)); @@ -3136,11 +3136,11 @@ type_attribute (type, decl_const, decl_volatile) a pointer to the (string) tag name for the given type, or zero if the type was declared without a tag. */ -static char * +static const char * type_tag (type) register tree type; { - register char *name = 0; + register const char *name = 0; if (TYPE_NAME (type) != 0) { @@ -3689,7 +3689,7 @@ static void output_compile_unit_die (arg) register void *arg; { - register char *main_input_filename = arg; + register const char *main_input_filename = arg; ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_compile_unit); sibling_attribute (); @@ -3722,7 +3722,7 @@ output_compile_unit_die (arg) last_filename = xstrdup (main_input_filename); { - char *wd = getpwd (); + const char *wd = getpwd (); if (wd) comp_dir_attribute (wd); } @@ -5783,7 +5783,7 @@ dwarfout_init (asm_out_file, main_input_filename) ASM_OUTPUT_PUSH_SECTION (asm_out_file, SFNAMES_SECTION); ASM_OUTPUT_LABEL (asm_out_file, SFNAMES_BEGIN_LABEL); { - register char *pwd = getpwd (); + register const char *pwd = getpwd (); register char *dirname; if (!pwd) diff --git a/gcc/tree.h b/gcc/tree.h index 165a87f5edee..0fe6ab71e36e 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2303,28 +2303,28 @@ extern char *dwarf2out_cfi_label PARAMS ((void)); /* Entry point to update the canonical frame address (CFA). */ -extern void dwarf2out_def_cfa PARAMS ((char *, unsigned, long)); +extern void dwarf2out_def_cfa PARAMS ((const char *, unsigned, long)); /* Add the CFI for saving a register window. */ -extern void dwarf2out_window_save PARAMS ((char *)); +extern void dwarf2out_window_save PARAMS ((const char *)); /* Add a CFI to update the running total of the size of arguments pushed onto the stack. */ -extern void dwarf2out_args_size PARAMS ((char *, long)); +extern void dwarf2out_args_size PARAMS ((const char *, long)); /* Entry point for saving a register to the stack. */ -extern void dwarf2out_reg_save PARAMS ((char *, unsigned, long)); +extern void dwarf2out_reg_save PARAMS ((const char *, unsigned, long)); /* Entry point for saving the return address in the stack. */ -extern void dwarf2out_return_save PARAMS ((char *, long)); +extern void dwarf2out_return_save PARAMS ((const char *, long)); /* Entry point for saving the return address in a register. */ -extern void dwarf2out_return_reg PARAMS ((char *, unsigned)); +extern void dwarf2out_return_reg PARAMS ((const char *, unsigned)); /* Output a marker (i.e. a label) for the beginning of a function, before the prologue. */ @@ -2637,28 +2637,28 @@ extern char *dwarf2out_cfi_label PARAMS ((void)); /* Entry point to update the canonical frame address (CFA). */ -extern void dwarf2out_def_cfa PARAMS ((char *, unsigned, long)); +extern void dwarf2out_def_cfa PARAMS ((const char *, unsigned, long)); /* Add the CFI for saving a register window. */ -extern void dwarf2out_window_save PARAMS ((char *)); +extern void dwarf2out_window_save PARAMS ((const char *)); /* Add a CFI to update the running total of the size of arguments pushed onto the stack. */ -extern void dwarf2out_args_size PARAMS ((char *, long)); +extern void dwarf2out_args_size PARAMS ((const char *, long)); /* Entry point for saving a register to the stack. */ -extern void dwarf2out_reg_save PARAMS ((char *, unsigned, long)); +extern void dwarf2out_reg_save PARAMS ((const char *, unsigned, long)); /* Entry point for saving the return address in the stack. */ -extern void dwarf2out_return_save PARAMS ((char *, long)); +extern void dwarf2out_return_save PARAMS ((const char *, long)); /* Entry point for saving the return address in a register. */ -extern void dwarf2out_return_reg PARAMS ((char *, unsigned)); +extern void dwarf2out_return_reg PARAMS ((const char *, unsigned)); /* Output a marker (i.e. a label) for the beginning of a function, before the prologue. */ -- 2.43.5