Commit 0064ee54 authored by Matthias Braun's avatar Matthias Braun
Browse files

change firm API so the firm_parameter_t struct becomes completely optional and...

change firm API so the firm_parameter_t struct becomes completely optional and deprecated (because good libraries only export functions and opaque types - this makes bindings to other languages considerably easier)

[r27584]
parent 15d04897
......@@ -68,7 +68,10 @@ struct _firm_parameter_t {
ident_if_t *id_if;
/**
* The default calling convention.
* dummy parameter
* (this used to hold a default calling convention, but this concept is no
* more. You should always set the calling convention manually after
* creating the method entity if you need something else)
*/
unsigned cc_mask;
......
......@@ -188,6 +188,7 @@ FIRM_API ir_prog_pass_t *stat_dump_snapshot_pass(
/**
* initialize the statistics module.
* Should be called directly after ir_init
*
* @param enable_options a bitmask containing the statistic options
*/
......
......@@ -4609,6 +4609,9 @@ FIRM_API ir_type *get_cur_frame_type(void);
* e.g., that no more subtypes will be added. */
FIRM_API void irp_finalize_cons(void);
FIRM_API void ir_set_uninitialized_local_variable_func(
uninitialized_local_variable_func_t *func);
#include "end.h"
#endif
......@@ -1740,9 +1740,6 @@ typedef enum {
/** fastcall calling convention */
#define cc_fastcall_set (cc_reg_param|cc_callee_clear_stk)
/** Returns the default calling convention for method types. */
FIRM_API unsigned get_default_cc_mask(void);
/**
* check for the CDECL calling convention
*/
......
......@@ -111,7 +111,7 @@ void ir_init(const firm_parameter_t *param)
/* initialize all op codes an irnode can consist of */
init_op();
/* called once for each run of this library */
firm_init_cons(def_params.initialize_local_func);
ir_set_uninitialized_local_variable_func(def_params.initialize_local_func);
/* initialize reassociation */
firm_init_reassociation();
/* initialize function call optimization */
......@@ -124,7 +124,7 @@ void ir_init(const firm_parameter_t *param)
later. */
init_irprog_2();
/* Initialize the type module and construct some idents needed. */
firm_init_type(def_params.cc_mask);
firm_init_type();
/* initialize the entity module */
firm_init_entity();
/* class cast optimization */
......
......@@ -1476,10 +1476,11 @@ ir_type *get_cur_frame_type(void)
/* initialize */
/* call once for each run of the library */
void firm_init_cons(uninitialized_local_variable_func_t *func)
void ir_set_uninitialized_local_variable_func(
uninitialized_local_variable_func_t *func)
{
default_initialize_local_variable = func;
} /* firm_init_cons */
}
void irp_finalize_cons(void)
{
......
......@@ -30,16 +30,6 @@
#include "ircons.h"
#include "irgraph_t.h"
/**
* Initializes the graph construction.
*
* @param func callback that is called if a uninitialized
* variable is detected
*
* @see uninitialized_local_variable_func_t
*/
void firm_init_cons(uninitialized_local_variable_func_t *func);
/**
* Creates a new Anchor node.
*/
......
......@@ -85,17 +85,8 @@ ir_type *get_unknown_type(void)
static ident *value_params_suffix = NULL;
static ident *value_ress_suffix = NULL;
/** The default calling convention for method types. */
static unsigned default_cc_mask;
unsigned get_default_cc_mask(void)
{
return default_cc_mask;
}
void firm_init_type(unsigned def_cc_mask)
void firm_init_type(void)
{
default_cc_mask = def_cc_mask;
value_params_suffix = new_id_from_str(VALUE_PARAMS_SUFFIX);
value_ress_suffix = new_id_from_str(VALUE_RESS_SUFFIX);
......@@ -1215,7 +1206,6 @@ ir_type *new_d_type_method(int n_param, int n_res, type_dbg_info *db)
res->attr.ma.variadicity = variadicity_non_variadic;
res->attr.ma.first_variadic_param = -1;
res->attr.ma.additional_properties = mtp_no_property;
res->attr.ma.irg_calling_conv = default_cc_mask;
hook_new_type(res);
return res;
}
......
......@@ -283,10 +283,8 @@ void remove_compound_member(ir_type *compound, ir_entity *entity);
/**
* Initialize the type module.
*
* @param default_cc_mask default calling conventions for methods
*/
void firm_init_type(unsigned default_cc_mask);
void firm_init_type(void);
/** Clone an existing method type.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment