* as.h (rs_align_test): New.
[deliverable/binutils-gdb.git] / gas / read.c
index 0c8b80d55b1ef37bc160f1c199bebcd3e5e0f8b8..1086bf022d48539d81bf6055d80250b4beaa7134 100644 (file)
@@ -67,13 +67,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   while (0)
 #endif
 
-/* The NOP_OPCODE is for the alignment fill value.
-   Fill it a nop instruction so that the disassembler does not choke
-   on it.  */
-#ifndef NOP_OPCODE
-#define NOP_OPCODE 0x00
-#endif
-
 char *input_line_pointer;      /*->next char of source file to parse.  */
 
 #if BITS_PER_CHAR != 8
@@ -119,8 +112,7 @@ die horribly;
 #endif
 
 /* Used by is_... macros. our ctype[].  */
-char lex_type[256] =
-{
+char lex_type[256] = {
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      /* @ABCDEFGHIJKLMNO */
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      /* PQRSTUVWXYZ[\]^_ */
   0, 0, 0, LEX_HASH, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
@@ -141,8 +133,7 @@ char lex_type[256] =
 
 /* In: a character.
    Out: 1 if this character ends a line.  */
-char is_end_of_line[256] =
-{
+char is_end_of_line[256] = {
 #ifdef CR_EOL
   1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0,      /* @abcdefghijklmno */
 #else
@@ -165,6 +156,10 @@ char is_end_of_line[256] =
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0       /* */
 };
 
+#ifdef  IGNORE_OPCODE_CASE
+char original_case_string[128];
+#endif
+
 /* Functions private to this file.  */
 
 static char *buffer;   /* 1st char of each buffer of lines is here.  */
@@ -271,8 +266,7 @@ read_begin ()
 
 static struct hash_control *po_hash;
 
-static const pseudo_typeS potable[] =
-{
+static const pseudo_typeS potable[] = {
   {"abort", s_abort, 0},
   {"align", s_align_ptwo, 0},
   {"ascii", stringer, 0},
@@ -606,10 +600,10 @@ read_a_source_file (name)
                          symbol in the symbol table.  */
                      if (!mri_line_macro
 #ifdef TC_START_LABEL_WITHOUT_COLON
-                          && TC_START_LABEL_WITHOUT_COLON(c,
-                                                          input_line_pointer)
+                         && TC_START_LABEL_WITHOUT_COLON(c,
+                                                         input_line_pointer)
 #endif
-                          )
+                         )
                        line_label = colon (line_start);
                      else
                        line_label = symbol_create (line_start,
@@ -655,13 +649,13 @@ read_a_source_file (name)
                  int len;
 
                  /* Find the end of the current expanded macro line.  */
-                 for (s = input_line_pointer - 1; *s ; ++s)
+                 for (s = input_line_pointer - 1; *s; ++s)
                    if (is_end_of_line[(unsigned char) *s])
                      break;
 
                  /* Copy it for safe keeping.  Also give an indication of
                     how much macro nesting is involved at this point.  */
-                 len = s - (input_line_pointer-1);
+                 len = s - (input_line_pointer - 1);
                  copy = (char *) xmalloc (len + macro_nest + 2);
                  memset (copy, '>', macro_nest);
                  copy[macro_nest] = ' ';
@@ -735,10 +729,13 @@ read_a_source_file (name)
                  /* Expect pseudo-op or machine instruction.  */
                  pop = NULL;
 
-#define IGNORE_OPCODE_CASE
 #ifdef IGNORE_OPCODE_CASE
                  {
                    char *s2 = s;
+
+                   strncpy (original_case_string, s2, sizeof (original_case_string));
+                   original_case_string[sizeof (original_case_string) - 1] = 0;
+
                    while (*s2)
                      {
                        if (isupper ((unsigned char) *s2))
@@ -1168,26 +1165,21 @@ do_align (n, fill, len, max)
      int len;
      int max;
 {
-  char default_fill;
-
 #ifdef md_do_align
   md_do_align (n, fill, len, max, just_record_alignment);
 #endif
 
-  if (fill == NULL)
-    {
-      if (subseg_text_p (now_seg))
-       default_fill = NOP_OPCODE;
-      else
-       default_fill = 0;
-      fill = &default_fill;
-      len = 1;
-    }
-
   /* Only make a frag if we HAVE to...  */
   if (n != 0 && !need_pass_2)
     {
-      if (len <= 1)
+      if (fill == NULL)
+       {
+         if (subseg_text_p (now_seg))
+           frag_align_code (n, max);
+         else
+           frag_align (n, 0, max);
+       }
+      else if (len <= 1)
        frag_align (n, *fill, max);
       else
        frag_align_pattern (n, fill, len, max);
@@ -2087,7 +2079,7 @@ s_lcomm_internal (needs_align, bytes_p)
       if (align)
        frag_align (align, 0, 0);
 
-      /* Detach from old frag. */
+      /* Detach from old frag.  */
       if (S_GET_SEGMENT (symbolP) == bss_seg)
        symbol_get_frag (symbolP)->fr_symbol = NULL;
 
@@ -3812,7 +3804,8 @@ parse_bitfield_cons (exp, nbytes)
              break;
            }                   /* Won't fit.  */
 
-         hold = ++input_line_pointer; /* skip ':' */
+         /* Skip ':'.  */
+         hold = ++input_line_pointer;
 
          (void) expression (exp);
          if (exp->X_op != O_constant)
@@ -4977,22 +4970,11 @@ generate_file_debug ()
 void
 generate_lineno_debug ()
 {
-#ifdef ECOFF_DEBUGGING
-  /* ECOFF assemblers automatically generate debugging information.
-     FIXME: This should probably be handled elsewhere.  */
-  if (debug_type == DEBUG_UNSPECIFIED)
-    {
-      if (ECOFF_DEBUGGING && ecoff_no_current_file ())
-       debug_type = DEBUG_ECOFF;
-      else
-       debug_type = DEBUG_NONE;
-    }
-#endif
-
   switch (debug_type)
     {
     case DEBUG_UNSPECIFIED:
     case DEBUG_NONE:
+    case DEBUG_DWARF:
       break;
     case DEBUG_STABS:
       stabs_generate_asm_lineno ();
@@ -5000,9 +4982,11 @@ generate_lineno_debug ()
     case DEBUG_ECOFF:
       ecoff_generate_asm_lineno ();
       break;
-    case DEBUG_DWARF:
     case DEBUG_DWARF2:
-      /* FIXME.  */
+      /* ??? We could here indicate to dwarf2dbg.c that something
+        has changed.  However, since there is additional backend
+        support that is required (calling dwarf2_emit_insn), we
+        let dwarf2dbg.c call as_where on its own.  */
       break;
     }
 }
This page took 0.026698 seconds and 4 git commands to generate.