Thu Apr 10 14:44:56 1997 Doug Evans <dje@canuck.cygnus.com>
- * cgen-asm.c (cgen_asm_parse_operand_fn): New global.
+ * cgen-asm.c (cgen_parse_operand_fn): New global.
(cgen_parse_{{,un}signed_integer,address}): Update call to
- cgen_asm_parse_operand_fn.
- * m32r-asm.c (parse_insn_normal): Delete call to cgen_asm_init_parse.
+ cgen_parse_operand_fn.
+ (cgen_init_parse_operand): New function.
+ * m32r-asm.c (parse_insn_normal): cgen_init_parse_operand renamed
+ from cgen_asm_init_parse.
(m32r_cgen_assemble_insn): New operand `errmsg'.
Delete call to as_bad, return error message to caller.
(m32r_cgen_asm_hash_keywords): #if 0 out.
#include "opcode/cgen.h"
/* Operand parsing callback. */
-const char * (*cgen_asm_parse_operand_fn)
- PARAMS ((const char **, int, int, enum cgen_asm_result *, bfd_vma *));
+const char * (*cgen_parse_operand_fn)
+ PARAMS ((enum cgen_parse_operand_type, const char **, int, int,
+ enum cgen_parse_operand_result *, bfd_vma *));
/* This is not published as part of the public interface so we don't
declare this in cgen.h. */
/* Assembler instruction hash table. */
static CGEN_INSN_LIST **asm_hash_table;
+/* Called once at startup and whenever machine/endian change. */
+
void
cgen_asm_init ()
{
}
}
+/* Called whenever starting to parse an insn. */
+
+void
+cgen_init_parse_operand ()
+{
+ /* This tells the callback to re-initialize. */
+ (void) (*cgen_parse_operand_fn) (CGEN_PARSE_OPERAND_INIT, NULL, 0, 0,
+ NULL, NULL);
+}
+
/* Build the assembler instruction hash table. */
static void
long *valuep;
{
long value;
- enum cgen_asm_result result;
+ enum cgen_parse_operand_result result;
const char *errmsg;
- errmsg = (*cgen_asm_parse_operand_fn) (strp, opindex, BFD_RELOC_NONE,
- &result, &value);
+ errmsg = (*cgen_parse_operand_fn) (CGEN_PARSE_OPERAND_INTEGER, strp,
+ opindex, BFD_RELOC_NONE,
+ &result, &value);
/* FIXME: Examine `result'. */
if (!errmsg)
{
unsigned long *valuep;
{
unsigned long value;
- enum cgen_asm_result result;
+ enum cgen_parse_operand_result result;
const char *errmsg;
- errmsg = (*cgen_asm_parse_operand_fn) (strp, opindex, BFD_RELOC_NONE,
- &result, &value);
+ errmsg = (*cgen_parse_operand_fn) (CGEN_PARSE_OPERAND_INTEGER, strp,
+ opindex, BFD_RELOC_NONE,
+ &result, &value);
/* FIXME: Examine `result'. */
if (!errmsg)
{
long *valuep;
{
long value;
- enum cgen_asm_result result;
+ enum cgen_parse_operand_result result;
const char *errmsg;
- errmsg = (*cgen_asm_parse_operand_fn) (strp, opindex, opinfo,
- &result, &value);
+ errmsg = (*cgen_parse_operand_fn) (CGEN_PARSE_OPERAND_ADDRESS, strp,
+ opindex, opinfo,
+ &result, &value);
/* FIXME: Examine `result'. */
if (!errmsg)
{