diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2002-08-11 19:14:26 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2002-08-11 19:14:26 +0000 |
commit | 7ae8cf75dae94f2b0b68f433e0962ffe7883a158 (patch) | |
tree | 2afdfe3aa2d375d3235aab63fb28da667db8b05d /gcc/config/darwin.c | |
parent | 8819cab5c307c14939f8766035324c8c12abf8ca (diff) | |
download | gcc-7ae8cf75dae94f2b0b68f433e0962ffe7883a158.zip gcc-7ae8cf75dae94f2b0b68f433e0962ffe7883a158.tar.gz gcc-7ae8cf75dae94f2b0b68f433e0962ffe7883a158.tar.bz2 |
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
Diffstat (limited to 'gcc/config/darwin.c')
-rw-r--r-- | gcc/config/darwin.c | 18 |
1 files changed, 10 insertions, 8 deletions
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 (); |