sim: constify sim_write source buffer (part 2)
[deliverable/binutils-gdb.git] / sim / ppc / ld-decode.c
index e83445f527c0be4a858088c8a9f02f1b6d3b90a2..3964960af267820f4444cea0c948f9c8d0fc2fc9 100644 (file)
@@ -1,6 +1,6 @@
 /*  This file is part of the program psim.
 
-    Copyright (C) 1994,1995,1996, Andrew Cagney <cagney@highland.com.au>
+    Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -64,6 +64,15 @@ static const name_map decode_slash_map[] = {
 };
 
 
+static decode_gen_type overriding_gen_type = invalid_gen;
+
+void
+force_decode_gen_type(const char *type)
+{
+  overriding_gen_type = name2i(type, decode_gen_map);
+}
+
+
 decode_table *
 load_decode_table(char *file_name,
                  int hi_bit_nr)
@@ -75,7 +84,9 @@ load_decode_table(char *file_name,
   while ((entry = table_entry_read(file)) != NULL) {
     decode_table *new_rule = ZALLOC(decode_table);
     new_rule->type = name2i(entry->fields[op_options], decode_type_map);
-    new_rule->gen = name2i(entry->fields[op_options], decode_gen_map);
+    new_rule->gen = (overriding_gen_type != invalid_gen
+                    ? overriding_gen_type
+                    : name2i(entry->fields[op_options], decode_gen_map));
     new_rule->force_slash = name2i(entry->fields[op_options], decode_slash_map);
     new_rule->first = target_a2i(hi_bit_nr, entry->fields[op_first]);
     new_rule->last = target_a2i(hi_bit_nr, entry->fields[op_last]);
This page took 0.027657 seconds and 4 git commands to generate.