Fixed method attribute access
[libfirm] / ir / tr / type.h
index 0fbab2c..efb9d28 100644 (file)
  *  @see  tpop.h
  */
 
-# ifndef _TYPE_H_
-# define _TYPE_H_
+#ifndef _FIRM_TR_TYPE_H_
+#define _FIRM_TR_TYPE_H_
 
-# include "firm_types.h"
-# include "tpop.h"
-# include "firm_common.h"
-# include "ident.h"
-# include "irmode.h"
-# include "dbginfo.h"
-# include "tr_inheritance.h"
+#include "firm_types.h"
+#include "tpop.h"
+#include "firm_common.h"
+#include "dbginfo.h"
 
 /**
  *  An abstract data type to represent types.
@@ -598,7 +595,7 @@ void set_class_type_info(ir_type *clss, entity *ent);
 int is_class_final(const ir_type *clss);
 
 /** Sets if a class is final. */
-void set_class_final(ir_type *clss, int final);
+void set_class_final(ir_type *clss, int flag);
 
 /* Set and get a class' dfn --
    @todo This is an undocumented field, subject to change! */
@@ -796,7 +793,7 @@ typedef enum {
                                          its return values solely from its parameters.
                                          GCC: __attribute__((const)). */
   mtp_property_pure      = 0x00000002, /**< This method did NOT write to memory and calculates
-                                         its return values solely form its parameters and
+                                         its return values solely from its parameters and
                                          the memory they points to (or global vars).
                                          GCC: __attribute__((pure)). */
   mtp_property_noreturn  = 0x00000004, /**< This method did not return due to an aborting system
@@ -810,7 +807,7 @@ typedef enum {
                                          GCC: __attribute__((malloc)). */
   mtp_property_intrinsic = 0x00000040, /**< This method is intrinsic. It is expected that
                                          a lowering phase will remove all calls to it. */
-  mtp_property_inherited = 0x40000000  /**< used only in irg's, means property is inherited
+  mtp_property_inherited = (1<<31)     /**< used only in irg's, means property is inherited
                                          from type. */
 } mtp_additional_property;
 
@@ -1114,7 +1111,7 @@ int   is_Pointer_type            (const ir_type *pointer);
 
 /** Returns the first pointer type that has as points_to tp.
  *  Not efficient: O(#types).
- *  If not found returns unknown_type. */
+ *  If not found returns firm_unknown_type. */
 ir_type *find_pointer_type_to_type (ir_type *tp);
 
 /**
@@ -1123,7 +1120,7 @@ ir_type *find_pointer_type_to_type (ir_type *tp);
  * Primitive types are types that represent indivisible data values that
  * map directly to modes.  They don't have a private attribute.  The
  * important information they carry is held in the common mode field.
-*/
+ */
 /** Creates a new primitive type. */
 ir_type *new_type_primitive (ident *name, ir_mode *mode);
 
@@ -1135,7 +1132,7 @@ int  is_Primitive_type  (const ir_type *primitive);
 
 
 /**
- * @page none_type
+ * @page none_type The None type
  *
  *  This type is an auxiliary type dedicated to support type analyses.
  *
@@ -1226,10 +1223,15 @@ int     get_compound_member_index(const ir_type *tp, entity *member);
 int is_compound_type(const ir_type *tp);
 
 /**
- * Checks, whether a type is a frame type
+ * Checks, whether a type is a frame type.
  */
 int is_frame_type(const ir_type *tp);
 
+/**
+ * Checks, whether a type is a lowered type.
+ */
+int is_lowered_type(const ir_type *tp);
+
 /**
  * Makes a new frame type. Frame types are class types,
  * so all class access functions work.
@@ -1237,6 +1239,32 @@ int is_frame_type(const ir_type *tp);
  */
 ir_type   *new_type_frame(ident *name);
 
+/**
+ * Sets a lowered type for a type. This sets both associations
+ * and marks lowered type as a "lowered" one.
+ */
+void set_lowered_type(ir_type *tp, ir_type *lowered_type);
+
+/**
+ * Gets the lowered/unlowered type of a type or NULL if this type
+ * has no lowered/unlowered one.
+ */
+ir_type *get_associated_type(const ir_type *tp);
+
+/**
+ * Allocate an area of size bytes aligned at alignment
+ * at the start or the end of a frame type.
+ * The frame type must have already an fixed layout.
+ *
+ * @param frame_type a frame type
+ * @param size       the size of the entity
+ * @param alignment  the alignment of the entity
+ * @param at_start   if true, put the area at the frame type's start, else at end
+ *
+ * @return the entity representing the area
+ */
+entity *frame_alloc_area(type *frame_type, int size, int alignment, int at_start);
+
 /*-----------------------------------------------------------------*/
 /** Debug aides                                                   **/
 /*-----------------------------------------------------------------*/
@@ -1248,5 +1276,4 @@ ir_type   *new_type_frame(ident *name);
  */
 long get_type_nr(const ir_type *tp);
 
-
-# endif /* _TYPE_H_ */
+#endif /* _FIRM_TR_TYPE_H_ */