From: Michael Beck Date: Thu, 5 Oct 2006 13:08:13 +0000 (+0000) Subject: firm_init_options() is now a separate function that reads the firm.ini and might... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=002120b9325bd7e1da3ebb9dd258350011ad863c;p=libfirm firm_init_options() is now a separate function that reads the firm.ini and might parse command line parameters. This is NOT anymore done in init_firm() [r8315] --- diff --git a/ir/common/firm.c b/ir/common/firm.c index f3809c688..34417e236 100644 --- a/ir/common/firm.c +++ b/ir/common/firm.c @@ -49,14 +49,18 @@ #ifdef WITH_LIBCORE /* returns the firm root */ -lc_opt_entry_t *firm_opt_get_root(void) -{ +lc_opt_entry_t *firm_opt_get_root(void) { static lc_opt_entry_t *grp = NULL; if(!grp) grp = lc_opt_get_grp(lc_opt_root_grp(), "firm"); return grp; } -#endif + +void firm_init_options(const char *arg_prefix, int argc, const char **argv) { + /* parse any init files for firm */ + lc_opts_init("firm", firm_opt_get_root(), arg_prefix, argc, argv); +} +#endif /* WITH_LIBCORE */ void init_firm(const firm_parameter_t *param) @@ -77,8 +81,8 @@ init_firm(const firm_parameter_t *param) memcpy(&def_params, param, size); } - /* initialize firm flags */ - firm_init_flags(); + /* initialize firm flags */ + firm_init_flags(); /* initialize all ident stuff */ init_ident(def_params.id_if, 1024); /* initialize Firm hooks */ @@ -129,11 +133,6 @@ init_firm(const firm_parameter_t *param) /* integrated debugger extension */ firm_init_debugger(); #endif - -#ifdef WITH_LIBCORE - /* parse any init files for firm */ - lc_opts_init("firm", firm_opt_get_root(), def_params.arg_prefix, def_params.argc, def_params.argv); -#endif } void free_firm(void) { diff --git a/ir/common/firm.h b/ir/common/firm.h index 4e945fe4f..f3cc21a1a 100644 --- a/ir/common/firm.h +++ b/ir/common/firm.h @@ -198,31 +198,6 @@ struct _firm_parameter_t { * The debug info that should be used for "builtin" objects. */ dbg_info *builtin_dbg; - - /** - * Prefix for the command line options. - * example: if the option is -ffirm-opt-bla, then the prefix is "-f" - * @note Only active, if libfirm is compiled with libcore. - */ - const char *arg_prefix; - - /** - * Number of arguments in the "command line". - * @note Only active, if libfirm is compiled with libcore. - */ - int argc; - - /** - * Array of arguments. - * @note Only active, if libfirm is compiled with libcore. - */ - const char **argv; - - /** - * Name of ini file which is initially read. - * @note Only active, if libfirm is compiled with libcore. - */ - const char *ini_file; }; typedef struct _firm_parameter_t firm_parameter_t; @@ -262,6 +237,13 @@ void free_firm(void); */ void firm_get_version(firm_version_t *version); +#ifdef WITH_LIBCORE +/** + * Read initializations arguments from the .init file. + */ +void firm_init_options(const char *arg_prefix, int argc, const char **argv); +#endif + #ifdef __cplusplus } #endif