From 7ae8cf75dae94f2b0b68f433e0962ffe7883a158 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Sun, 11 Aug 2002 19:14:26 +0000 Subject: [PATCH] darwin-c.c (darwin_pragma_options): Const-ify. * darwin-c.c (darwin_pragma_options): Const-ify. * darwin.c (machopic_non_lazy_ptr_name, machopic_validate_stub_or_non_lazy_ptr): Likewise. (machopic_indirect_data_reference): Wrap variables in macros controlling their use. (machopic_finish, update_non_lazy_ptrs, update_stubs): Const-ify. (machopic_select_section): Use parentheses around && within ||. * i386/darwin.h (ASM_OUTPUT_ALIGN): Avoid ambiguous-else. From-SVN: r56211 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/darwin-c.c | 2 +- gcc/config/darwin.c | 18 ++++++++++-------- gcc/config/i386/darwin.h | 11 ++++++----- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 77dcb52..0158816 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,16 @@ 2002-08-11 Kaveh R. Ghazi + * darwin-c.c (darwin_pragma_options): Const-ify. + * darwin.c (machopic_non_lazy_ptr_name, + machopic_validate_stub_or_non_lazy_ptr): Likewise. + (machopic_indirect_data_reference): Wrap variables in macros + controlling their use. + (machopic_finish, update_non_lazy_ptrs, update_stubs): Const-ify. + (machopic_select_section): Use parentheses around && within ||. + * i386/darwin.h (ASM_OUTPUT_ALIGN): Avoid ambiguous-else. + +2002-08-11 Kaveh R. Ghazi + * ip2k.c (mdr_resequence_xy_yx, mdr_propagate_reg_equivs, mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref, ip2k_adjust_stack_ref, mdr_try_move_pushes, mdr_try_propagate_clr, diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c index 8081f0f..c04c2b5 100644 --- a/gcc/config/darwin-c.c +++ b/gcc/config/darwin-c.c @@ -90,7 +90,7 @@ void darwin_pragma_options (pfile) cpp_reader *pfile ATTRIBUTE_UNUSED; { - char *arg; + const char *arg; tree t, x; if (c_lex (&t) != CPP_NAME) diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 4d34537..2fdc20a 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -265,7 +265,7 @@ const char * machopic_non_lazy_ptr_name (name) const char *name; { - char *temp_name; + const char *temp_name; tree temp, ident = get_identifier (name); for (temp = machopic_non_lazy_pointers; @@ -389,7 +389,7 @@ machopic_validate_stub_or_non_lazy_ptr (name, validate_stub) const char *name; int validate_stub; { - char *real_name; + const char *real_name; tree temp, ident = get_identifier (name), id2; for (temp = (validate_stub ? machopic_stubs : machopic_non_lazy_pointers); @@ -428,10 +428,12 @@ machopic_indirect_data_reference (orig, reg) if (machopic_data_defined_p (name)) { +#if defined (TARGET_TOC) || defined (HAVE_lo_sum) rtx pic_base = gen_rtx (SYMBOL_REF, Pmode, machopic_function_base_name ()); rtx offset = gen_rtx (CONST, Pmode, gen_rtx (MINUS, Pmode, orig, pic_base)); +#endif #if defined (TARGET_TOC) /* i.e., PowerPC */ rtx hi_sum_reg = reg; @@ -855,8 +857,8 @@ machopic_finish (asm_out_file) temp != NULL_TREE; temp = TREE_CHAIN (temp)) { - char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - char *lazy_name = IDENTIFIER_POINTER (TREE_PURPOSE (temp)); + const char *const sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); + const char *const lazy_name = IDENTIFIER_POINTER (TREE_PURPOSE (temp)); #if 0 tree decl = lookup_name_darwin (TREE_VALUE (temp)); #endif @@ -1026,7 +1028,7 @@ update_non_lazy_ptrs (name) temp != NULL_TREE; temp = TREE_CHAIN (temp)) { - char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); + const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); if (*sym_name == '!') { @@ -1090,7 +1092,7 @@ update_stubs (name) temp != NULL_TREE; temp = TREE_CHAIN (temp)) { - char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); + const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); if (*sym_name == '!') { @@ -1150,7 +1152,7 @@ machopic_select_section (exp, reloc, align) objc_string_object_section (); else if (TREE_READONLY (exp) || TREE_CONSTANT (exp)) { - if (TREE_SIDE_EFFECTS (exp) || flag_pic && reloc) + if (TREE_SIDE_EFFECTS (exp) || (flag_pic && reloc)) const_data_section (); else readonly_data_section (); @@ -1223,7 +1225,7 @@ machopic_select_section (exp, reloc, align) } else if (TREE_READONLY (exp) || TREE_CONSTANT (exp)) { - if (TREE_SIDE_EFFECTS (exp) || flag_pic && reloc) + if (TREE_SIDE_EFFECTS (exp) || (flag_pic && reloc)) const_data_section (); else readonly_data_section (); diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index 96324bc..b37d4e8 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -87,11 +87,12 @@ Boston, MA 02111-1307, USA. */ #undef ASM_OUTPUT_ALIGN #define ASM_OUTPUT_ALIGN(FILE,LOG) \ do { if ((LOG) != 0) \ - if (in_text_section () \ - ) \ - fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \ - else \ - fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \ + { \ + if (in_text_section ()) \ + fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \ + else \ + fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \ + } \ } while (0) /* This says how to output an assembler line -- 2.7.4