]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: igen: clean up headers a bit
authorMike Frysinger <vapier@gentoo.org>
Wed, 3 Jan 2024 08:07:25 +0000 (03:07 -0500)
committerMike Frysinger <vapier@gentoo.org>
Wed, 3 Jan 2024 08:13:47 +0000 (03:13 -0500)
Add standard multiple inclusion protection, and add a few missing
local includes when one header uses another.  This isn't complete,
but fixes some short comings seen when merging the ppc igen.

17 files changed:
sim/igen/filter.h
sim/igen/filter_host.h
sim/igen/gen-engine.h
sim/igen/gen-icache.h
sim/igen/gen-idecode.h
sim/igen/gen-itable.h
sim/igen/gen-model.h
sim/igen/gen-semantics.h
sim/igen/gen-support.h
sim/igen/gen.h
sim/igen/igen.h
sim/igen/ld-cache.h
sim/igen/ld-decode.h
sim/igen/ld-insn.h
sim/igen/lf.h
sim/igen/misc.h
sim/igen/table.h

index dd674dde26ae2593b75777ed89b23d0fb01abbd8..b225731add0e9941620682247900a5f159c0c61a 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_FILTER_H
+#define IGEN_FILTER_H
+
+#include "lf.h"
 
 /* NB, an empty filter is NULL */
 typedef struct _filter filter;
@@ -68,3 +72,5 @@ const char *filter_next (const filter *set, const char *member);
 
 extern void dump_filter
   (lf *file, const char *prefix, const filter *filt, const char *suffix);
+
+#endif /* IGEN_FILTER_H */
index 104c21063d6288625ad46ae9132470ee39730d9e..b226a2111fa2d419ba1ef1d5913fd22921ba8c7f 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _FILTER_HOST_H
-#define _FILTER_HOST_H
+#ifndef IGEN_FILTER_HOST_H
+#define IGEN_FILTER_HOST_H
 
 /* Remove directory part from filename */
 extern const char *filter_filename (const char *filename);
-#endif
+
+#endif /* IGEN_FILTER_HOST_H */
index bb46bed147d93d6f68610ee2068ce16ea3314ee0..20f341526f467646e6b11ca71aeb562ec0c138d2 100644 (file)
@@ -19,6 +19,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_GEN_ENGINE_H
+#define IGEN_GEN_ENGINE_H
+
 extern void gen_engine_h
   (lf *file, const gen_table *gen, const insn_table *isa,
    cache_entry *cache_rules);
@@ -29,3 +32,5 @@ extern void gen_engine_c
 
 extern void print_engine_run_function_header
   (lf *file, const char *processor, function_decl_type decl_type);
+
+#endif /* IGEN_GEN_ENGINE_H */
index de8cdfe4307154f8778d355a6f6890431ce19a76..f5298e564939ea7e91005e74cc07cd36fd77aa07 100644 (file)
@@ -19,6 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_GEN_ICACHE_H
+#define IGEN_GEN_ICACHE_H
 
 /* Output code to manipulate the instruction cache: either create it
    or reference it */
@@ -79,3 +81,5 @@ extern void print_icache_struct
 
 
 /* Output a single instructions decoder */
+
+#endif /* IGEN_GEN_ICACHE_H */
index 63ae883d2192fa2d00444649c753e79071a0b689..05a7055644a97731dca80125cb763eccdc84aeab 100644 (file)
@@ -19,6 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_GEN_IDECODE_H
+#define IGEN_GEN_IDECODE_H
 
 void print_idecode_issue_function_header
   (lf *file,
@@ -45,3 +47,5 @@ extern void print_idecode_validate
   (lf *file,
    const insn_entry *instruction,
    const insn_opcodes *opcode_paths);
+
+#endif /* IGEN_GEN_IDECODE_H */
index 37d39fe84b8558bb96b5670a7b9e5ac2b86fd61b..2991d18390ba87cdde15e8688d51978e701d88fe 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-
+#ifndef IGEN_GEN_ITABLE_H
+#define IGEN_GEN_ITABLE_H
 
 /* Output a table of all the instructions */
 
 extern void gen_itable_h (lf *file, const insn_table *table);
 
 extern void gen_itable_c (lf *file, const insn_table *table);
+
+#endif /* IGEN_GEN_ITABLE_H */
index 5af5d9182625e9373188cc106f097bef0aefe7c8..2fdea67d4dc6b5250277187fcfabfacb8d5585f3 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-
+#ifndef IGEN_GEN_MODEL_H
+#define IGEN_GEN_MODEL_H
 
 extern void gen_model_h (lf *file, const insn_table *isa);
 
 extern void gen_model_c (lf *file, const insn_table *isa);
+
+#endif /* IGEN_GEN_MODEL_H */
index 115251b2287aebe1021f68def456b557913895aa..daf5fc8ca2f9d731ef98bb99d62bbd1ccaf6b6dd 100644 (file)
@@ -19,6 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_GEN_SEMANTICS_H
+#define IGEN_GEN_SEMANTICS_H
 
 /* Creates the files semantics.[hc].
 
@@ -102,3 +104,5 @@ extern void print_semantic_body
    const insn_entry *instruction,
    const opcode_bits *expanded_bits,
    const insn_opcodes *opcodes);
+
+#endif /* IGEN_GEN_SEMANTICS_H */
index fac231ed96fe58edb67219d5dafade0f1f31150c..c22a89565237d198821be5aad6921bb98a86f43f 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_GEN_SUPPORT_H
+#define IGEN_GEN_SUPPORT_H
 
 extern void gen_support_h (lf *file, const insn_table *table);
 
 extern void gen_support_c (lf *file, const insn_table *table);
+
+#endif /* IGEN_GEN_SUPPORT_H */
index 53225bc842986d3a437fc39b342772eed8fae10e..f6a77cf80a1a5e4f682f2496b577c02be4738a73 100644 (file)
@@ -19,6 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_GEN_H
+#define IGEN_GEN_H
 
 typedef struct _opcode_field opcode_field;
 struct _opcode_field
@@ -214,3 +216,5 @@ extern void print_sim_engine_abort (lf *file, const char *message);
 extern void print_include (lf *file, igen_module module);
 extern void print_include_inline (lf *file, igen_module module);
 extern void print_includes (lf *file);
+
+#endif /* IGEN_GEN_H */
index eb5c755aeda6b35f59e18266ffba1bd9790466dc..cc3edac5a761bbd1fdefa0a65f0f056a316e1cf6 100644 (file)
@@ -19,6 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_IGEN_H
+#define IGEN_IGEN_H
 
 /* code-generation options: */
 
@@ -249,3 +251,5 @@ do { \
   options.gen.icache_size = 1024; \
   options.warning = warning; \
 } while (0)
+
+#endif /* IGEN_IGEN_H */
index 47bf9d60dae3498f54923144f2f63f860094d64f..a7351cd765ddd649cbc3c11461c71efe12e5fdd5 100644 (file)
@@ -19,7 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-
+#ifndef IGEN_LD_CACHE_H
+#define IGEN_LD_CACHE_H
 
 /* For backward compatibility only - load a standalone cache macro table */
 
@@ -64,3 +65,5 @@
 
 
 extern cache_entry *load_cache_table (const char *file_name);
+
+#endif /* IGEN_LD_CACHE_H */
index 739e09e5d9e65f12b6952fb74e740a92e4411ef4..660f3a7ccd1a41eed40385469c0f282603754142 100644 (file)
@@ -19,6 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_LD_DECODE_H
+#define IGEN_LD_DECODE_H
 
 /* Instruction decode table:
 
@@ -242,3 +244,5 @@ extern int decode_table_max_word_nr (const decode_table *rule);
 
 extern void dump_decode_rule
   (lf *file, const char *prefix, const decode_table *rule, const char *suffix);
+
+#endif /* IGEN_LD_DECODE_H */
index d22b855e1ce1d6e0d4c1b18c374bcaea1eb2922d..661cd40a0e850a084da38efc157042f6e8733ccf 100644 (file)
@@ -19,7 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-
+#ifndef IGEN_LD_INSN_H
+#define IGEN_LD_INSN_H
 
 typedef uint64_t insn_uint;
 
@@ -705,3 +706,5 @@ void dump_cache_entries
 
 void dump_insn_table
   (lf *file, const char *prefix, const insn_table *isa, const char *suffix);
+
+#endif /* IGEN_LD_INSN_H */
index d1e2acca548029fe549d93d0ac0b49832d8cef23..cea86d63db13f9cd34cb460dfcf74ab80352b11f 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_LF_H
+#define IGEN_LF_H
+
 #include "ansidecl.h"
+#include "misc.h"
 
 /* LF: Line Numbered Output Stream */
 
@@ -115,3 +119,5 @@ extern int lf_print__function_type_function
   (lf *file,
    print_function * print_type,
    const char *prefix, const char *trailing_space);
+
+#endif /* IGEN_LF_H */
index 45610558a262a08944e96c503664bc9af854b2ca..04a7f720b41de5cd4b98199b59e7367e472fd0a0 100644 (file)
@@ -19,7 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-
+#ifndef IGEN_MISC_H
+#define IGEN_MISC_H
 
 /* Frustrating header junk */
 
@@ -102,3 +103,5 @@ name_map;
 extern int name2i (const char *name, const name_map * map);
 
 extern const char *i2name (const int i, const name_map * map);
+
+#endif /* IGEN_MISC_H */
index e6f318b4e36a6305ffcc713baee3254b68b760e7..13429707f2e214f01434a9b2de7579d9e773f0a3 100644 (file)
@@ -19,6 +19,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef IGEN_TABLE_H
+#define IGEN_TABLE_H
 
 /* Read a table, line by line, from a file.
 
@@ -138,3 +140,5 @@ extern char *skip_spaces (char *chp);
 extern char *skip_to_separator (char *chp, char *separators);
 
 extern char *back_spaces (char *start, char *chp);
+
+#endif /* IGEN_TABLE_H */