Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/gas/cond.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    6161static struct conditional_frame *current_cframe = NULL;
    6262
    63 void
    64 s_ifdef (arg)
    65      int arg;
     63/* Performs the .ifdef (test_defined == 1) and
     64   the .ifndef (test_defined == 0) pseudo op.  */
     65
     66void
     67s_ifdef (test_defined)
     68     int test_defined;
    6669{
    6770  /* Points to name of symbol.  */
    68   register char *name;
     71  char *name;
    6972  /* Points to symbol.  */
    70   register symbolS *symbolP;
     73  symbolS *symbolP;
    7174  struct conditional_frame cframe;
     75  char c;
    7276
    7377  /* Leading whitespace is part of operand.  */
     
    8084      obstack_1grow (&cond_obstack, 0);
    8185      ignore_rest_of_line ();
    82     }
    83   else
    84     {
    85       char c;
    86 
    87       c = get_symbol_end ();
    88       symbolP = symbol_find (name);
    89       *input_line_pointer = c;
    90 
    91       initialize_cframe (&cframe);
    92       cframe.ignoring = cframe.dead_tree || !((symbolP != 0) ^ arg);
    93       current_cframe = ((struct conditional_frame *)
    94                         obstack_copy (&cond_obstack, &cframe,
    95                                       sizeof (cframe)));
    96 
    97       if (LISTING_SKIP_COND ()
    98           && cframe.ignoring
    99           && (cframe.previous_cframe == NULL
    100               || ! cframe.previous_cframe->ignoring))
    101         listing_list (2);
    102 
    103       demand_empty_rest_of_line ();
    104     }                           /* if a valid identifyer name */
     86      return;
     87    }
     88
     89  c = get_symbol_end ();
     90  symbolP = symbol_find (name);
     91  *input_line_pointer = c;
     92
     93  initialize_cframe (&cframe);
     94 
     95  if (cframe.dead_tree)
     96    cframe.ignoring = 1;
     97  else
     98    {
     99      int is_defined;
     100
     101      /* Use the same definition of 'defined' as .equiv so that a symbol
     102         which has been referenced but not yet given a value/address is
     103         considered to be undefined.  */
     104      is_defined =
     105        symbolP != NULL
     106        && S_IS_DEFINED (symbolP)
     107        && S_GET_SEGMENT (symbolP) != reg_section;
     108
     109      cframe.ignoring = ! (test_defined ^ is_defined);
     110    }
     111
     112  current_cframe = ((struct conditional_frame *)
     113                    obstack_copy (&cond_obstack, &cframe,
     114                                  sizeof (cframe)));
     115
     116  if (LISTING_SKIP_COND ()
     117      && cframe.ignoring
     118      && (cframe.previous_cframe == NULL
     119          || ! cframe.previous_cframe->ignoring))
     120    listing_list (2);
     121
     122  demand_empty_rest_of_line ();
    105123}
    106124
     
    258276  if (current_cframe == NULL)
    259277    {
    260       as_bad (_("\".elseif\" without matching \".if\" - ignored"));
     278      as_bad (_("\".elseif\" without matching \".if\""));
    261279    }
    262280  else if (current_cframe->else_seen)
    263281    {
    264       as_bad (_("\".elseif\" after \".else\" - ignored"));
     282      as_bad (_("\".elseif\" after \".else\""));
    265283      as_bad_where (current_cframe->else_file_line.file,
    266284                    current_cframe->else_file_line.line,
     
    366384  if (current_cframe == NULL)
    367385    {
    368       as_bad (_(".else without matching .if - ignored"));
     386      as_bad (_("\".else\" without matching \".if\""));
    369387    }
    370388  else if (current_cframe->else_seen)
    371389    {
    372       as_bad (_("duplicate \"else\" - ignored"));
     390      as_bad (_("duplicate \"else\""));
    373391      as_bad_where (current_cframe->else_file_line.file,
    374392                    current_cframe->else_file_line.line,
Note: See TracChangeset for help on using the changeset viewer.