Simplyfied firm arrays by deleting useless macro and union.
[libfirm] / ir / tr / type_t.h
index 8dad4d7..0c54a20 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -76,7 +76,7 @@ typedef struct {
        ir_type *value_ress;            /**< A type whose entities represent copied value results. */
        ir_variadicity variadicity;        /**< The variadicity of the method. */
        int first_variadic_param;       /**< The index of the first variadic parameter or -1 if non-variadic .*/
-       unsigned additional_properties; /**< Set of additional method properties. */
+       mtp_additional_properties additional_properties; /**< Set of additional method properties. */
        unsigned irg_calling_conv;      /**< A set of calling convention flags. */
 } mtd_attr;
 
@@ -98,7 +98,7 @@ typedef struct {
 
 /** An enumerator constant. */
 struct ir_enum_const {
-       tarval  *value;     /**< The constants that represents this enumerator identifier. */
+       ir_tarval  *value;  /**< The constants that represents this enumerator identifier. */
        ident   *nameid;    /**< The name of the enumerator identifier. */
        ir_type *owner;     /**< owner type of this enumerator constant. */
 };
@@ -278,15 +278,19 @@ void set_union_size(ir_type *tp, unsigned bytes);
 void set_array_size(ir_type *tp, unsigned bytes);
 void set_default_size(ir_type *tp, unsigned bytes);
 
+/** Set and get a class' dfn --
+ * This is an undocumented field, subject to change! */
+void set_class_dfn(ir_type *clss, int dfn);
+int  get_class_dfn(const ir_type *clss);
+
 void add_compound_member(ir_type *compound, ir_entity *entity);
 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);
+/** Initialize the type module. */
+void ir_init_type(void);
+
+/** free internal datastructures of type module */
+void ir_finish_type(void);
 
 /** Clone an existing method type.
  *
@@ -408,10 +412,10 @@ static inline int _is_class_type(const ir_type *clss)
        return (clss->type_op == type_class);
 }
 
-static inline int _get_class_n_members (const ir_type *clss)
+static inline int _get_class_n_members(const ir_type *clss)
 {
        assert(clss && (clss->type_op == type_class));
-       return (ARR_LEN (clss->attr.ca.members));
+       return (int)(ARR_LEN(clss->attr.ca.members));
 }
 
 static inline ir_entity *_get_class_member(const ir_type *clss, int pos)
@@ -540,13 +544,13 @@ static inline int _get_method_n_ress(const ir_type *method)
        return method->attr.ma.n_res;
 }
 
-static inline unsigned _get_method_additional_properties(const ir_type *method)
+static inline mtp_additional_properties _get_method_additional_properties(const ir_type *method)
 {
        assert(method && (method->type_op == type_method));
        return method->attr.ma.additional_properties;
 }
 
-static inline void _set_method_additional_properties(ir_type *method, unsigned mask)
+static inline void _set_method_additional_properties(ir_type *method, mtp_additional_properties mask)
 {
        assert(method && (method->type_op == type_method));
 
@@ -555,7 +559,7 @@ static inline void _set_method_additional_properties(ir_type *method, unsigned m
        method->attr.ma.additional_properties = mask & ~mtp_property_inherited;
 }
 
-static inline void _set_method_additional_property(ir_type *method, mtp_additional_property flag)
+static inline void _add_method_additional_properties(ir_type *method, mtp_additional_properties flag)
 {
        assert(method && (method->type_op == type_method));
 
@@ -619,7 +623,7 @@ static inline void _set_method_calling_convention(ir_type *method, unsigned cc_m
 #define get_method_n_ress(method)         _get_method_n_ress(method)
 #define get_method_additional_properties(method)        _get_method_additional_properties(method)
 #define set_method_additional_properties(method, mask)  _set_method_additional_properties(method, mask)
-#define set_method_additional_property(method, flag)    _set_method_additional_property(method, flag)
+#define add_method_additional_properties(method, flag)  _add_method_additional_properties(method, flag)
 #define get_method_calling_convention(method)           _get_method_calling_convention(method)
 #define set_method_calling_convention(method, cc_mask)  _set_method_calling_convention(method, cc_mask)