From: Mike Frysinger Date: Sun, 5 Dec 2021 02:09:23 +0000 (-0500) Subject: sim: include ansidecl.h when needed X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=843bf75416dd11d91a5d617f7a49f6e9e5025b42;p=binutils-gdb.git sim: include ansidecl.h when needed Avoid implicit include deps with this to help untangle sim headers so we can get rid of arch-specific sim-main.h. --- diff --git a/sim/common/cgen-trace.h b/sim/common/cgen-trace.h index c617e7e21e1..96048b906e2 100644 --- a/sim/common/cgen-trace.h +++ b/sim/common/cgen-trace.h @@ -20,6 +20,8 @@ along with this program. If not, see . */ #ifndef CGEN_TRACE_H #define CGEN_TRACE_H +#include "ansidecl.h" + void cgen_trace_insn_init (SIM_CPU *, int); void cgen_trace_insn_fini (SIM_CPU *, const struct argbuf *, int); void cgen_trace_insn (SIM_CPU *, const struct cgen_insn *, diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh index e1eb08c1bdf..63e01ec4d98 100755 --- a/sim/common/genmloop.sh +++ b/sim/common/genmloop.sh @@ -312,6 +312,7 @@ cat << EOF #define WANT_CPU @cpu@ #define WANT_CPU_@CPU@ +#include "ansidecl.h" #include "bfd.h" #include "sim-main.h" diff --git a/sim/common/hw-device.h b/sim/common/hw-device.h index a7e598bb40e..711001d13c9 100644 --- a/sim/common/hw-device.h +++ b/sim/common/hw-device.h @@ -25,6 +25,8 @@ #include +#include "ansidecl.h" + /* Introduction: As explained in earlier sections, the device, device instance, diff --git a/sim/common/hw-events.h b/sim/common/hw-events.h index 7d750007c09..0b55542ad32 100644 --- a/sim/common/hw-events.h +++ b/sim/common/hw-events.h @@ -22,6 +22,8 @@ along with this program. If not, see . */ #include +#include "ansidecl.h" + /* Event manager customized for hardware models. This interface is discussed further in sim-events.h. */ diff --git a/sim/common/hw-tree.h b/sim/common/hw-tree.h index 2f717ec8d9f..07a95b4177d 100644 --- a/sim/common/hw-tree.h +++ b/sim/common/hw-tree.h @@ -25,6 +25,8 @@ #include +#include "ansidecl.h" + struct hw *hw_tree_create (SIM_DESC sd, const char *device); diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h index f09a4f26720..62d47e41726 100644 --- a/sim/common/sim-basics.h +++ b/sim/common/sim-basics.h @@ -111,7 +111,6 @@ typedef enum { /* Basic definitions - ordered so that nothing calls what comes after it. */ -#include "ansidecl.h" #include "sim/sim.h" #include "sim-config.h" diff --git a/sim/common/sim-engine.h b/sim/common/sim-engine.h index 159d96bf119..4d77856ef7e 100644 --- a/sim/common/sim-engine.h +++ b/sim/common/sim-engine.h @@ -22,6 +22,8 @@ along with this program. If not, see . */ #include +#include "ansidecl.h" + typedef struct _sim_engine sim_engine; struct _sim_engine { diff --git a/sim/common/sim-events.h b/sim/common/sim-events.h index 3c30d6489f8..b102a959ede 100644 --- a/sim/common/sim-events.h +++ b/sim/common/sim-events.h @@ -25,6 +25,8 @@ #include +#include "ansidecl.h" + /* Notes: When scheduling an event, the a delta of zero/one refers to the diff --git a/sim/common/sim-hw.h b/sim/common/sim-hw.h index 71dc8378b1d..0207aa3e5fc 100644 --- a/sim/common/sim-hw.h +++ b/sim/common/sim-hw.h @@ -22,6 +22,8 @@ along with this program. If not, see . */ #include +#include "ansidecl.h" + /* Parse a hardware definition */ struct hw *sim_hw_parse diff --git a/sim/common/sim-inline.h b/sim/common/sim-inline.h index a397e58e10f..216f30d2b63 100644 --- a/sim/common/sim-inline.h +++ b/sim/common/sim-inline.h @@ -23,6 +23,7 @@ #ifndef SIM_INLINE_H #define SIM_INLINE_H +#include "ansidecl.h" /* INLINE CODE SELECTION: diff --git a/sim/common/sim-io.h b/sim/common/sim-io.h index 2fc22f332cc..c77b4f8189d 100644 --- a/sim/common/sim-io.h +++ b/sim/common/sim-io.h @@ -28,6 +28,8 @@ #include #include +#include "ansidecl.h" + /* See the file include/callbacks.h for a description */ int sim_io_init (SIM_DESC sd); diff --git a/sim/common/sim-profile.c b/sim/common/sim-profile.c index 393a0b733ed..f4cdf40b05b 100644 --- a/sim/common/sim-profile.c +++ b/sim/common/sim-profile.c @@ -25,6 +25,8 @@ along with this program. If not, see . */ #include #include +#include "ansidecl.h" + #include "sim-main.h" #include "sim-io.h" #include "sim-options.h" diff --git a/sim/common/sim-syscall.c b/sim/common/sim-syscall.c index 1e83db2ae8a..26f57f431bf 100644 --- a/sim/common/sim-syscall.c +++ b/sim/common/sim-syscall.c @@ -22,6 +22,8 @@ #include +#include "ansidecl.h" + #include "sim-main.h" #include "sim-syscall.h" #include "sim/callback.h" diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c index fbfa27fac6f..15816100d56 100644 --- a/sim/common/sim-trace.c +++ b/sim/common/sim-trace.c @@ -24,6 +24,7 @@ along with this program. If not, see . */ #include #include +#include "ansidecl.h" #include "bfd.h" #include "dis-asm.h" #include "libiberty.h" diff --git a/sim/common/sim-trace.h b/sim/common/sim-trace.h index f17bbc63420..09e900c9f57 100644 --- a/sim/common/sim-trace.h +++ b/sim/common/sim-trace.h @@ -24,6 +24,7 @@ along with this program. If not, see . */ #include +#include "ansidecl.h" #include "dis-asm.h" /* Standard traceable entities. */ diff --git a/sim/common/sim-utils.h b/sim/common/sim-utils.h index 1af4ea206b8..20ca9fcfe23 100644 --- a/sim/common/sim-utils.h +++ b/sim/common/sim-utils.h @@ -20,6 +20,8 @@ along with this program. If not, see . */ #ifndef SIM_UTILS_H #define SIM_UTILS_H +#include "ansidecl.h" + /* Memory management with an allocator that clears memory before use. */ void *zalloc (unsigned long size);