Changeset 609 for branches/GNU/src/binutils/gas/cond.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/gas/cond.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 61 61 static struct conditional_frame *current_cframe = NULL; 62 62 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 66 void 67 s_ifdef (test_defined) 68 int test_defined; 66 69 { 67 70 /* Points to name of symbol. */ 68 registerchar *name;71 char *name; 69 72 /* Points to symbol. */ 70 registersymbolS *symbolP;73 symbolS *symbolP; 71 74 struct conditional_frame cframe; 75 char c; 72 76 73 77 /* Leading whitespace is part of operand. */ … … 80 84 obstack_1grow (&cond_obstack, 0); 81 85 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 (); 105 123 } 106 124 … … 258 276 if (current_cframe == NULL) 259 277 { 260 as_bad (_("\".elseif\" without matching \".if\" - ignored"));278 as_bad (_("\".elseif\" without matching \".if\"")); 261 279 } 262 280 else if (current_cframe->else_seen) 263 281 { 264 as_bad (_("\".elseif\" after \".else\" - ignored"));282 as_bad (_("\".elseif\" after \".else\"")); 265 283 as_bad_where (current_cframe->else_file_line.file, 266 284 current_cframe->else_file_line.line, … … 366 384 if (current_cframe == NULL) 367 385 { 368 as_bad (_(" .else without matching .if - ignored"));386 as_bad (_("\".else\" without matching \".if\"")); 369 387 } 370 388 else if (current_cframe->else_seen) 371 389 { 372 as_bad (_("duplicate \"else\" - ignored"));390 as_bad (_("duplicate \"else\"")); 373 391 as_bad_where (current_cframe->else_file_line.file, 374 392 current_cframe->else_file_line.line, -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.