API stripping
[libfirm] / include / libfirm / typerep.h
index de45ebe..eef8567 100644 (file)
@@ -253,8 +253,11 @@ FIRM_API const char *get_entity_ld_name(const ir_entity *ent);
 /** Returns the owner of the entity. */
 FIRM_API ir_type *get_entity_owner(const ir_entity *ent);
 
-/** Sets the owner field in entity to owner.  Don't forget to add
-   ent to owner!! */
+/**
+ * Sets the owner field in entity to owner.
+ * Automatically removes entity from old owner type and adds it to the new
+ * one.
+ */
 FIRM_API void set_entity_owner(ir_entity *ent, ir_type *owner);
 
 /** Returns the type of an entity. */
@@ -271,9 +274,6 @@ FIRM_API void set_entity_linkage(ir_entity *entity, ir_linkage linkage);
 FIRM_API void add_entity_linkage(ir_entity *entity, ir_linkage linkage);
 FIRM_API void remove_entity_linkage(ir_entity *entity, ir_linkage linkage);
 
-/** Returns 1 if the value of a global symbol never changes in a program */
-FIRM_API int is_entity_constant(const ir_entity *ent);
-
 /**
  * This enumeration flags the volatility of entities and Loads/Stores.
  * @deprecated
@@ -357,6 +357,9 @@ FIRM_API void set_entity_link(ir_entity *ent, void *l);
 FIRM_API ir_graph *get_entity_irg(const ir_entity *ent);
 FIRM_API void set_entity_irg(ir_entity *ent, ir_graph *irg);
 
+/** A reserved value for "not yet set". */
+#define IR_VTABLE_NUM_NOT_SET ((unsigned)(-1))
+
 /** Gets the entity vtable number. */
 FIRM_API unsigned get_entity_vtable_number(const ir_entity *ent);
 
@@ -423,7 +426,7 @@ FIRM_API int is_irn_const_expression(ir_node *n);
 
 /**
  * Copies a Firm subgraph that complies to the restrictions for
- * constant expressions to current_block in current_ir_graph.
+ * constant expressions to block.
  *
  * @param dbg  debug info for all newly created nodes
  * @param n    the node
@@ -431,7 +434,7 @@ FIRM_API int is_irn_const_expression(ir_node *n);
  * Set current_ir_graph to get_const_code_irg() to generate a constant
  * expression.
  */
-FIRM_API ir_node *copy_const_value(dbg_info *dbg, ir_node *n);
+FIRM_API ir_node *copy_const_value(dbg_info *dbg, ir_node *n, ir_node *to_block);
 
 /* Set has no effect for existent entities of type method. */
 FIRM_API ir_node *get_atomic_ent_value(ir_entity *ent);
@@ -467,13 +470,13 @@ FIRM_API ir_initializer_t *get_initializer_null(void);
 FIRM_API ir_initializer_t *create_initializer_const(ir_node *value);
 
 /** creates an initializer containing a single tarval value */
-FIRM_API ir_initializer_t *create_initializer_tarval(tarval *tv);
+FIRM_API ir_initializer_t *create_initializer_tarval(ir_tarval *tv);
 
 /** return value contained in a const initializer */
 FIRM_API ir_node *get_initializer_const_value(const ir_initializer_t *initializer);
 
 /** return value contained in a tarval initializer */
-FIRM_API tarval *get_initializer_tarval_value(const ir_initializer_t *initialzier);
+FIRM_API ir_tarval *get_initializer_tarval_value(const ir_initializer_t *initialzier);
 
 /** creates a compound initializer which holds @p n_entries entries */
 FIRM_API ir_initializer_t *create_initializer_compound(unsigned n_entries);
@@ -1016,9 +1019,9 @@ FIRM_API ir_class_cast_state get_irp_class_cast_state(void);
 FIRM_API void verify_irg_class_cast_state(ir_graph *irg);
 
 /**
- * possible trvrfy() error codes
+ * possible trverify() error codes
  */
-enum trvrfy_error_codes {
+enum trverify_error_codes {
        no_error = 0,                      /**< no error */
        error_ent_not_cont,                /**< overwritten entity not in superclass */
        error_null_mem,                    /**< compound contains NULL member */
@@ -1045,7 +1048,7 @@ FIRM_API int check_type(ir_type *tp);
  *
  * @return
  *  0   if no error encountered
- *  != 0    a trvrfy_error_codes code
+ *  != 0    a trverify_error_codes code
  */
 FIRM_API int check_entity(ir_entity *ent);
 
@@ -1061,7 +1064,7 @@ FIRM_API int check_entity(ir_entity *ent);
  *    0 if graph is correct
  *    else error code.
  */
-FIRM_API int tr_vrfy(void);
+FIRM_API int tr_verify(void);
 
 /**
  * @page type   representation of types
@@ -1957,7 +1960,7 @@ FIRM_API const char *get_enumeration_name(const ir_type *enumeration);
 
 /** Set an enumeration constant to a enumeration type at a given position. */
 FIRM_API void set_enumeration_const(ir_type *enumeration, int pos,
-                                    ident *nameid, tarval *con);
+                                    ident *nameid, ir_tarval *con);
 
 /** Returns the number of enumeration values of this enumeration */
 FIRM_API int get_enumeration_n_enums(const ir_type *enumeration);
@@ -1970,10 +1973,10 @@ FIRM_API ir_enum_const *get_enumeration_const(const ir_type *enumeration,
 FIRM_API ir_type *get_enumeration_owner(const ir_enum_const *enum_cnst);
 
 /** Sets the enumeration constant value. */
-FIRM_API void set_enumeration_value(ir_enum_const *enum_cnst, tarval *con);
+FIRM_API void set_enumeration_value(ir_enum_const *enum_cnst, ir_tarval *con);
 
 /** Returns the enumeration constant value. */
-FIRM_API tarval *get_enumeration_value(const ir_enum_const *enum_cnst);
+FIRM_API ir_tarval *get_enumeration_value(const ir_enum_const *enum_cnst);
 
 /** Assign an ident to an enumeration constant. */
 FIRM_API void set_enumeration_nameid(ir_enum_const *enum_cnst, ident *id);
@@ -2235,80 +2238,8 @@ FIRM_API long get_type_nr(const ir_type *tp);
  */
 typedef int (compare_types_func_t)(const void *tp1, const void *tp2);
 
-/** Compares two types by their name.
- *
- * Compares the opcode and the name of the types. If these are
- * equal returns 0, else non-zero.
- */
-FIRM_API int compare_names(const void *tp1, const void *tp2);
-
-/** Compares two types strict.
- *
- * returns 0 if tp1 == tp2, else non-zero
- */
-FIRM_API int compare_strict(const void *tp1, const void *tp2);
-
-/* ------------------------------------------------------------------------ */
-
-/** Computes a hash value by the type name.
- *
- * Uses the name of the type and the type opcode to compute the hash.
- */
-FIRM_API int firm_hash_name(ir_type *tp);
-
 /* ------------------------------------------------------------------------ */
 
-/** Finalize type construction.
- *
- * Indicate that a type is so far completed that it can be
- * distinguished from other types.  Mature_type hashes the type into a
- * table.  It uses the function in compare_types_func to compare the
- * types.
- *
- * If it finds a type identical to tp it returns this type.  It turns
- * tp into the Id type.  All places formerly pointing to tp will now
- * point to the found type.  All entities of tp now refer to the found
- * type as their owner, but they are not a member of this type.  This
- * is invalid firm -- the entities must be replaced by entities of the
- * found type.  The Id type will be removed from the representation
- * automatically, but within an unknown time span.  It occupies memory
- * for this time.
- *
- * @param tp     The type to mature.
- */
-FIRM_API ir_type *mature_type(ir_type *tp);
-
-/** Finalize type construction.
- *
- * Indicate that a type is so far completed that it can be
- * distinguished from other types.  mature_type() hashes the type into a
- * table.  It uses the function in compare_types_func to compare the
- * types.
- *
- * If it finds a type identical to tp it returns this type.  It frees
- * type tp and all its entities.
- *
- * @param tp     The type to mature.
- */
-FIRM_API ir_type *mature_type_free(ir_type *tp);
-
-/** Finalize type construction.
- *
- * Indicate that a type is so far completed that it can be
- * distinguished from other types.  Mature_type hashes the type into a
- * table.  It uses the function in compare_types_func to compare the
- * types.
- *
- * If it find a type identical to tp it returns this type.  It frees
- * the entities and turns the type into an Id type.  All places
- * formerly pointing to tp will now point to the found type.  The Id
- * type will be removed from the representation automatically, but
- * within an unknown time span.  It occupies memory for this time.
- *
- * @param tp     The type to mature.
- */
-FIRM_API ir_type *mature_type_free_entities(ir_type *tp);
-
 /** A data type to treat types and entities as the same. */
 typedef union {
        ir_type   *typ;   /**< points to a type */