* cgen-asm.c (cgen_parse_operand_fn): New global.
(cgen_parse_{{,un}signed_integer,address}): Update call to 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.
This commit is contained in:
parent
9b64639572
commit
a394e3262f
|
@ -1,9 +1,11 @@
|
||||||
Thu Apr 10 14:44:56 1997 Doug Evans <dje@canuck.cygnus.com>
|
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_parse_{{,un}signed_integer,address}): Update call to
|
||||||
cgen_asm_parse_operand_fn.
|
cgen_parse_operand_fn.
|
||||||
* m32r-asm.c (parse_insn_normal): Delete call to cgen_asm_init_parse.
|
(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'.
|
(m32r_cgen_assemble_insn): New operand `errmsg'.
|
||||||
Delete call to as_bad, return error message to caller.
|
Delete call to as_bad, return error message to caller.
|
||||||
(m32r_cgen_asm_hash_keywords): #if 0 out.
|
(m32r_cgen_asm_hash_keywords): #if 0 out.
|
||||||
|
|
|
@ -32,8 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
#include "opcode/cgen.h"
|
#include "opcode/cgen.h"
|
||||||
|
|
||||||
/* Operand parsing callback. */
|
/* Operand parsing callback. */
|
||||||
const char * (*cgen_asm_parse_operand_fn)
|
const char * (*cgen_parse_operand_fn)
|
||||||
PARAMS ((const char **, int, int, enum cgen_asm_result *, bfd_vma *));
|
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
|
/* This is not published as part of the public interface so we don't
|
||||||
declare this in cgen.h. */
|
declare this in cgen.h. */
|
||||||
|
@ -42,6 +43,8 @@ extern CGEN_OPCODE_DATA *cgen_current_opcode_data;
|
||||||
/* Assembler instruction hash table. */
|
/* Assembler instruction hash table. */
|
||||||
static CGEN_INSN_LIST **asm_hash_table;
|
static CGEN_INSN_LIST **asm_hash_table;
|
||||||
|
|
||||||
|
/* Called once at startup and whenever machine/endian change. */
|
||||||
|
|
||||||
void
|
void
|
||||||
cgen_asm_init ()
|
cgen_asm_init ()
|
||||||
{
|
{
|
||||||
|
@ -52,6 +55,16 @@ 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. */
|
/* Build the assembler instruction hash table. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -177,11 +190,12 @@ cgen_parse_signed_integer (strp, opindex, min, max, valuep)
|
||||||
long *valuep;
|
long *valuep;
|
||||||
{
|
{
|
||||||
long value;
|
long value;
|
||||||
enum cgen_asm_result result;
|
enum cgen_parse_operand_result result;
|
||||||
const char *errmsg;
|
const char *errmsg;
|
||||||
|
|
||||||
errmsg = (*cgen_asm_parse_operand_fn) (strp, opindex, BFD_RELOC_NONE,
|
errmsg = (*cgen_parse_operand_fn) (CGEN_PARSE_OPERAND_INTEGER, strp,
|
||||||
&result, &value);
|
opindex, BFD_RELOC_NONE,
|
||||||
|
&result, &value);
|
||||||
/* FIXME: Examine `result'. */
|
/* FIXME: Examine `result'. */
|
||||||
if (!errmsg)
|
if (!errmsg)
|
||||||
{
|
{
|
||||||
|
@ -202,11 +216,12 @@ cgen_parse_unsigned_integer (strp, opindex, min, max, valuep)
|
||||||
unsigned long *valuep;
|
unsigned long *valuep;
|
||||||
{
|
{
|
||||||
unsigned long value;
|
unsigned long value;
|
||||||
enum cgen_asm_result result;
|
enum cgen_parse_operand_result result;
|
||||||
const char *errmsg;
|
const char *errmsg;
|
||||||
|
|
||||||
errmsg = (*cgen_asm_parse_operand_fn) (strp, opindex, BFD_RELOC_NONE,
|
errmsg = (*cgen_parse_operand_fn) (CGEN_PARSE_OPERAND_INTEGER, strp,
|
||||||
&result, &value);
|
opindex, BFD_RELOC_NONE,
|
||||||
|
&result, &value);
|
||||||
/* FIXME: Examine `result'. */
|
/* FIXME: Examine `result'. */
|
||||||
if (!errmsg)
|
if (!errmsg)
|
||||||
{
|
{
|
||||||
|
@ -227,11 +242,12 @@ cgen_parse_address (strp, opindex, opinfo, valuep)
|
||||||
long *valuep;
|
long *valuep;
|
||||||
{
|
{
|
||||||
long value;
|
long value;
|
||||||
enum cgen_asm_result result;
|
enum cgen_parse_operand_result result;
|
||||||
const char *errmsg;
|
const char *errmsg;
|
||||||
|
|
||||||
errmsg = (*cgen_asm_parse_operand_fn) (strp, opindex, opinfo,
|
errmsg = (*cgen_parse_operand_fn) (CGEN_PARSE_OPERAND_ADDRESS, strp,
|
||||||
&result, &value);
|
opindex, opinfo,
|
||||||
|
&result, &value);
|
||||||
/* FIXME: Examine `result'. */
|
/* FIXME: Examine `result'. */
|
||||||
if (!errmsg)
|
if (!errmsg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -551,6 +551,7 @@ parse_insn_normal (insn, strp, fields)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CGEN_INIT_PARSE ();
|
CGEN_INIT_PARSE ();
|
||||||
|
cgen_init_parse_operand ();
|
||||||
#ifdef CGEN_MNEMONIC_OPERANDS
|
#ifdef CGEN_MNEMONIC_OPERANDS
|
||||||
past_opcode_p = 0;
|
past_opcode_p = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue