+2001-10-13 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * cgen-ibld.in: Include safe-ctype.h in preference to
+ ctype.h.
+ * cgen-asm.in: Include safe-ctype.h in preference to
+ ctype.h. Fix formatting. Use ISSPACE instead of isspace and
+ TOLOWER instead of tolower.
+ (@arch@_cgen_build_insn_regex): Remove duplication of syntax
+ string elements in constructed regular expression.
+ * fr30-asm.c: Regenerate.
+ * fr30-desc.c: Regenerate.
+ * fr30-ibld.c: Regenerate.
+ * m32r-asm.c: Regenerate.
+ * m32r-desc.c: Regenerate.
+ * m32r-ibld.c: Regenerate.
+ * openrisc-asm.c: Regenerate.
+ * openrisc-desc.c: Regenerate.
+ * openrisc-ibld.c: Regenerate.
+ * po/opcodes.pot: Regenerate.
+
2001-10-12 matthew green <mrg@redhat.com>
* ppc-opc.c (insert_de, extract_de, insert_des, extract_des): New
Keep that in mind. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "bfd.h"
#include "opintl.h"
#include "xregex.h"
#include "libiberty.h"
+#include "safe-ctype.h"
-#undef min
+#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
-#undef max
+#undef max
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
\f
-/* -- assembler routines inserted here */
+/* -- assembler routines inserted here. */
\f
-/*
- Regex construction routine.
+/* Regex construction routine.
- This translates an opcode syntax string into a regex string,
- by replacing any non-character syntax element (such as an
- opcode) with the pattern '.*'
+ This translates an opcode syntax string into a regex string,
+ by replacing any non-character syntax element (such as an
+ opcode) with the pattern '.*'
- It then compiles the regex and stores it in the opcode, for
- later use by @arch@_cgen_assemble_insn
+ It then compiles the regex and stores it in the opcode, for
+ later use by @arch@_cgen_assemble_insn
- Returns NULL for success, an error message for failure. */
+ Returns NULL for success, an error message for failure. */
char *
@arch@_cgen_build_insn_regex (insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
- int mnem_len;
char rxbuf[CGEN_MAX_RX_ELEMENTS];
char *rx = rxbuf;
const CGEN_SYNTAX_CHAR_TYPE *syn;
*rx++ = c;
break;
}
-
- /* Insert syntax char into rx. */
- *rx++ = c;
}
else
{
regfree ((regex_t *) CGEN_INSN_RX (insn));
free (CGEN_INSN_RX (insn));
(CGEN_INSN_RX (insn)) = NULL;
- return msg;
+ return msg;
}
}
GAS's input scrubber will ensure mnemonics are lowercase, but we may
not be called from GAS. */
p = CGEN_INSN_MNEMONIC (insn);
- while (*p && tolower (*p) == tolower (*str))
+ while (*p && TOLOWER (*p) == TOLOWER (*str))
++p, ++str;
if (* p)
return _("unrecognized instruction");
#ifndef CGEN_MNEMONIC_OPERANDS
- if (* str && !isspace (* str))
+ if (* str && ! ISSPACE (* str))
return _("unrecognized instruction");
#endif
first char after the mnemonic part is a space. */
/* FIXME: We also take inappropriate advantage of the fact that
GAS's input scrubber will remove extraneous blanks. */
- if (tolower (*str) == tolower (CGEN_SYNTAX_CHAR (* syn)))
+ if (TOLOWER (*str) == TOLOWER (CGEN_SYNTAX_CHAR (* syn)))
{
#ifdef CGEN_MNEMONIC_OPERANDS
if (CGEN_SYNTAX_CHAR(* syn) == ' ')
blanks now. IE: We needn't try again with a longer version of
the insn and it is assumed that longer versions of insns appear
before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
if (* str != '\0')
int recognized_mnemonic = 0;
/* Skip leading white space. */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
/* The instructions are stored in hashed lists.
Keep that in mind. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "dis-asm.h"
#include "@prefix@-desc.h"
#include "@prefix@-opc.h"
#include "opintl.h"
+#include "safe-ctype.h"
#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
Keep that in mind. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "bfd.h"
#include "opintl.h"
#include "xregex.h"
#include "libiberty.h"
+#include "safe-ctype.h"
-#undef min
+#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
-#undef max
+#undef max
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
\f
-/* -- assembler routines inserted here */
+/* -- assembler routines inserted here. */
/* -- asm.c */
/* Handle register lists for LDMx and STMx. */
\f
-/*
- Regex construction routine.
+/* Regex construction routine.
- This translates an opcode syntax string into a regex string,
- by replacing any non-character syntax element (such as an
- opcode) with the pattern '.*'
+ This translates an opcode syntax string into a regex string,
+ by replacing any non-character syntax element (such as an
+ opcode) with the pattern '.*'
- It then compiles the regex and stores it in the opcode, for
- later use by fr30_cgen_assemble_insn
+ It then compiles the regex and stores it in the opcode, for
+ later use by fr30_cgen_assemble_insn
- Returns NULL for success, an error message for failure. */
+ Returns NULL for success, an error message for failure. */
char *
fr30_cgen_build_insn_regex (insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
- int mnem_len;
char rxbuf[CGEN_MAX_RX_ELEMENTS];
char *rx = rxbuf;
const CGEN_SYNTAX_CHAR_TYPE *syn;
*rx++ = c;
break;
}
-
- /* Insert syntax char into rx. */
- *rx++ = c;
}
else
{
regfree ((regex_t *) CGEN_INSN_RX (insn));
free (CGEN_INSN_RX (insn));
(CGEN_INSN_RX (insn)) = NULL;
- return msg;
+ return msg;
}
}
GAS's input scrubber will ensure mnemonics are lowercase, but we may
not be called from GAS. */
p = CGEN_INSN_MNEMONIC (insn);
- while (*p && tolower (*p) == tolower (*str))
+ while (*p && TOLOWER (*p) == TOLOWER (*str))
++p, ++str;
if (* p)
return _("unrecognized instruction");
#ifndef CGEN_MNEMONIC_OPERANDS
- if (* str && !isspace (* str))
+ if (* str && ! ISSPACE (* str))
return _("unrecognized instruction");
#endif
first char after the mnemonic part is a space. */
/* FIXME: We also take inappropriate advantage of the fact that
GAS's input scrubber will remove extraneous blanks. */
- if (tolower (*str) == tolower (CGEN_SYNTAX_CHAR (* syn)))
+ if (TOLOWER (*str) == TOLOWER (CGEN_SYNTAX_CHAR (* syn)))
{
#ifdef CGEN_MNEMONIC_OPERANDS
if (CGEN_SYNTAX_CHAR(* syn) == ' ')
blanks now. IE: We needn't try again with a longer version of
the insn and it is assumed that longer versions of insns appear
before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
if (* str != '\0')
int recognized_mnemonic = 0;
/* Skip leading white space. */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
/* The instructions are stored in hashed lists.
*/
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "ansidecl.h"
Keep that in mind. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "dis-asm.h"
#include "fr30-desc.h"
#include "fr30-opc.h"
#include "opintl.h"
+#include "safe-ctype.h"
#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
Keep that in mind. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "bfd.h"
#include "opintl.h"
#include "xregex.h"
#include "libiberty.h"
+#include "safe-ctype.h"
-#undef min
+#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
-#undef max
+#undef max
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
\f
-/* -- assembler routines inserted here */
+/* -- assembler routines inserted here. */
/* -- asm.c */
static const char * parse_hash
\f
-/*
- Regex construction routine.
+/* Regex construction routine.
- This translates an opcode syntax string into a regex string,
- by replacing any non-character syntax element (such as an
- opcode) with the pattern '.*'
+ This translates an opcode syntax string into a regex string,
+ by replacing any non-character syntax element (such as an
+ opcode) with the pattern '.*'
- It then compiles the regex and stores it in the opcode, for
- later use by m32r_cgen_assemble_insn
+ It then compiles the regex and stores it in the opcode, for
+ later use by m32r_cgen_assemble_insn
- Returns NULL for success, an error message for failure. */
+ Returns NULL for success, an error message for failure. */
char *
m32r_cgen_build_insn_regex (insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
- int mnem_len;
char rxbuf[CGEN_MAX_RX_ELEMENTS];
char *rx = rxbuf;
const CGEN_SYNTAX_CHAR_TYPE *syn;
*rx++ = c;
break;
}
-
- /* Insert syntax char into rx. */
- *rx++ = c;
}
else
{
regfree ((regex_t *) CGEN_INSN_RX (insn));
free (CGEN_INSN_RX (insn));
(CGEN_INSN_RX (insn)) = NULL;
- return msg;
+ return msg;
}
}
GAS's input scrubber will ensure mnemonics are lowercase, but we may
not be called from GAS. */
p = CGEN_INSN_MNEMONIC (insn);
- while (*p && tolower (*p) == tolower (*str))
+ while (*p && TOLOWER (*p) == TOLOWER (*str))
++p, ++str;
if (* p)
return _("unrecognized instruction");
#ifndef CGEN_MNEMONIC_OPERANDS
- if (* str && !isspace (* str))
+ if (* str && ! ISSPACE (* str))
return _("unrecognized instruction");
#endif
first char after the mnemonic part is a space. */
/* FIXME: We also take inappropriate advantage of the fact that
GAS's input scrubber will remove extraneous blanks. */
- if (tolower (*str) == tolower (CGEN_SYNTAX_CHAR (* syn)))
+ if (TOLOWER (*str) == TOLOWER (CGEN_SYNTAX_CHAR (* syn)))
{
#ifdef CGEN_MNEMONIC_OPERANDS
if (CGEN_SYNTAX_CHAR(* syn) == ' ')
blanks now. IE: We needn't try again with a longer version of
the insn and it is assumed that longer versions of insns appear
before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
if (* str != '\0')
int recognized_mnemonic = 0;
/* Skip leading white space. */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
/* The instructions are stored in hashed lists.
*/
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "ansidecl.h"
Keep that in mind. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "dis-asm.h"
#include "m32r-desc.h"
#include "m32r-opc.h"
#include "opintl.h"
+#include "safe-ctype.h"
#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
Keep that in mind. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "bfd.h"
#include "opintl.h"
#include "xregex.h"
#include "libiberty.h"
+#include "safe-ctype.h"
-#undef min
+#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
-#undef max
+#undef max
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
\f
-/* -- assembler routines inserted here */
+/* -- assembler routines inserted here. */
/* -- asm.c */
\f
-/*
- Regex construction routine.
+/* Regex construction routine.
- This translates an opcode syntax string into a regex string,
- by replacing any non-character syntax element (such as an
- opcode) with the pattern '.*'
+ This translates an opcode syntax string into a regex string,
+ by replacing any non-character syntax element (such as an
+ opcode) with the pattern '.*'
- It then compiles the regex and stores it in the opcode, for
- later use by openrisc_cgen_assemble_insn
+ It then compiles the regex and stores it in the opcode, for
+ later use by openrisc_cgen_assemble_insn
- Returns NULL for success, an error message for failure. */
+ Returns NULL for success, an error message for failure. */
char *
openrisc_cgen_build_insn_regex (insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
- int mnem_len;
char rxbuf[CGEN_MAX_RX_ELEMENTS];
char *rx = rxbuf;
const CGEN_SYNTAX_CHAR_TYPE *syn;
*rx++ = c;
break;
}
-
- /* Insert syntax char into rx. */
- *rx++ = c;
}
else
{
regfree ((regex_t *) CGEN_INSN_RX (insn));
free (CGEN_INSN_RX (insn));
(CGEN_INSN_RX (insn)) = NULL;
- return msg;
+ return msg;
}
}
GAS's input scrubber will ensure mnemonics are lowercase, but we may
not be called from GAS. */
p = CGEN_INSN_MNEMONIC (insn);
- while (*p && tolower (*p) == tolower (*str))
+ while (*p && TOLOWER (*p) == TOLOWER (*str))
++p, ++str;
if (* p)
return _("unrecognized instruction");
#ifndef CGEN_MNEMONIC_OPERANDS
- if (* str && !isspace (* str))
+ if (* str && ! ISSPACE (* str))
return _("unrecognized instruction");
#endif
first char after the mnemonic part is a space. */
/* FIXME: We also take inappropriate advantage of the fact that
GAS's input scrubber will remove extraneous blanks. */
- if (tolower (*str) == tolower (CGEN_SYNTAX_CHAR (* syn)))
+ if (TOLOWER (*str) == TOLOWER (CGEN_SYNTAX_CHAR (* syn)))
{
#ifdef CGEN_MNEMONIC_OPERANDS
if (CGEN_SYNTAX_CHAR(* syn) == ' ')
blanks now. IE: We needn't try again with a longer version of
the insn and it is assumed that longer versions of insns appear
before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
if (* str != '\0')
int recognized_mnemonic = 0;
/* Skip leading white space. */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
/* The instructions are stored in hashed lists.
*/
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "ansidecl.h"
Keep that in mind. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "dis-asm.h"
#include "openrisc-desc.h"
#include "openrisc-opc.h"
#include "opintl.h"
+#include "safe-ctype.h"
#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-10-09 09:40+0100\n"
+"POT-Creation-Date: 2001-10-12 23:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "unrecognized keyword/register name"
msgstr ""
-#: cgen-asm.c:340 fr30-ibld.c:207 m32r-ibld.c:197 openrisc-ibld.c:197
+#: cgen-asm.c:340 fr30-ibld.c:195 m32r-ibld.c:195 openrisc-ibld.c:195
#, c-format
msgid "operand out of range (%ld not between %ld and %ld)"
msgstr ""
msgid "Address 0x%x is out of bounds.\n"
msgstr ""
-#: fr30-asm.c:312 m32r-asm.c:319 openrisc-asm.c:247
+#: fr30-asm.c:324 m32r-asm.c:326 openrisc-asm.c:245
#, c-format
msgid "Unrecognized field %d while parsing.\n"
msgstr ""
+#: fr30-asm.c:374 m32r-asm.c:376 openrisc-asm.c:295
+msgid "missing mnemonic in syntax string"
+msgstr ""
+
#. We couldn't parse it.
-#: fr30-asm.c:474 fr30-asm.c:478 fr30-asm.c:563 fr30-asm.c:665 m32r-asm.c:481
-#: m32r-asm.c:485 m32r-asm.c:570 m32r-asm.c:672 openrisc-asm.c:409
-#: openrisc-asm.c:413 openrisc-asm.c:498 openrisc-asm.c:600
+#: fr30-asm.c:510 fr30-asm.c:514 fr30-asm.c:601 fr30-asm.c:703 m32r-asm.c:512
+#: m32r-asm.c:516 m32r-asm.c:603 m32r-asm.c:705 openrisc-asm.c:431
+#: openrisc-asm.c:435 openrisc-asm.c:522 openrisc-asm.c:624
msgid "unrecognized instruction"
msgstr ""
-#: fr30-asm.c:520 m32r-asm.c:527 openrisc-asm.c:455
+#: fr30-asm.c:557 m32r-asm.c:559 openrisc-asm.c:478
#, c-format
msgid "syntax error (expected char `%c', found `%c')"
msgstr ""
-#: fr30-asm.c:529 m32r-asm.c:536 openrisc-asm.c:464
+#: fr30-asm.c:567 m32r-asm.c:569 openrisc-asm.c:488
#, c-format
msgid "syntax error (expected char `%c', found end of instruction)"
msgstr ""
-#: fr30-asm.c:557 m32r-asm.c:564 openrisc-asm.c:492
+#: fr30-asm.c:595 m32r-asm.c:597 openrisc-asm.c:516
msgid "junk at end of line"
msgstr ""
-#: fr30-asm.c:664 m32r-asm.c:671 openrisc-asm.c:599
+#: fr30-asm.c:702 m32r-asm.c:704 openrisc-asm.c:623
msgid "unrecognized form of instruction"
msgstr ""
-#: fr30-asm.c:676 m32r-asm.c:683 openrisc-asm.c:611
+#: fr30-asm.c:714 m32r-asm.c:716 openrisc-asm.c:635
#, c-format
msgid "bad instruction `%.50s...'"
msgstr ""
-#: fr30-asm.c:679 m32r-asm.c:686 openrisc-asm.c:614
+#: fr30-asm.c:717 m32r-asm.c:719 openrisc-asm.c:638
#, c-format
msgid "bad instruction `%.50s'"
msgstr ""
-#: fr30-dis.c:301 m32r-dis.c:246 openrisc-dis.c:134
+#: fr30-dis.c:319 m32r-dis.c:250 openrisc-dis.c:137
#, c-format
msgid "Unrecognized field %d while printing insn.\n"
msgstr ""
-#: fr30-ibld.c:178 m32r-ibld.c:168 openrisc-ibld.c:168
+#: fr30-ibld.c:166 m32r-ibld.c:166 openrisc-ibld.c:166
#, c-format
msgid "operand out of range (%ld not between %ld and %lu)"
msgstr ""
-#: fr30-ibld.c:191 m32r-ibld.c:181 openrisc-ibld.c:181
+#: fr30-ibld.c:179 m32r-ibld.c:179 openrisc-ibld.c:179
#, c-format
msgid "operand out of range (%lu not between 0 and %lu)"
msgstr ""
-#: fr30-ibld.c:739 m32r-ibld.c:656 openrisc-ibld.c:630
+#: fr30-ibld.c:731 m32r-ibld.c:660 openrisc-ibld.c:634
#, c-format
msgid "Unrecognized field %d while building insn.\n"
msgstr ""
-#: fr30-ibld.c:943 m32r-ibld.c:786 openrisc-ibld.c:731
+#: fr30-ibld.c:939 m32r-ibld.c:794 openrisc-ibld.c:737
#, c-format
msgid "Unrecognized field %d while decoding insn.\n"
msgstr ""
-#: fr30-ibld.c:1087 m32r-ibld.c:891 openrisc-ibld.c:806
+#: fr30-ibld.c:1088 m32r-ibld.c:904 openrisc-ibld.c:817
#, c-format
msgid "Unrecognized field %d while getting int operand.\n"
msgstr ""
-#: fr30-ibld.c:1216 m32r-ibld.c:981 openrisc-ibld.c:866
+#: fr30-ibld.c:1217 m32r-ibld.c:994 openrisc-ibld.c:877
#, c-format
msgid "Unrecognized field %d while getting vma operand.\n"
msgstr ""
-#: fr30-ibld.c:1345 m32r-ibld.c:1074 openrisc-ibld.c:930
+#: fr30-ibld.c:1351 m32r-ibld.c:1092 openrisc-ibld.c:946
#, c-format
msgid "Unrecognized field %d while setting int operand.\n"
msgstr ""
-#: fr30-ibld.c:1467 m32r-ibld.c:1160 openrisc-ibld.c:987
+#: fr30-ibld.c:1473 m32r-ibld.c:1178 openrisc-ibld.c:1003
#, c-format
msgid "Unrecognized field %d while setting vma operand.\n"
msgstr ""