move some typedefs to firm_types, move functions from firm.h into firm_common.h
authorMatthias Braun <matze@braunis.de>
Wed, 10 Dec 2008 19:05:14 +0000 (19:05 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 10 Dec 2008 19:05:14 +0000 (19:05 +0000)
[r24498]

include/libfirm/firm.h
include/libfirm/firm_common.h
include/libfirm/firm_types.h
include/libfirm/ident.h
include/libfirm/ircons.h
include/libfirm/typerep.h

index b0361c7..8c60fcb 100644 (file)
@@ -122,84 +122,6 @@ extern "C" {
 
 #include "be.h"
 
-/**
- * libFirm initialization parameters.
- */
-struct _firm_parameter_t {
-  /**
-   * The size of this structure. init_firm() will only initialize
-   * this amount of data. This allows to add more fields to this structure
-   * without breaking compatibility to older source.
-   */
-  unsigned int size;
-
-  /**
-   * Statistic options. If statistic function where enabled, these
-   * flags configure it, see enum firmstat_options_t.
-   */
-  unsigned enable_statistics;
-
-  /**
-   * This function is called, whenever a local variable is
-   * used before definition. The function should insert a default value,
-   * and/or raise a compiler error/warning. Note that returning
-   * an Unknown is allowed here.
-   */
-  uninitialized_local_variable_func_t *initialize_local_func;
-
-  /**
-   * The interface functions for the type identification module.
-   * If not set, the default implementation with compare_strict() and
-   * firm_hash_name() will be used.
-   */
-  type_identify_if_t *ti_if;
-
-  /**
-   * The interface for the ident module.
-   * If not set, the default libFirm ident module (using hash sets).
-   */
-  ident_if_t *id_if;
-
-  /**
-   * The default calling convention.
-   */
-  unsigned cc_mask;
-
-  /**
-   * The debug info that should be used for "builtin" objects.
-   */
-  dbg_info *builtin_dbg;
-};
-
-typedef struct _firm_parameter_t firm_parameter_t;
-
-/**
- * Initialize the firm library.
- *
- * Initializes the firm library.  Allocates default data structures.
- * Initializes configurable behavior of the library.
- *
- * @param params   A structure containing the parameters of the libFirm.
- *
- * The parameter struct may be NULL. In that case, the original FIRM behavior
- * is conserved.
- */
-void ir_init(const firm_parameter_t *params);
-
-/**
- * Frees all memory occupied by the firm library.
- */
-void ir_finish(void);
-
-/** returns the libFirm major version number */
-unsigned ir_get_version_major(void);
-/** returns libFirm minor version number */
-unsigned ir_get_version_minor(void);
-/** returns string describing libFirm revision */
-const char *ir_get_version_revision(void);
-/** returns string describing libFirm build */
-const char *ir_get_version_build(void);
-
 #ifdef __cplusplus
 }
 #endif
index 590bc1b..18e4ef4 100644 (file)
 #ifndef FIRM_COMMON_FIRM_COMMON_H
 #define FIRM_COMMON_FIRM_COMMON_H
 
+#include "firm_types.h"
+
+/**
+ * libFirm initialization parameters.
+ */
+struct _firm_parameter_t {
+  /**
+   * The size of this structure. init_firm() will only initialize
+   * this amount of data. This allows to add more fields to this structure
+   * without breaking compatibility to older source.
+   */
+  unsigned int size;
+
+  /**
+   * Statistic options. If statistic function where enabled, these
+   * flags configure it, see enum firmstat_options_t.
+   */
+  unsigned enable_statistics;
+
+  /**
+   * This function is called, whenever a local variable is
+   * used before definition. The function should insert a default value,
+   * and/or raise a compiler error/warning. Note that returning
+   * an Unknown is allowed here.
+   */
+  uninitialized_local_variable_func_t *initialize_local_func;
+
+  /**
+   * The interface functions for the type identification module.
+   * If not set, the default implementation with compare_strict() and
+   * firm_hash_name() will be used.
+   */
+  type_identify_if_t *ti_if;
+
+  /**
+   * The interface for the ident module.
+   * If not set, the default libFirm ident module (using hash sets).
+   */
+  ident_if_t *id_if;
+
+  /**
+   * The default calling convention.
+   */
+  unsigned cc_mask;
+
+  /**
+   * The debug info that should be used for "builtin" objects.
+   */
+  dbg_info *builtin_dbg;
+};
+
+typedef struct _firm_parameter_t firm_parameter_t;
+
+/**
+ * Initialize the firm library.
+ *
+ * Initializes the firm library.  Allocates default data structures.
+ * Initializes configurable behavior of the library.
+ *
+ * @param params   A structure containing the parameters of the libFirm.
+ *
+ * The parameter struct may be NULL. In that case, the original FIRM behavior
+ * is conserved.
+ */
+void ir_init(const firm_parameter_t *params);
+
+/**
+ * Frees all memory occupied by the firm library.
+ */
+void ir_finish(void);
+
+/** returns the libFirm major version number */
+unsigned ir_get_version_major(void);
+/** returns libFirm minor version number */
+unsigned ir_get_version_minor(void);
+/** returns string describing libFirm revision */
+const char *ir_get_version_revision(void);
+/** returns string describing libFirm build */
+const char *ir_get_version_build(void);
+
+
+
 /** a list of firm kinds
  @@@ not all datatypes are tagged yet. */
 typedef enum {
index 3eb801e..1d2c0f9 100644 (file)
@@ -51,6 +51,8 @@ typedef struct ir_exec_freq         ir_exec_freq,        *ir_exec_freq_ptr;
 typedef struct ir_cdep              ir_cdep,             *ir_cdep_ptr;
 typedef struct sn_entry             *seqno_t;
 typedef struct arch_irn_ops_t       arch_irn_ops_t;
+typedef struct ident_if_t           ident_if_t;
+typedef struct type_identify_if_t   type_identify_if_t;
 
 typedef union  ir_initializer_t     ir_initializer_t,    *ir_initializer_ptr;
 
@@ -75,6 +77,21 @@ typedef enum {
                               all still in the representation, but the graph is no more complete. */
 } ip_view_state;
 
-
+/**
+ * This function is called, whenever a local variable is used before definition
+ *
+ * @param irg       the IR graph on which this happens
+ * @param mode      the mode of the local var
+ * @param pos       position chosen be the frontend for this variable (n_loc)
+ *
+ * @return a firm node of mode @p mode that initializes the var at position pos
+ *
+ * @note
+ *      Do not return NULL!
+ *      If this function is not set, FIRM will create a const node with tarval BAD.
+ *      Use set_irg_loc_description()/get_irg_loc_description() to assign additional
+ *      informations to local variables.
+ */
+typedef ir_node *uninitialized_local_variable_func_t(ir_graph *irg, ir_mode *mode, int pos);
 
 #endif
index 8e3c429..9b3e008 100644 (file)
@@ -37,7 +37,7 @@
 /**
  * The ident module interface.
  */
-typedef struct _ident_if_t {
+struct ident_if_t {
   /** The handle. */
   void *handle;
 
@@ -76,7 +76,7 @@ typedef struct _ident_if_t {
    * Finish the ident module and frees all idents, may be NULL.
    */
   void (*finish_ident)(void *handle);
-} ident_if_t;
+};
 
 /**
  *  Store a string and create an ident.
index bbea40e..2472a13 100644 (file)
@@ -4498,21 +4498,4 @@ void irp_finalize_cons(void);
 
 /* --- Initialization --- */
 
-/**
- * This function is called, whenever a local variable is used before definition
- *
- * @param irg       the IR graph on which this happens
- * @param mode      the mode of the local var
- * @param pos       position chosen be the frontend for this variable (n_loc)
- *
- * @return a firm node of mode @p mode that initializes the var at position pos
- *
- * @note
- *      Do not return NULL!
- *      If this function is not set, FIRM will create a const node with tarval BAD.
- *      Use set_irg_loc_description()/get_irg_loc_description() to assign additional
- *      informations to local variables.
- */
-typedef ir_node *uninitialized_local_variable_func_t(ir_graph *irg, ir_mode *mode, int pos);
-
 #endif
index 149c9be..42f1233 100644 (file)
@@ -2555,12 +2555,12 @@ ir_type *mature_type_free_entities(ir_type *tp);
 /**
  * The interface type for the type identify module;
  */
-typedef struct _type_identify_if_t {
+struct type_identify_if_t {
        compare_types_func_t *cmp;    /**< The function that should be used to compare two types.
                                           If NULL, compare_strict() will be used. */
        hash_types_func_t *hash;      /**< The function that should be used to calculate a hash
                                           value of a type. If NULL, hash_name() will be used. */
-} type_identify_if_t;
+};
 
 /**
  * Initialise the type identifier module.