aboutsummaryrefslogtreecommitdiff
path: root/sim/igen/ld-insn.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-10-27 06:30:35 +0000
committerAndrew Cagney <cagney@redhat.com>1997-10-27 06:30:35 +0000
commite2880fadf387be9b6206a6fa174f069cd64a8a38 (patch)
tree969a3b0b015ab8273cd4515e23b596e4db584bf1 /sim/igen/ld-insn.c
parentf45dd42b32b0ea4b3eb27c180e64805b9fb548c6 (diff)
downloadgdb-e2880fadf387be9b6206a6fa174f069cd64a8a38.zip
gdb-e2880fadf387be9b6206a6fa174f069cd64a8a38.tar.gz
gdb-e2880fadf387be9b6206a6fa174f069cd64a8a38.tar.bz2
Add include-file support to igen.
Diffstat (limited to 'sim/igen/ld-insn.c')
-rw-r--r--sim/igen/ld-insn.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/sim/igen/ld-insn.c b/sim/igen/ld-insn.c
index eaa7eca..c5c3679 100644
--- a/sim/igen/ld-insn.c
+++ b/sim/igen/ld-insn.c
@@ -374,6 +374,7 @@ typedef enum {
function_record,
internal_record,
define_record,
+ include_record,
model_processor_record,
model_macro_record,
model_data_record,
@@ -388,6 +389,7 @@ static const name_map insn_type_map[] = {
{ "compute", compute_record },
{ "scratch", scratch_record },
{ "define", define_record },
+ { "include", include_record },
{ "%s", string_function_record },
{ "function", function_record },
{ "internal", internal_record },
@@ -744,6 +746,17 @@ load_insn_table (char *file_name,
switch (record_type (record))
{
+ case include_record:
+ {
+ if (record->nr_fields < nr_include_record_fields)
+ error (record->line,
+ "Incorrect nr of fields for include record\n");
+ table_push (file, record->line, options.include,
+ record->field[include_record_filename_field]);
+ record = table_read (file);
+ break;
+ }
+
case option_record:
{
if (isa->insns != NULL)
@@ -757,7 +770,7 @@ load_insn_table (char *file_name,
/* convert a string function field into an internal function field */
char *name;
if (record->nr_fields < nr_function_fields)
- error (record->line, "Incorrect nr of fields for %s record\n");
+ error (record->line, "Incorrect nr of fields for %%s record\n");
name = NZALLOC (char,
(strlen ("str_")
+ strlen (record->field[function_name_field])
@@ -1017,8 +1030,12 @@ load_insn_table (char *file_name,
break;
}
- default:
- error (record->line, "Unknown entry\n");
+ case unknown_record:
+ case define_record:
+ case code_record:
+ error (record->line, "Unknown or unexpected entry\n");
+
+
}
}
return isa;