Commit 7ae8cf75 by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent 8819cab5
2002-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2002-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* 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 <ghazi@caip.rutgers.edu>
* ip2k.c (mdr_resequence_xy_yx, mdr_propagate_reg_equivs, * ip2k.c (mdr_resequence_xy_yx, mdr_propagate_reg_equivs,
mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref, mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref,
ip2k_adjust_stack_ref, mdr_try_move_pushes, mdr_try_propagate_clr, ip2k_adjust_stack_ref, mdr_try_move_pushes, mdr_try_propagate_clr,
......
...@@ -90,7 +90,7 @@ void ...@@ -90,7 +90,7 @@ void
darwin_pragma_options (pfile) darwin_pragma_options (pfile)
cpp_reader *pfile ATTRIBUTE_UNUSED; cpp_reader *pfile ATTRIBUTE_UNUSED;
{ {
char *arg; const char *arg;
tree t, x; tree t, x;
if (c_lex (&t) != CPP_NAME) if (c_lex (&t) != CPP_NAME)
......
...@@ -265,7 +265,7 @@ const char * ...@@ -265,7 +265,7 @@ const char *
machopic_non_lazy_ptr_name (name) machopic_non_lazy_ptr_name (name)
const char *name; const char *name;
{ {
char *temp_name; const char *temp_name;
tree temp, ident = get_identifier (name); tree temp, ident = get_identifier (name);
for (temp = machopic_non_lazy_pointers; for (temp = machopic_non_lazy_pointers;
...@@ -389,7 +389,7 @@ machopic_validate_stub_or_non_lazy_ptr (name, validate_stub) ...@@ -389,7 +389,7 @@ machopic_validate_stub_or_non_lazy_ptr (name, validate_stub)
const char *name; const char *name;
int validate_stub; int validate_stub;
{ {
char *real_name; const char *real_name;
tree temp, ident = get_identifier (name), id2; tree temp, ident = get_identifier (name), id2;
for (temp = (validate_stub ? machopic_stubs : machopic_non_lazy_pointers); for (temp = (validate_stub ? machopic_stubs : machopic_non_lazy_pointers);
...@@ -428,10 +428,12 @@ machopic_indirect_data_reference (orig, reg) ...@@ -428,10 +428,12 @@ machopic_indirect_data_reference (orig, reg)
if (machopic_data_defined_p (name)) if (machopic_data_defined_p (name))
{ {
#if defined (TARGET_TOC) || defined (HAVE_lo_sum)
rtx pic_base = gen_rtx (SYMBOL_REF, Pmode, rtx pic_base = gen_rtx (SYMBOL_REF, Pmode,
machopic_function_base_name ()); machopic_function_base_name ());
rtx offset = gen_rtx (CONST, Pmode, rtx offset = gen_rtx (CONST, Pmode,
gen_rtx (MINUS, Pmode, orig, pic_base)); gen_rtx (MINUS, Pmode, orig, pic_base));
#endif
#if defined (TARGET_TOC) /* i.e., PowerPC */ #if defined (TARGET_TOC) /* i.e., PowerPC */
rtx hi_sum_reg = reg; rtx hi_sum_reg = reg;
...@@ -855,8 +857,8 @@ machopic_finish (asm_out_file) ...@@ -855,8 +857,8 @@ machopic_finish (asm_out_file)
temp != NULL_TREE; temp != NULL_TREE;
temp = TREE_CHAIN (temp)) temp = TREE_CHAIN (temp))
{ {
char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); const char *const sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
char *lazy_name = IDENTIFIER_POINTER (TREE_PURPOSE (temp)); const char *const lazy_name = IDENTIFIER_POINTER (TREE_PURPOSE (temp));
#if 0 #if 0
tree decl = lookup_name_darwin (TREE_VALUE (temp)); tree decl = lookup_name_darwin (TREE_VALUE (temp));
#endif #endif
...@@ -1026,7 +1028,7 @@ update_non_lazy_ptrs (name) ...@@ -1026,7 +1028,7 @@ update_non_lazy_ptrs (name)
temp != NULL_TREE; temp != NULL_TREE;
temp = TREE_CHAIN (temp)) temp = TREE_CHAIN (temp))
{ {
char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
if (*sym_name == '!') if (*sym_name == '!')
{ {
...@@ -1090,7 +1092,7 @@ update_stubs (name) ...@@ -1090,7 +1092,7 @@ update_stubs (name)
temp != NULL_TREE; temp != NULL_TREE;
temp = TREE_CHAIN (temp)) temp = TREE_CHAIN (temp))
{ {
char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
if (*sym_name == '!') if (*sym_name == '!')
{ {
...@@ -1150,7 +1152,7 @@ machopic_select_section (exp, reloc, align) ...@@ -1150,7 +1152,7 @@ machopic_select_section (exp, reloc, align)
objc_string_object_section (); objc_string_object_section ();
else if (TREE_READONLY (exp) || TREE_CONSTANT (exp)) 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 (); const_data_section ();
else else
readonly_data_section (); readonly_data_section ();
...@@ -1223,7 +1225,7 @@ machopic_select_section (exp, reloc, align) ...@@ -1223,7 +1225,7 @@ machopic_select_section (exp, reloc, align)
} }
else if (TREE_READONLY (exp) || TREE_CONSTANT (exp)) 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 (); const_data_section ();
else else
readonly_data_section (); readonly_data_section ();
......
...@@ -87,11 +87,12 @@ Boston, MA 02111-1307, USA. */ ...@@ -87,11 +87,12 @@ Boston, MA 02111-1307, USA. */
#undef ASM_OUTPUT_ALIGN #undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \ #define ASM_OUTPUT_ALIGN(FILE,LOG) \
do { if ((LOG) != 0) \ do { if ((LOG) != 0) \
if (in_text_section () \ { \
) \ if (in_text_section ()) \
fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \ fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \
else \ else \
fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \ fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \
} \
} while (0) } while (0)
/* This says how to output an assembler line /* This says how to output an assembler line
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment