OSDN Git Service

* darwin-c.c (darwin_pragma_options): Const-ify.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Aug 2002 19:14:26 +0000 (19:14 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Aug 2002 19:14:26 +0000 (19:14 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56211 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/darwin-c.c
gcc/config/darwin.c
gcc/config/i386/darwin.h

index 77dcb52..0158816 100644 (file)
@@ -1,5 +1,16 @@
 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,
        mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref,
        ip2k_adjust_stack_ref, mdr_try_move_pushes, mdr_try_propagate_clr,
index 8081f0f..c04c2b5 100644 (file)
@@ -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)
index 4d34537..2fdc20a 100644 (file)
@@ -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 ();
index 96324bc..b37d4e8 100644 (file)
@@ -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