aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-alpha.c
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1994-06-03 17:42:27 +0000
committerDavid MacKenzie <djm@cygnus>1994-06-03 17:42:27 +0000
commitf3d817d8b7dd2b45a294f2a2cb2a2eb4eed0af07 (patch)
treeabba03b98ddaacc2f7f940a5d16cd2f2bf10485b /gas/config/tc-alpha.c
parent172559ec3375efe6c3964670fe22c38255ee4280 (diff)
downloadgdb-f3d817d8b7dd2b45a294f2a2cb2a2eb4eed0af07.zip
gdb-f3d817d8b7dd2b45a294f2a2cb2a2eb4eed0af07.tar.gz
gdb-f3d817d8b7dd2b45a294f2a2cb2a2eb4eed0af07.tar.bz2
* as.c (show_usage): Remove target specific messages;
instead, call md_show_usage. (parse_args): Use getopt_long_only. Take pointers to argc and argv. (main): Pass parse_args pointers. * as.h: Remove 3 variables that are redundant with flagseen. * as.c, messages.c: Change their users to use flagseen. Define getopt stuff. * tc.h: Update md_parse_option decl. Add md_show_usage decl. * config/tc-*.c: Add md_shortopts, md_longopts, md_longopts_size, md_show_usage. Change calling convention for md_parse_option. Remove md_parse_long_option. * config/tc-ns32k.c: Rename `struct option' to `struct ns32k_option'. * config/tc-i386.h: Don't define md_parse_option.
Diffstat (limited to 'gas/config/tc-alpha.c')
-rw-r--r--gas/config/tc-alpha.c122
1 files changed, 58 insertions, 64 deletions
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index c8da0cb..61764eb 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -2001,81 +2001,75 @@ md_bignum_to_chars (buf, bignum, nchars)
while (--nb);
}
}
+
+CONST char *md_shortopts = "Fm:";
+struct option md_longopts[] = {
+#define OPTION_32ADDR (OPTION_MD_BASE)
+ {"32addr", no_argument, NULL, OPTION_32ADDR},
+ {NULL, no_argument, NULL, 0}
+};
+size_t md_longopts_size = sizeof(md_longopts);
int
-md_parse_option (argP, cntP, vecP)
- char **argP;
- int *cntP;
- char ***vecP;
+md_parse_option (c, arg)
+ int c;
+ char *arg;
{
- if (**argP == 'F')
+ switch (c)
{
+ case 'F':
nofloats = 1;
- return 1;
- }
-#if 0 /* I have no idea if this stuff would work any more. And it's
- probably not right for ECOFF anyways. */
- /* Use base-register addressing, e.g. PIC code */
- if (**argP == 'B')
- {
- if (first_32bit_quadrant)
- {
- first_32bit_quadrant = 0;
- base_register = GP;
- }
- else
- {
- first_32bit_quadrant = 1;
- base_register = ZERO;
- }
- if (argP[0][1] == 'k')
- no_mixed_code = 1;
- argP[0][1] = 0;
- return 1;
- }
-#endif
- if (!strcmp (*argP, "32addr"))
- {
+ break;
+
+ case OPTION_32ADDR:
addr32 = 1;
- *argP += 6;
- return 1;
- }
- if (!strcmp (*argP, "nocpp"))
- {
- *argP += 5;
- return 1;
- }
- if (**argP == 'm')
- {
- unsigned long mach;
-
- (*argP)++;
- if (!strcmp (*argP, "21064"))
- mach = 21064;
- else if (!strcmp (*argP, "21066"))
- mach = 21066;
- else if (!strcmp (*argP, "21164"))
- mach = 21164;
- else
- {
- mach = 0;
- (*argP)--;
- return 0;
- }
- (*argP) += 5;
+ break;
- if (machine != 0 && machine != mach)
- {
- as_warn ("machine type %lu already chosen, overriding with %lu",
- machine, mach);
- }
- machine = mach;
+ case 'm':
+ {
+ unsigned long mach;
+
+ if (!strcmp (arg, "21064"))
+ mach = 21064;
+ else if (!strcmp (arg, "21066"))
+ mach = 21066;
+ else if (!strcmp (arg, "21164"))
+ mach = 21164;
+ else
+ {
+ as_bad ("invalid architecture %s", arg);
+ return 0;
+ }
- return 1;
+ if (machine != 0 && machine != mach)
+ {
+ as_warn ("machine type %lu already chosen, overriding with %lu",
+ machine, mach);
+ }
+ machine = mach;
+ }
+ break;
+
+ default:
+ return 0;
}
- return 0;
+
+ return 1;
}
+void
+md_show_usage (stream)
+ FILE *stream;
+{
+ fprintf(stream, "\
+Alpha options:\n\
+-32addr treat addresses as 32-bit values\n\
+-F lack floating point instructions support\n\
+-m21064 | -m21066 | -m21164\n\
+ specify variant of Alpha architecture\n\
+-nocpp ignored\n");
+}
+
static void
s_proc (is_static)
{