From: Michael Beck Date: Fri, 30 May 2008 14:51:08 +0000 (+0000) Subject: - no more be_init(): backend is initialised in init_firm X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=82d3ed00d32d2d72f72c574590c403fb722b81b7;p=libfirm - no more be_init(): backend is initialised in init_firm [r19852] --- diff --git a/include/libfirm/be.h b/include/libfirm/be.h index 56c9dff06..0d01226fd 100644 --- a/include/libfirm/be.h +++ b/include/libfirm/be.h @@ -73,12 +73,12 @@ void be_opt_register(void); int be_parse_arg(const char *arg); /** - * Initialize the Firm backend. Must be run BEFORE init_firm()! + * Return the backend configuration parameter. * * @return libFirm configuration parameters for the selected * backend */ -const backend_params *be_init(void); +const backend_params *be_get_backend_param(void); /** * Main interface to the frontend. diff --git a/ir/be/be_t.h b/ir/be/be_t.h index eccf7cda5..9ecee74c0 100644 --- a/ir/be/be_t.h +++ b/ir/be/be_t.h @@ -91,15 +91,21 @@ struct be_main_env_t { }; /** -* Put the registers to be ignored in this IRG into a bitset. -* @param birg The backend IRG data structure. -* @param cls The register class. -* @param bs The bitset (may be NULL). -* @return The number of registers to be ignored. -*/ + * Put the registers to be ignored in this IRG into a bitset. + * @param birg The backend IRG data structure. + * @param cls The register class. + * @param bs The bitset (may be NULL). + * @return The number of registers to be ignored. + */ unsigned be_put_ignore_regs(const be_irg_t *birg, const arch_register_class_t *cls, bitset_t *bs); + +/** + * Initialize the backend. Must be run first in init_firm(); + */ +void firm_be_init(void); + extern int be_timing; #define BE_TIMER_PUSH(timer) \ diff --git a/ir/common/firm.c b/ir/common/firm.c index b2fd415f0..2328583ea 100644 --- a/ir/common/firm.c +++ b/ir/common/firm.c @@ -65,11 +65,12 @@ #include "iredges_t.h" #include "tropt.h" #include "debugger.h" +#include "be_t.h" /* returns the firm root */ lc_opt_entry_t *firm_opt_get_root(void) { static lc_opt_entry_t *grp = NULL; - if(!grp) + if (!grp) grp = lc_opt_get_grp(lc_opt_root_grp(), "firm"); return grp; } @@ -84,6 +85,9 @@ void init_firm(const firm_parameter_t *param) firm_parameter_t def_params; unsigned int size; + /* for historical reasons be_init must be run first */ + firm_be_init(); + memset(&def_params, 0, sizeof(def_params)); if (param) {