forked from Imagelibrary/binutils-gdb
sim: cgen: inline cgen_init logic
This function has done only one thing: post-process command line settings to see if profiling or tracing has been enabled, and if so, set the run_fast_p flag in the simulator state. That flag is only used in one place: to select the fast or slow cgen engine. By inlining the run_fast_p logic to the one place it's used, we can delete a good amount of logic specific to cgen ports: both the call to cgen_init and the conditional simulator state. This in turn allows us to have a single simulator state struct across all ports so we can share objects more between them, and makes the sim_open calls look more consistent.
This commit is contained in:
@@ -138,22 +138,8 @@ typedef enum {
|
||||
#define ENDSWITCH(N)
|
||||
#endif
|
||||
|
||||
/* Simulator state. */
|
||||
|
||||
/* CGEN_STATE contains additional state information not present in
|
||||
sim_state_base. */
|
||||
|
||||
typedef struct cgen_state {
|
||||
/* Non-zero if no tracing or profiling is selected. */
|
||||
int run_fast_p;
|
||||
#define STATE_RUN_FAST_P(sd) (STATE_CGEN_STATE (sd).run_fast_p)
|
||||
} CGEN_STATE;
|
||||
|
||||
/* Various utilities. */
|
||||
|
||||
/* Called after sim_post_argv_init to do any cgen initialization. */
|
||||
extern void cgen_init (SIM_DESC);
|
||||
|
||||
/* Return the name of an insn. */
|
||||
extern CPU_INSN_NAME_FN cgen_insn_name;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user