comments added
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 7 Nov 2001 18:39:22 +0000 (18:39 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 7 Nov 2001 18:39:22 +0000 (18:39 +0000)
[r268]

ir/ir/irprog.h
ir/tr/entity.h
ir/tr/type.c
ir/tr/type.h

index 84622d3..a516367 100644 (file)
  * NOTE  Preliminary documentation ;-)
  *
  * FIELDS
- *  type   A list containing all types known to the translated program.
- *         Some types can have several entries in this list (as a result of
- *         using exchange_types()).
- * ...
+ *  main_irg  The ir graph that is the entry point to the program.
+ *            (Anything not reachable from here may be optimized away.
+ *            If we want to translate libraries or the like correctly
+ *            we must replace this by a list.)
+ *  irg       List of all ir graphs in the program.
+ *  type      A list containing all types known to the translated program.
+ *            Some types can have several entries in this list (as a result of
+ *            using exchange_types()).
+ *  glob_type The unique global type that is owner of all global entities.
+ *
  * SOURCE
  */
 typedef struct ir_prog ir_prog;
@@ -48,11 +54,11 @@ typedef struct ir_prog ir_prog;
 /* A variable from where everything in the ir can be accessed. */
 extern ir_prog *irp;
 
-/* initializes ir_prog. Calles the constructor for an ir_prog. */
+/* initializes ir_prog. Calls the constructor for an ir_prog. */
 void init_irprog(void);
 
 /* Creates a new ir_prog, returns it and sets irp with it.
-   Automatically called by init_firm through init_irprog. */
+   Automatically called by init_firm through init_irprog.  */
 ir_prog *new_ir_prog (void);
 
 /* Access the main routine of the compiled program. */
index 48e9114..89d23db 100644 (file)
@@ -72,9 +72,22 @@ typedef struct ir_graph ir_graph;
  *   entity - An abstract data type to represent program entites.
  * NOTE
  *
- *   ... not documented ...
- *
  * ATTRIBUTES
+ *   owner      A compound type this entity is a part of.
+ *   type       The type of this entity.
+ *   name       The string that represents this entity in the source program.
+ *   allocation A flag saying whether the entity is dynamically or statically
+ *              allocated (values: dynamic_allocated,  static_allocated).
+ *              @@@ Does this make sense???
+ *   visibility A flag indicating the visibility of this entity (values: local,
+ *              external_visible,  external_allocated)
+ *   offset     The offset of the entity within the compound object.  Only set
+ *              if IR in the state "@@@"  Wie nennen wir den??
+ *   overwrites A list of entities overwritten by this entity.  This list is only
+ *              existent if the owner of this entity is a class.  The members in
+ *              this list must be entities of super classes.
+ *   irg        If the entity is a method this is the ir graph that represents the
+ *              code of the method.
  *
  *
  *  These fields can only be accessed via access functions.
index 5588894..23d997c 100644 (file)
@@ -162,8 +162,10 @@ void
 set_type_state(type *tp, type_state state) {
   assert(tp);
   /* For pointer and primitive always fixed. */
-  if ((tp->type_op != type_pointer) && (tp->type_op != type_primitive))
+  if ((tp->type_op != type_pointer) && (tp->type_op != type_primitive)) {
+    /* @@@ assert that the layout really is fixed!!! */
     tp->state = state;
+  }
 }
 
 unsigned long get_type_visited(type *tp) {
index e3a7013..1c0faa5 100644 (file)
@@ -80,6 +80,15 @@ typedef struct ir_node ir_node;
  *               occupy size bytes in memory.  In several cases this is
  *               determined when fixing the layout of this type (class,
  *               struct, union, array, enumeration).
+ *  state        The state of the type.  The state represents whether the
+ *               layout of the type is undefined or fixed (values: layout_undefined
+ *               or layout_fixed).  Compound types can have an undefined
+ *               layout.  The layout of the basic types primitive and pointer
+ *               is always layout_fixed.  If the layout of
+ *               compound types is fixed all entities must have an offset
+ *               and the size of the type must be set.
+ *               A fixed layout for enumeration types means that each enumeration
+ *               is associated with an implementation value.
  *  visit        A counter for walks of the type information.
  *
  *  These fields can only be accessed via access functions.