/* CGEN generic assembler support code.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU Binutils and GDB, the GNU debugger.
CGEN_CPU_DESC cd;
const CGEN_INSN *insns;
int count;
- int entsize;
+ int entsize ATTRIBUTE_UNUSED;
CGEN_INSN_LIST **htable;
CGEN_INSN_LIST *hentbuf;
{
const char *
cgen_parse_keyword (cd, strp, keyword_table, valuep)
- CGEN_CPU_DESC cd;
+ CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
const char **strp;
CGEN_KEYWORD *keyword_table;
long *valuep;
char buf[256];
const char *p,*start;
+ if (keyword_table->name_hash_table == NULL)
+ (void) cgen_keyword_search_init (keyword_table, NULL);
+
p = start = *strp;
- /* Allow any first character.
- Note that this allows recognizing ",a" for the annul flag in sparc
- even though "," is subsequently not a valid keyword char. */
+ /* Allow any first character. This is to make life easier for
+ the fairly common case of suffixes, eg. 'ld.b.w', where the first
+ character of the suffix ('.') is special. */
if (*p)
++p;
-
- /* Now allow letters, digits, and _. */
+
+ /* Allow letters, digits, and any special characters. */
while (((p - start) < (int) sizeof (buf))
- && (isalnum ((unsigned char) *p) || *p == '_'))
+ && *p
+ && (isalnum ((unsigned char) *p)
+ || strchr (keyword_table->nonalpha_chars, *p)))
++p;
if (p - start >= (int) sizeof (buf))