From 20a8e078cc573f85f7262f7b87be3cf8e8a6424f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 4 Dec 2021 20:24:55 -0500 Subject: [PATCH] sim: reorder header includes We're including system headers after local headers in a bunch of places, but this leads to conflicts when our local headers happen to define symbols that show up in the system headers. Use the more standard order of: * config.h (via defs.h) * system headers * local library headers (e.g. bfd & libiberty) * sim specific headers --- include/sim/callback.h | 5 +++-- sim/common/callback.c | 23 ++++++++++++----------- sim/common/cgen-par.c | 3 ++- sim/common/cgen-scache.c | 4 +++- sim/common/cgen-trace.c | 4 +++- sim/common/cgen-utils.c | 3 ++- sim/common/dv-cfi.c | 2 +- sim/common/dv-glue.c | 4 ++-- sim/common/dv-pal.c | 12 ++++++------ sim/common/dv-sockser.c | 17 ++++++++--------- sim/common/genmloop.sh | 3 ++- sim/common/hw-alloc.c | 4 ++-- sim/common/hw-base.c | 9 ++++----- sim/common/hw-device.c | 6 +++--- sim/common/hw-events.c | 9 +++++---- sim/common/hw-handles.c | 4 ++-- sim/common/hw-ports.c | 7 +++---- sim/common/hw-properties.c | 4 ++-- sim/common/hw-tree.c | 8 ++++---- sim/common/nrun.c | 15 +++++++-------- sim/common/sim-arange.c | 7 ++++--- sim/common/sim-assert.h | 4 ++-- sim/common/sim-basics.h | 2 +- sim/common/sim-config.c | 3 ++- sim/common/sim-core.c | 7 ++++--- sim/common/sim-cpu.c | 3 ++- sim/common/sim-engine.c | 6 +++--- sim/common/sim-events.c | 11 ++++++----- sim/common/sim-fpu.c | 4 ++-- sim/common/sim-hload.c | 3 ++- sim/common/sim-hw.c | 11 +++++------ sim/common/sim-io.c | 10 ++++------ sim/common/sim-io.h | 6 +++--- sim/common/sim-load.c | 4 ++-- sim/common/sim-memopt.c | 18 +++++++++--------- sim/common/sim-model.c | 5 +++-- sim/common/sim-module.c | 8 ++++---- sim/common/sim-options.c | 15 ++++++++------- sim/common/sim-profile.c | 8 ++++---- sim/common/sim-reason.c | 4 ++-- sim/common/sim-signal.c | 1 + sim/common/sim-trace.c | 18 ++++++++---------- sim/common/sim-utils.c | 8 ++++---- sim/common/sim-watch.c | 14 +++++++------- sim/common/syscall.c | 14 ++++++++------ 45 files changed, 176 insertions(+), 164 deletions(-) diff --git a/include/sim/callback.h b/include/sim/callback.h index a51c4de9c3a..a6eb38ffd4e 100644 --- a/include/sim/callback.h +++ b/include/sim/callback.h @@ -45,11 +45,12 @@ #ifndef SIM_CALLBACK_H #define SIM_CALLBACK_H -#include #include #include + +#include /* Needed for enum bfd_endian. */ -#include "bfd.h" +#include /* Mapping of host/target values. */ /* ??? For debugging purposes, one might want to add a string of the diff --git a/sim/common/callback.c b/sim/common/callback.c index a5f0fbe4355..105488db262 100644 --- a/sim/common/callback.c +++ b/sim/common/callback.c @@ -23,26 +23,27 @@ /* This must come before any other includes. */ #include "defs.h" -#include "ansidecl.h" +#include +#include +/* For PIPE_BUF. */ +#include +#include #include #include #include #include -/* For PIPE_BUF. */ -#include -#include -#include -#include #include -#include +#ifdef HAVE_UNISTD_H +#include +#endif #include -#include "sim/callback.h" +#include + +#include "ansidecl.h" /* For xmalloc. */ #include "libiberty.h" -#ifdef HAVE_UNISTD_H -#include -#endif +#include "sim/callback.h" #ifndef PIPE_BUF #define PIPE_BUF 512 diff --git a/sim/common/cgen-par.c b/sim/common/cgen-par.c index b535edfdaec..24642291dfb 100644 --- a/sim/common/cgen-par.c +++ b/sim/common/cgen-par.c @@ -20,8 +20,9 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" -#include "sim-main.h" #include + +#include "sim-main.h" #include "cgen-mem.h" #include "cgen-par.h" diff --git a/sim/common/cgen-scache.c b/sim/common/cgen-scache.c index c14d5d22c6d..fd4f1f9eb00 100644 --- a/sim/common/cgen-scache.c +++ b/sim/common/cgen-scache.c @@ -22,9 +22,11 @@ along with this program. If not, see . */ #define SCACHE_DEFINE_INLINE -#include "sim-main.h" #include + #include "libiberty.h" + +#include "sim-main.h" #include "sim-options.h" #include "sim-io.h" diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c index f5483fd39ea..f372c471d34 100644 --- a/sim/common/cgen-trace.c +++ b/sim/common/cgen-trace.c @@ -22,9 +22,11 @@ along with this program. If not, see . */ #include #include + +#include "bfd.h" #include "diagnostics.h" #include "dis-asm.h" -#include "bfd.h" + #include "sim-main.h" #include "sim-fpu.h" #include "sim/callback.h" diff --git a/sim/common/cgen-utils.c b/sim/common/cgen-utils.c index d9c3ea9aa80..cae21fff5ea 100644 --- a/sim/common/cgen-utils.c +++ b/sim/common/cgen-utils.c @@ -21,9 +21,10 @@ along with this program. If not, see . */ #include "defs.h" #include "bfd.h" +#include "dis-asm.h" + #include "sim-main.h" #include "sim-signal.h" -#include "dis-asm.h" #define MEMOPS_DEFINE_INLINE #include "cgen-mem.h" diff --git a/sim/common/dv-cfi.c b/sim/common/dv-cfi.c index 02a2cedd558..f719ca44385 100644 --- a/sim/common/dv-cfi.c +++ b/sim/common/dv-cfi.c @@ -25,9 +25,9 @@ /* This must come before any other includes. */ #include "defs.h" -#include #include #include +#include #include #include #ifdef HAVE_SYS_MMAN_H diff --git a/sim/common/dv-glue.c b/sim/common/dv-glue.c index 7c8e1f877af..4f2bbf5c308 100644 --- a/sim/common/dv-glue.c +++ b/sim/common/dv-glue.c @@ -22,10 +22,10 @@ /* This must come before any other includes. */ #include "defs.h" -#include "hw-main.h" - #include +#include "hw-main.h" + /* DEVICE diff --git a/sim/common/dv-pal.c b/sim/common/dv-pal.c index c60f524ea8e..3f6a95e47e2 100644 --- a/sim/common/dv-pal.c +++ b/sim/common/dv-pal.c @@ -22,6 +22,12 @@ /* This must come before any other includes. */ #include "defs.h" +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + #include "sim-main.h" #include "hw-main.h" #include "sim-io.h" @@ -30,12 +36,6 @@ its immediate domain */ #include "hw-tree.h" -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include - /* DEVICE diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c index 477e8f681af..69338f9c660 100644 --- a/sim/common/dv-sockser.c +++ b/sim/common/dv-sockser.c @@ -21,24 +21,23 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" -#include -#include -#include +#include #ifdef HAVE_FCNTL_H #include #endif +#include +#include +#include +#include #ifdef HAVE_UNISTD_H #include #endif - -#include -#include -#include -#include #include -#include +#include #include #include +#include +#include #include "sim-main.h" #include "sim-assert.h" diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh index b8a0f435a09..e1eb08c1bdf 100755 --- a/sim/common/genmloop.sh +++ b/sim/common/genmloop.sh @@ -312,8 +312,9 @@ cat << EOF #define WANT_CPU @cpu@ #define WANT_CPU_@CPU@ -#include "sim-main.h" #include "bfd.h" + +#include "sim-main.h" #include "cgen-mem.h" #include "cgen-ops.h" #include "sim-assert.h" diff --git a/sim/common/hw-alloc.c b/sim/common/hw-alloc.c index a16666b931a..b3633da4858 100644 --- a/sim/common/hw-alloc.c +++ b/sim/common/hw-alloc.c @@ -20,11 +20,11 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include + #include "hw-main.h" #include "hw-base.h" -#include - struct hw_alloc_data { void *alloc; diff --git a/sim/common/hw-base.c b/sim/common/hw-base.c index dee9359a7b5..238d3fea109 100644 --- a/sim/common/hw-base.c +++ b/sim/common/hw-base.c @@ -22,13 +22,12 @@ /* This must come before any other includes. */ #include "defs.h" -#include "hw-main.h" -#include "hw-base.h" - -#include -#include #include +#include +#include +#include "hw-main.h" +#include "hw-base.h" #include "hw-config.h" struct hw_base_data diff --git a/sim/common/hw-device.c b/sim/common/hw-device.c index 9b743ead1f2..b30eede5e3b 100644 --- a/sim/common/hw-device.c +++ b/sim/common/hw-device.c @@ -22,12 +22,12 @@ /* This must come before any other includes. */ #include "defs.h" -#include "hw-main.h" -#include "hw-base.h" - #include #include +#include "hw-main.h" +#include "hw-base.h" + /* Address methods */ const hw_unit * diff --git a/sim/common/hw-events.c b/sim/common/hw-events.c index 620b47d5255..301f868ce2e 100644 --- a/sim/common/hw-events.c +++ b/sim/common/hw-events.c @@ -20,13 +20,13 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include + #include "hw-main.h" #include "hw-base.h" #include "sim-events.h" -#include - /* The hw-events object is implemented using sim-events */ struct hw_event @@ -179,10 +179,11 @@ hw_event_remain_time (struct hw *me, struct hw_event *event) Build with `make test-hw-events' in sim/ directory*/ #if defined (MAIN) -#include "sim-main.h" -#include #include #include +#include + +#include "sim-main.h" static void test_handler (struct hw *me, diff --git a/sim/common/hw-handles.c b/sim/common/hw-handles.c index fb878e49277..62b3ca38acb 100644 --- a/sim/common/hw-handles.c +++ b/sim/common/hw-handles.c @@ -22,11 +22,11 @@ /* This must come before any other includes. */ #include "defs.h" +#include + #include "hw-main.h" #include "hw-base.h" -#include - struct hw_handle_mapping { cell_word external; diff --git a/sim/common/hw-ports.c b/sim/common/hw-ports.c index fbc7278ddd1..6029814ee72 100644 --- a/sim/common/hw-ports.c +++ b/sim/common/hw-ports.c @@ -20,13 +20,12 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" -#include "hw-main.h" -#include "hw-base.h" - +#include #include #include -#include +#include "hw-main.h" +#include "hw-base.h" struct hw_port_edge { diff --git a/sim/common/hw-properties.c b/sim/common/hw-properties.c index 3836aa73527..f608ba94323 100644 --- a/sim/common/hw-properties.c +++ b/sim/common/hw-properties.c @@ -22,14 +22,14 @@ /* This must come before any other includes. */ #include "defs.h" +#include + #include "hw-main.h" #include "hw-base.h" #include "sim-io.h" #include "sim-assert.h" -#include - /* property entries */ struct hw_property_data diff --git a/sim/common/hw-tree.c b/sim/common/hw-tree.c index 1bf4edab746..2e441cec98b 100644 --- a/sim/common/hw-tree.c +++ b/sim/common/hw-tree.c @@ -22,6 +22,10 @@ /* This must come before any other includes. */ #include "defs.h" +#include +#include +#include + #include "hw-main.h" #include "hw-base.h" #include "hw-tree.h" @@ -29,10 +33,6 @@ #include "sim-io.h" #include "sim-assert.h" -#include -#include -#include - /* manipulate/lookup device names */ typedef struct _name_specifier diff --git a/sim/common/nrun.c b/sim/common/nrun.c index 557a060e569..2985bda08a2 100644 --- a/sim/common/nrun.c +++ b/sim/common/nrun.c @@ -21,24 +21,23 @@ along with this program. If not, see . */ #include /* For strsignal. */ #include +#ifdef HAVE_UNISTD_H +/* For chdir. */ +#include +#endif + +#include "bfd.h" +#include "environ.h" #include "sim-main.h" #include "sim-signal.h" #include "sim/callback.h" -#include "bfd.h" -#include "environ.h" - #ifndef HAVE_STRSIGNAL /* While libiberty provides a fallback, it doesn't provide a prototype. */ extern const char *strsignal (int); #endif -#ifdef HAVE_UNISTD_H -/* For chdir. */ -#include -#endif - static void usage (void); extern host_callback default_callback; diff --git a/sim/common/sim-arange.c b/sim/common/sim-arange.c index 5a28a2c0c49..96b1af3e6cd 100644 --- a/sim/common/sim-arange.c +++ b/sim/common/sim-arange.c @@ -23,13 +23,14 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include +#include + #include "libiberty.h" + #include "sim-basics.h" #include "sim-arange.h" -#include -#include - /* Insert a range. */ static void diff --git a/sim/common/sim-assert.h b/sim/common/sim-assert.h index c6b877bc910..43b0b9dc33a 100644 --- a/sim/common/sim-assert.h +++ b/sim/common/sim-assert.h @@ -21,6 +21,8 @@ #ifndef SIM_ASSERT_H #define SIM_ASSERT_H +#include "libiberty.h" + /* The subtle difference between SIM_ASSERT and ASSERT is that SIM_ASSERT passes `sd' to sim_io_error for the SIM_DESC, ASSERT passes NULL. */ @@ -28,7 +30,6 @@ #if !defined (SIM_ASSERT) #if defined (WITH_ASSERT) #include "sim-io.h" -#include "libiberty.h" #define SIM_ASSERT(EXPRESSION) \ do \ { \ @@ -51,7 +52,6 @@ while (0) #if !defined (ASSERT) #if defined (WITH_ASSERT) #include "sim-io.h" -#include "libiberty.h" #define ASSERT(EXPRESSION) \ do \ { \ diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h index 32995a870d1..f09a4f26720 100644 --- a/sim/common/sim-basics.h +++ b/sim/common/sim-basics.h @@ -31,9 +31,9 @@ /* Basic host dependant mess - hopefully + will bring potential conflicts out in the open */ +#include #include #include -#include #ifndef min diff --git a/sim/common/sim-config.c b/sim/common/sim-config.c index fc6b09a7238..d6c307525a8 100644 --- a/sim/common/sim-config.c +++ b/sim/common/sim-config.c @@ -22,9 +22,10 @@ /* This must come before any other includes. */ #include "defs.h" +#include "bfd.h" + #include "sim-main.h" #include "sim-assert.h" -#include "bfd.h" enum bfd_endian current_target_byte_order = BFD_ENDIAN_UNKNOWN; diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c index 2c568dc3e36..8d13020df16 100644 --- a/sim/common/sim-core.c +++ b/sim/common/sim-core.c @@ -26,17 +26,18 @@ /* This must come before any other includes. */ #include "defs.h" +#include + +#include "libiberty.h" + #include "sim-main.h" #include "sim-assert.h" #include "sim-signal.h" -#include "libiberty.h" #if (WITH_HW) #include "sim-hw.h" #endif -#include - /* "core" module install handler. This is called via sim_module_install to install the "core" diff --git a/sim/common/sim-cpu.c b/sim/common/sim-cpu.c index bde3e617ce3..49bd850e87f 100644 --- a/sim/common/sim-cpu.c +++ b/sim/common/sim-cpu.c @@ -22,9 +22,10 @@ along with this program. If not, see . */ #include -#include "sim-main.h" #include "bfd.h" +#include "sim-main.h" + /* Allocate space for all cpus in the simulator. Space for the cpu must currently exist prior to parsing ARGV. */ /* ??? wip. better solution must wait. */ diff --git a/sim/common/sim-engine.c b/sim/common/sim-engine.c index 2a0fb72d750..0e06b55bfa1 100644 --- a/sim/common/sim-engine.c +++ b/sim/common/sim-engine.c @@ -20,13 +20,13 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include +#include + #include "sim-main.h" #include "sim-assert.h" #include "sim-signal.h" -#include -#include - /* Get the run state. REASON/SIGRC are the values returned by sim_stop_reason. ??? Should each cpu have its own copy? */ diff --git a/sim/common/sim-events.c b/sim/common/sim-events.c index ee031c9376b..a5ec32d05c8 100644 --- a/sim/common/sim-events.c +++ b/sim/common/sim-events.c @@ -26,14 +26,15 @@ /* This must come before any other includes. */ #include "defs.h" +#include /* For SIGPROCMASK et al. */ +#include +#include + +#include "libiberty.h" + #include "sim-main.h" #include "sim-assert.h" #include "sim-cpu.h" -#include "libiberty.h" - -#include -#include -#include /* For SIGPROCMASK et al. */ typedef enum { watch_invalid, diff --git a/sim/common/sim-fpu.c b/sim/common/sim-fpu.c index fe8ecf8a3ce..e49d2e3238d 100644 --- a/sim/common/sim-fpu.c +++ b/sim/common/sim-fpu.c @@ -38,14 +38,14 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include + #include "sim-basics.h" #include "sim-fpu.h" #include "sim-io.h" #include "sim-assert.h" -#include - /* Debugging support. If digits is -1, then print all digits. */ diff --git a/sim/common/sim-hload.c b/sim/common/sim-hload.c index f33dcf6368a..c42590c2694 100644 --- a/sim/common/sim-hload.c +++ b/sim/common/sim-hload.c @@ -20,8 +20,9 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" -#include "sim-main.h" #include "bfd.h" + +#include "sim-main.h" #include "sim-utils.h" #include "sim-assert.h" diff --git a/sim/common/sim-hw.c b/sim/common/sim-hw.c index 9a3db171d1b..1b086433e78 100644 --- a/sim/common/sim-hw.c +++ b/sim/common/sim-hw.c @@ -20,6 +20,11 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include +#include +#include +#include + #include "sim-main.h" #include "sim-assert.h" #include "sim-options.h" @@ -32,12 +37,6 @@ along with this program. If not, see . */ #include "hw-main.h" #include "hw-base.h" -#include -#include -#include -#include - - struct sim_hw { struct hw *tree; int trace_p; diff --git a/sim/common/sim-io.c b/sim/common/sim-io.c index 9fdc79e0301..5a47f65d8e5 100644 --- a/sim/common/sim-io.c +++ b/sim/common/sim-io.c @@ -22,20 +22,18 @@ /* This must come before any other includes. */ #include "defs.h" -#include "sim-main.h" -#include "sim-io.h" -#include "sim/callback.h" - #include #if HAVE_FCNTL_H #include #endif - +#include #if HAVE_UNISTD_H #include #endif -#include +#include "sim-main.h" +#include "sim-io.h" +#include "sim/callback.h" #undef open diff --git a/sim/common/sim-io.h b/sim/common/sim-io.h index 9536e4b587a..f9fd1978ee2 100644 --- a/sim/common/sim-io.h +++ b/sim/common/sim-io.h @@ -23,6 +23,9 @@ #ifndef SIM_IO_H #define SIM_IO_H +#include +#include + /* See the file include/callbacks.h for a description */ int sim_io_init (SIM_DESC sd); @@ -86,9 +89,6 @@ void sim_io_poll_quit (SIM_DESC sd); /* Returns -1 and sets (host) EAGAIN if not ready. */ int sim_io_poll_read (SIM_DESC sd, int, char *, int); -#include -#include - int sim_io_stat (SIM_DESC sd, const char *path, struct stat *buf); int sim_io_fstat (SIM_DESC sd, int fd, struct stat *buf); diff --git a/sim/common/sim-load.c b/sim/common/sim-load.c index ec5df418d9d..c91d90a55eb 100644 --- a/sim/common/sim-load.c +++ b/sim/common/sim-load.c @@ -21,12 +21,12 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" -#include "ansidecl.h" -#include /* for NULL */ #include +#include /* for NULL */ #include #include +#include "ansidecl.h" #include "bfd.h" #include "sim/callback.h" diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c index 636f6a9a0fe..093958e1f25 100644 --- a/sim/common/sim-memopt.c +++ b/sim/common/sim-memopt.c @@ -20,25 +20,25 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" -#include "sim-main.h" -#include "sim-assert.h" -#include "sim-options.h" - -#include -#include #include #ifdef HAVE_FCNTL_H #include #endif +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef HAVE_SYS_MMAN_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif + +#include "sim-main.h" +#include "sim-assert.h" +#include "sim-options.h" /* Memory fill byte. */ static unsigned8 fill_byte_value; diff --git a/sim/common/sim-model.c b/sim/common/sim-model.c index 98dcbeae6cc..a4e2d915e45 100644 --- a/sim/common/sim-model.c +++ b/sim/common/sim-model.c @@ -20,13 +20,14 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include "bfd.h" +#include "libiberty.h" + #include "sim-main.h" #include "sim-model.h" -#include "libiberty.h" #include "sim-options.h" #include "sim-io.h" #include "sim-assert.h" -#include "bfd.h" static void model_set (sim_cpu *, const SIM_MODEL *); diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c index d2b220ab3fb..dfbb6f93562 100644 --- a/sim/common/sim-module.c +++ b/sim/common/sim-module.c @@ -22,15 +22,15 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include + +#include "libiberty.h" + #include "sim-main.h" #include "sim-io.h" #include "sim-options.h" #include "sim-assert.h" -#include "libiberty.h" - -#include - /* List of all early/core modules. TODO: Should trim this list by converting to sim_install_* framework. */ static MODULE_INSTALL_FN * const early_modules[] = { diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 8c9b7cfec37..5991ddeba3f 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -20,21 +20,22 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" -#include "sim-main.h" -#include -#include #include #include +#include +#include #include + +#include "bfd.h" +#include "environ.h" +#include "hashtab.h" #include "libiberty.h" + +#include "sim-main.h" #include "sim-options.h" #include "sim-io.h" #include "sim-assert.h" -#include "environ.h" #include "version.h" -#include "hashtab.h" - -#include "bfd.h" /* Add a set of options to the simulator. TABLE is an array of OPTIONS terminated by a NULL `opt.name' entry. diff --git a/sim/common/sim-profile.c b/sim/common/sim-profile.c index 1459ae70ab2..adde403186c 100644 --- a/sim/common/sim-profile.c +++ b/sim/common/sim-profile.c @@ -20,15 +20,15 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include +#include +#include + #include "sim-main.h" #include "sim-io.h" #include "sim-options.h" #include "sim-assert.h" -#include -#include -#include - #if !WITH_PROFILE_PC_P static unsigned int _profile_stub; # define PROFILE_PC_FREQ(p) _profile_stub diff --git a/sim/common/sim-reason.c b/sim/common/sim-reason.c index fa3683793d2..27746ea295a 100644 --- a/sim/common/sim-reason.c +++ b/sim/common/sim-reason.c @@ -20,12 +20,12 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include + #include "sim-main.h" #include "sim-assert.h" #include "sim-signal.h" -#include - /* Generic implementation of sim_stop_reason */ void diff --git a/sim/common/sim-signal.c b/sim/common/sim-signal.c index d5186043824..0fe5e1509f9 100644 --- a/sim/common/sim-signal.c +++ b/sim/common/sim-signal.c @@ -21,6 +21,7 @@ along with this program. If not, see . */ #include "defs.h" #include + #include "sim-main.h" #include "sim-signal.h" diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c index 9ebb86d70e2..f4712aae78b 100644 --- a/sim/common/sim-trace.c +++ b/sim/common/sim-trace.c @@ -20,21 +20,19 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" -#include "sim-main.h" -#include "sim-io.h" -#include "sim-options.h" -#include "sim-fpu.h" -#include "sim/callback.h" +#include +#include #include "bfd.h" -#include "libiberty.h" - #include "dis-asm.h" +#include "libiberty.h" +#include "sim-main.h" #include "sim-assert.h" - -#include -#include +#include "sim-io.h" +#include "sim-options.h" +#include "sim-fpu.h" +#include "sim/callback.h" #ifndef SIZE_PHASE #define SIZE_PHASE 8 diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index ff6234b1c98..e30627b88b3 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -21,16 +21,16 @@ along with this program. If not, see . */ #include "defs.h" #include +#include #include -#include /* needed by sys/resource.h */ - #ifdef HAVE_SYS_RESOURCE_H #include #endif -#include +#include /* needed by sys/resource.h */ -#include "libiberty.h" #include "bfd.h" +#include "libiberty.h" + #include "sim-main.h" #include "sim-assert.h" #include "sim-utils.h" diff --git a/sim/common/sim-watch.c b/sim/common/sim-watch.c index bc6c44bcfd1..624580d9fc7 100644 --- a/sim/common/sim-watch.c +++ b/sim/common/sim-watch.c @@ -20,18 +20,18 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" +#include +#include +#include +#include + +#include "libiberty.h" + #include "sim-main.h" #include "sim-options.h" #include "sim-signal.h" -#include "libiberty.h" - #include "sim-assert.h" -#include -#include -#include -#include - enum { OPTION_WATCH_DELETE = OPTION_START, diff --git a/sim/common/syscall.c b/sim/common/syscall.c index df9dd92e6da..c64e78fe5f6 100644 --- a/sim/common/syscall.c +++ b/sim/common/syscall.c @@ -26,20 +26,22 @@ /* This must come before any other includes. */ #include "defs.h" -#include "ansidecl.h" -#include "libiberty.h" +#include +#include #include #include #include #include +#include #ifdef HAVE_UNISTD_H #include #endif -#include -#include -#include -#include #include +#include + +#include "ansidecl.h" +#include "libiberty.h" + #include "sim/callback.h" #ifndef ENOSYS -- 2.30.2