aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c137
1 files changed, 61 insertions, 76 deletions
diff --git a/gas/read.c b/gas/read.c
index f9aa332..71bb664 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -412,10 +412,8 @@ static const pseudo_typeS potable[] = {
{"exitm", s_mexit, 0},
/* extend */
{"extern", s_ignore, 0}, /* We treat all undef as ext. */
- {"appfile", s_app_file, 1},
- {"appline", s_app_line, 1},
{"fail", s_fail, 0},
- {"file", s_app_file, 0},
+ {"file", s_file, 0},
{"fill", s_fill, 0},
{"float", float_cons, 'f'},
{"format", s_ignore, 0},
@@ -448,7 +446,7 @@ static const pseudo_typeS potable[] = {
{"irepc", s_irp, 1},
{"lcomm", s_lcomm, 0},
{"lflags", s_ignore, 0}, /* Listing flags. */
- {"linefile", s_app_line, 0},
+ {"linefile", s_linefile, 0},
{"linkonce", s_linkonce, 0},
{"list", listing_list, 1}, /* Turn listing on. */
{"llen", listing_psize, 1},
@@ -2000,15 +1998,11 @@ s_data (int ignore ATTRIBUTE_UNUSED)
demand_empty_rest_of_line ();
}
-/* Handle the .appfile pseudo-op. This is automatically generated by
- do_scrub_chars when a preprocessor # line comment is seen with a
- file name. This default definition may be overridden by the object
- or CPU specific pseudo-ops. This function is also the default
- definition for .file; the APPFILE argument is 1 for .appfile, 0 for
- .file. */
+/* Handle the .file pseudo-op. This default definition may be overridden by
+ the object or CPU specific pseudo-ops. */
void
-s_app_file_string (char *file, int appfile ATTRIBUTE_UNUSED)
+s_file_string (char *file)
{
#ifdef LISTING
if (listing)
@@ -2016,12 +2010,12 @@ s_app_file_string (char *file, int appfile ATTRIBUTE_UNUSED)
#endif
register_dependency (file);
#ifdef obj_app_file
- obj_app_file (file, appfile);
+ obj_app_file (file);
#endif
}
void
-s_app_file (int appfile)
+s_file (int ignore ATTRIBUTE_UNUSED)
{
char *s;
int length;
@@ -2029,8 +2023,7 @@ s_app_file (int appfile)
/* Some assemblers tolerate immediately following '"'. */
if ((s = demand_copy_string (&length)) != 0)
{
- int may_omit
- = (!new_logical_line_flags (s, -1, 1) && appfile);
+ new_logical_line_flags (s, -1, 1);
/* In MRI mode, the preprocessor may have inserted an extraneous
backquote. */
@@ -2040,8 +2033,7 @@ s_app_file (int appfile)
++input_line_pointer;
demand_empty_rest_of_line ();
- if (!may_omit)
- s_app_file_string (s, appfile);
+ s_file_string (s);
}
}
@@ -2058,21 +2050,19 @@ get_linefile_number (int *flag)
return 1;
}
-/* Handle the .appline pseudo-op. This is automatically generated by
+/* Handle the .linefile pseudo-op. This is automatically generated by
do_scrub_chars when a preprocessor # line comment is seen. This
default definition may be overridden by the object or CPU specific
pseudo-ops. */
void
-s_app_line (int appline)
+s_linefile (int ignore ATTRIBUTE_UNUSED)
{
char *file = NULL;
int linenum, flags = 0;
/* The given number is that of the next line. */
- if (appline)
- linenum = get_absolute_expression ();
- else if (!get_linefile_number (&linenum))
+ if (!get_linefile_number (&linenum))
{
ignore_rest_of_line ();
return;
@@ -2094,65 +2084,60 @@ s_app_line (int appline)
{
int length = 0;
- if (!appline)
+ SKIP_WHITESPACE ();
+
+ if (*input_line_pointer == '"')
+ file = demand_copy_string (&length);
+ else if (*input_line_pointer == '.')
{
- SKIP_WHITESPACE ();
+ /* buffer_and_nest() may insert this form. */
+ ++input_line_pointer;
+ flags = 1 << 3;
+ }
- if (*input_line_pointer == '"')
- file = demand_copy_string (&length);
- else if (*input_line_pointer == '.')
- {
- /* buffer_and_nest() may insert this form. */
- ++input_line_pointer;
- flags = 1 << 3;
- }
+ if (file)
+ {
+ int this_flag;
- if (file)
- {
- int this_flag;
+ while (get_linefile_number (&this_flag))
+ switch (this_flag)
+ {
+ /* From GCC's cpp documentation:
+ 1: start of a new file.
+ 2: returning to a file after having included another file.
+ 3: following text comes from a system header file.
+ 4: following text should be treated as extern "C".
+
+ 4 is nonsensical for the assembler; 3, we don't care about,
+ so we ignore it just in case a system header file is
+ included while preprocessing assembly. So 1 and 2 are all
+ we care about, and they are mutually incompatible.
+ new_logical_line_flags() demands this. */
+ case 1:
+ case 2:
+ if (flags && flags != (1 << this_flag))
+ as_warn (_("incompatible flag %i in line directive"),
+ this_flag);
+ else
+ flags |= 1 << this_flag;
+ break;
- while (get_linefile_number (&this_flag))
- switch (this_flag)
- {
- /* From GCC's cpp documentation:
- 1: start of a new file.
- 2: returning to a file after having included
- another file.
- 3: following text comes from a system header file.
- 4: following text should be treated as extern "C".
-
- 4 is nonsensical for the assembler; 3, we don't
- care about, so we ignore it just in case a
- system header file is included while
- preprocessing assembly. So 1 and 2 are all we
- care about, and they are mutually incompatible.
- new_logical_line_flags() demands this. */
- case 1:
- case 2:
- if (flags && flags != (1 << this_flag))
- as_warn (_("incompatible flag %i in line directive"),
- this_flag);
- else
- flags |= 1 << this_flag;
- break;
-
- case 3:
- case 4:
- /* We ignore these. */
- break;
-
- default:
- as_warn (_("unsupported flag %i in line directive"),
- this_flag);
- break;
- }
+ case 3:
+ case 4:
+ /* We ignore these. */
+ break;
- if (!is_end_of_line[(unsigned char)*input_line_pointer])
- file = 0;
- }
- }
+ default:
+ as_warn (_("unsupported flag %i in line directive"),
+ this_flag);
+ break;
+ }
+
+ if (!is_end_of_line[(unsigned char)*input_line_pointer])
+ file = NULL;
+ }
- if (appline || file || flags)
+ if (file || flags)
{
linenum--;
new_logical_line_flags (file, linenum, flags);
@@ -2162,7 +2147,7 @@ s_app_line (int appline)
#endif
}
}
- if (appline || file || flags)
+ if (file || flags)
demand_empty_rest_of_line ();
else
ignore_rest_of_line ();