From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2161) id D173A3858D35; Thu, 19 Jan 2023 00:06:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D173A3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674086813; bh=/mnQIl17K9yPnWBVjYXt4KEjYEKLqZFU14nmYGixt6I=; h=From:To:Subject:Date:From; b=BYgpCUvOwSQ2QwfWT4pLwX3YSdupGosW/GGusc8KAKsnB5g2jL2a6xJgNV/NSMyKq WKKg4jVJukARCeIK3LueMFDZpoHXTBJGF2k+ubQGJKTKJheN7Y2wZXtyPE9ZqncNfl Npdjh+vYuwL/rXmnmMW9Gq/nOsDwvCyznhLvnUVU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Mark Wielaard To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim: mn10300: minimize mn10300-sim.h include in sim-main.h X-Act-Checkin: binutils-gdb X-Git-Author: Mark Wielaard X-Git-Refname: refs/heads/master X-Git-Oldrev: a184bce8040a9b71e36193905b830ed259a4d478 X-Git-Newrev: c064fab247691180b7bc317d44a9bcbf53a11ee7 Message-Id: <20230119000653.D173A3858D35@sourceware.org> Date: Thu, 19 Jan 2023 00:06:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dc064fab24769= 1180b7bc317d44a9bcbf53a11ee7 commit c064fab247691180b7bc317d44a9bcbf53a11ee7 Author: Mark Wielaard Date: Sun Jan 15 20:24:06 2023 +0100 sim: mn10300: minimize mn10300-sim.h include in sim-main.h =20 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. =20 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. Diff: --- sim/mn10300/dv-mn103cpu.c | 4 ++++ sim/mn10300/interp.c | 3 +++ sim/mn10300/op_utils.c | 2 ++ sim/mn10300/sim-main.h | 8 ++++++++ 4 files changed, 17 insertions(+) diff --git a/sim/mn10300/dv-mn103cpu.c b/sim/mn10300/dv-mn103cpu.c index ad8669d3efa..55bbe253a63 100644 --- a/sim/mn10300/dv-mn103cpu.c +++ b/sim/mn10300/dv-mn103cpu.c @@ -22,8 +22,12 @@ #include "defs.h" =20 #include "sim-main.h" +#include "sim-fpu.h" +#include "sim-signal.h" #include "hw-main.h" =20 +#include "mn10300-sim.h" + /* DEVICE =20 =20 diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c index 07c3b8c900f..91b742c7276 100644 --- a/sim/mn10300/interp.c +++ b/sim/mn10300/interp.c @@ -7,8 +7,11 @@ =20 #include "bfd.h" #include "sim-assert.h" +#include "sim-fpu.h" #include "sim-signal.h" =20 +#include "mn10300-sim.h" + #include #include =20 diff --git a/sim/mn10300/op_utils.c b/sim/mn10300/op_utils.c index 7e035f43259..5425537dc1d 100644 --- a/sim/mn10300/op_utils.c +++ b/sim/mn10300/op_utils.c @@ -11,9 +11,11 @@ #include "sim/callback.h" =20 #include "sim-main.h" +#include "sim-fpu.h" #include "sim-signal.h" #include "sim-syscall.h" =20 +#include "mn10300-sim.h" =20 #define REG0(X) ((X) & 0x3) #define REG1(X) (((X) & 0xc) >> 2) diff --git a/sim/mn10300/sim-main.h b/sim/mn10300/sim-main.h index 2187e794adb..d08b13dc531 100644 --- a/sim/mn10300/sim-main.h +++ b/sim/mn10300/sim-main.h @@ -34,11 +34,19 @@ mn10300_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYT= ES), (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" =20 #include "mn10300-sim.h" +#endif =20 extern SIM_CORE_SIGNAL_FN mn10300_core_signal;