For SOM, don't force relocs on out-of-range 12 bit branches.
[deliverable/binutils-gdb.git] / gas / app.c
index 68336d2e8cc1095f3210c28428b9417a8169d4bb..3a1b417b638db352506dd860e5d496d150c08506 100644 (file)
--- a/gas/app.c
+++ b/gas/app.c
@@ -1,5 +1,5 @@
 /* This is the Assembler Pre-Processor
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 #endif
 #endif
 
+#ifdef TC_M68K
 /* Whether we are scrubbing in m68k MRI mode.  This is different from
    flag_m68k_mri, because the two flags will be affected by the .mri
    pseudo-op at different times.  */
 static int scrub_m68k_mri;
+#else
+#define scrub_m68k_mri 0
+#endif
 
 /* The pseudo-op which switches in and out of MRI mode.  See the
    comment in do_scrub_chars.  */
 static const char mri_pseudo[] = ".mri 0";
 
 #if defined TC_ARM && defined OBJ_ELF
-/* The pseudo-op for which we need to special-case `@' characters. 
+/* The pseudo-op for which we need to special-case `@' characters.
    See the comment in do_scrub_chars.  */
 static const char   symver_pseudo[] = ".symver";
 static const char * symver_state;
@@ -84,29 +88,31 @@ static int process_escape PARAMS ((int));
 
 /* FIXME-soon: The entire lexer/parser thingy should be
    built statically at compile time rather than dynamically
-   each and every time the assembler is run.  xoxorich. */
+   each and every time the assembler is run.  xoxorich.  */
 
-void 
+void
 do_scrub_begin (m68k_mri)
-     int m68k_mri;
+     int m68k_mri ATTRIBUTE_UNUSED;
 {
   const char *p;
   int c;
 
-  scrub_m68k_mri = m68k_mri;
-
   lex[' '] = LEX_IS_WHITESPACE;
   lex['\t'] = LEX_IS_WHITESPACE;
   lex['\r'] = LEX_IS_WHITESPACE;
   lex['\n'] = LEX_IS_NEWLINE;
-  lex[';'] = LEX_IS_LINE_SEPARATOR;
   lex[':'] = LEX_IS_COLON;
 
+#ifdef TC_M68K
+  scrub_m68k_mri = m68k_mri;
+
   if (! m68k_mri)
+#endif
     {
       lex['"'] = LEX_IS_STRINGQUOTE;
 
-#ifndef TC_HPPA
+#if ! defined (TC_HPPA) && ! defined (TC_I370)
+      /* I370 uses single-quotes to delimit integer, float constants */
       lex['\''] = LEX_IS_ONECHAR_QUOTE;
 #endif
 
@@ -164,6 +170,7 @@ do_scrub_begin (m68k_mri)
       lex['/'] = LEX_IS_TWOCHAR_COMMENT_1ST;
     }
 
+#ifdef TC_M68K
   if (m68k_mri)
     {
       lex['\''] = LEX_IS_STRINGQUOTE;
@@ -173,6 +180,7 @@ do_scrub_begin (m68k_mri)
          then it can't be used in an expression.  */
       lex['!'] = LEX_IS_LINE_COMMENT_START;
     }
+#endif
 
 #ifdef TC_V850
   lex['-'] = LEX_IS_DOUBLEDASH_1ST;
@@ -212,7 +220,9 @@ struct app_save
     int          add_newlines;
     char *       saved_input;
     int          saved_input_len;
+#ifdef TC_M68K
     int          scrub_m68k_mri;
+#endif
     const char * mri_state;
     char         mri_last_ch;
 #if defined TC_ARM && defined OBJ_ELF
@@ -239,14 +249,16 @@ app_push ()
       memcpy (saved->saved_input, saved_input, saved_input_len);
       saved->saved_input_len = saved_input_len;
     }
+#ifdef TC_M68K
   saved->scrub_m68k_mri = scrub_m68k_mri;
+#endif
   saved->mri_state = mri_state;
   saved->mri_last_ch = mri_last_ch;
 #if defined TC_ARM && defined OBJ_ELF
   saved->symver_state = symver_state;
 #endif
 
-  /* do_scrub_begin() is not useful, just wastes time. */
+  /* do_scrub_begin() is not useful, just wastes time.  */
 
   state = 0;
   saved_input = NULL;
@@ -254,13 +266,13 @@ app_push ()
   return (char *) saved;
 }
 
-void 
+void
 app_pop (arg)
      char *arg;
 {
   register struct app_save *saved = (struct app_save *) arg;
 
-  /* There is no do_scrub_end (). */
+  /* There is no do_scrub_end ().  */
   state = saved->state;
   old_state = saved->old_state;
   out_string = saved->out_string;
@@ -276,7 +288,9 @@ app_pop (arg)
       saved_input_len = saved->saved_input_len;
       free (saved->saved_input);
     }
+#ifdef TC_M68K
   scrub_m68k_mri = saved->scrub_m68k_mri;
+#endif
   mri_state = saved->mri_state;
   mri_last_ch = saved->mri_last_ch;
 #if defined TC_ARM && defined OBJ_ELF
@@ -288,7 +302,7 @@ app_pop (arg)
 
 /* @@ This assumes that \n &c are the same on host and target.  This is not
    necessarily true.  */
-static int 
+static int
 process_escape (ch)
      int ch;
 {
@@ -849,11 +863,7 @@ do_scrub_chars (get, tostart, tolen)
              state = 10;       /* Sp after symbol char */
              goto recycle;
            case 11:
-             if (flag_m68k_mri
-#ifdef LABELS_WITHOUT_COLONS
-                 || 1
-#endif
-                 )
+             if (LABELS_WITHOUT_COLONS || flag_m68k_mri)
                state = 1;
              else
                {
@@ -902,6 +912,21 @@ do_scrub_chars (get, tostart, tolen)
              ch = ' ';
              goto recycle;
            }
+#ifdef DOUBLESLASH_LINE_COMMENTS
+         else if (ch2 == '/')
+           {
+             do
+               {
+                 ch = GET ();
+               }
+             while (ch != EOF && !IS_NEWLINE (ch));
+             if (ch == EOF)
+               as_warn ("end of file in comment; newline inserted");
+             state = 0;
+             PUT ('\n');
+             break;
+           }
+#endif
          else
            {
              if (ch2 != EOF)
@@ -1006,7 +1031,7 @@ do_scrub_chars (get, tostart, tolen)
              --add_newlines;
              UNGET (ch);
            }
-         /* fall thru into... */
+         /* Fall through.  */
 
        case LEX_IS_LINE_SEPARATOR:
          state = 0;
@@ -1021,7 +1046,7 @@ do_scrub_chars (get, tostart, tolen)
              UNGET (ch2);
              goto de_fault;
            }
-         /* read and skip to end of line */
+         /* Read and skip to end of line.  */
          do
            {
              ch = GET ();
@@ -1034,7 +1059,7 @@ do_scrub_chars (get, tostart, tolen)
          state = 0;
          PUT ('\n');
          break;
-#endif     
+#endif
 #ifdef DOUBLEBAR_PARALLEL
        case LEX_IS_DOUBLEBAR_1ST:
          ch2 = GET();
@@ -1049,7 +1074,7 @@ do_scrub_chars (get, tostart, tolen)
          PUT ('|');
          PUT ('|');
          break;
-#endif     
+#endif
        case LEX_IS_LINE_COMMENT_START:
          /* FIXME-someday: The two character comment stuff was badly
             thought out.  On i386, we want '/' as line comment start
@@ -1098,7 +1123,7 @@ do_scrub_chars (get, tostart, tolen)
                  PUT ('\n');
                  break;
                }
-             /* Loks like `# 123 "filename"' from cpp.  */
+             /* Looks like `# 123 "filename"' from cpp.  */
              UNGET (ch);
              old_state = 4;
              state = -1;
@@ -1145,6 +1170,10 @@ do_scrub_chars (get, tostart, tolen)
             as default if so.  This is a hack.  */
          if ((symver_state != NULL) && (*symver_state == 0))
            goto de_fault;
+#endif
+#ifdef WARN_COMMENTS
+         if (!found_comment)
+           as_where (&found_comment_file, &found_comment);
 #endif
          do
            {
@@ -1225,7 +1254,7 @@ do_scrub_chars (get, tostart, tolen)
                        case 2: *to++ = *from++;
                        case 1: *to++ = *from++;
                        }
-                   } 
+                   }
                  ch = GET ();
                }
            }
This page took 0.026059 seconds and 4 git commands to generate.