change firm API so the firm_parameter_t struct becomes completely optional and deprec...
authorMatthias Braun <matze@braunis.de>
Tue, 25 May 2010 13:42:23 +0000 (13:42 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 25 May 2010 13:42:23 +0000 (13:42 +0000)
[r27584]

include/libfirm/firm_common.h
include/libfirm/firmstat.h
include/libfirm/ircons.h
include/libfirm/typerep.h
ir/common/firm.c
ir/ir/ircons.c
ir/ir/ircons_t.h
ir/tr/type.c
ir/tr/type_t.h

index 668ac74..28b578b 100644 (file)
@@ -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;
 
index 0ac038e..54a49ef 100644 (file)
@@ -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
  */
index 2f35b09..1036d81 100644 (file)
@@ -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
index 3b8de53..782c95f 100644 (file)
@@ -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
  */
index 9756939..e6d3196 100644 (file)
@@ -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 */
index 55937c7..852196c 100644 (file)
@@ -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)
 {
index 46066cc..99e5668 100644 (file)
 #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.
  */
index 7553fb6..30a9bf4 100644 (file)
@@ -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;
 }
index 8dad4d7..7f9c33f 100644 (file)
@@ -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.
  *