]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: mn10300: minimize mn10300-sim.h include in sim-main.h
authorMark Wielaard <mark@klomp.org>
Sun, 15 Jan 2023 19:24:06 +0000 (20:24 +0100)
committerMark Wielaard <mark@klomp.org>
Thu, 19 Jan 2023 00:05:00 +0000 (01:05 +0100)
sim-main.h is special since it is one of the files automatically
included in igen generated files. But this means anything including
sim-main.h might get everything included just for the igen files.

To prevent clashing symbols/defines only include sim-fpu.h,
sim-signal.h, mn10300-sim.h from sim-main.h if it is included
from one of the generated igen C files. Add explicit includes
of mn10300-sim.h, sim-fpu.h and/or sim-signal.h to dv-mn103cpu.c,
interp.c and op_utils.c.

sim/mn10300/dv-mn103cpu.c
sim/mn10300/interp.c
sim/mn10300/op_utils.c
sim/mn10300/sim-main.h

index ad8669d3efa1c6b73a3996276d4c3fd2c404911a..55bbe253a63cc15af059cdeaed9f931ab06fc110 100644 (file)
 #include "defs.h"
 
 #include "sim-main.h"
+#include "sim-fpu.h"
+#include "sim-signal.h"
 #include "hw-main.h"
 
+#include "mn10300-sim.h"
+
 /* DEVICE
 
    
index 07c3b8c900fbaf8eea4ce9bf8d1c05ff16099f98..91b742c72766232cd74a089f988de22556048994 100644 (file)
@@ -7,8 +7,11 @@
 
 #include "bfd.h"
 #include "sim-assert.h"
+#include "sim-fpu.h"
 #include "sim-signal.h"
 
+#include "mn10300-sim.h"
+
 #include <stdlib.h>
 #include <string.h>
 
index 7e035f432590d2faa9558e89d463d2cd72f9ddfa..5425537dc1def519c09ad1f6a39c8dc9eb2fd0c5 100644 (file)
 #include "sim/callback.h"
 
 #include "sim-main.h"
+#include "sim-fpu.h"
 #include "sim-signal.h"
 #include "sim-syscall.h"
 
+#include "mn10300-sim.h"
 
 #define REG0(X) ((X) & 0x3)
 #define REG1(X) (((X) & 0xc) >> 2)
index 2187e794adb8dbae120f3710ad0d552f2315a337..d08b13dc531566b2f05249511967c666612f6703 100644 (file)
@@ -34,11 +34,19 @@ mn10300_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER),
 /**
  * TODO: Move these includes to the igen files that need them.
  * This requires extending the igen syntax to support header includes.
+ *
+ * For now only include them in the igen generated support.c,
+ * semantics.c, idecode.c and engine.c files.
  */
+#if defined(SUPPORT_C) \
+    || defined(SEMANTICS_C) \
+    || defined(IDECODE_C) \
+    || defined(ENGINE_C)
 #include "sim-fpu.h"
 #include "sim-signal.h"
 
 #include "mn10300-sim.h"
+#endif
 
 extern SIM_CORE_SIGNAL_FN mn10300_core_signal;