From: Götz Lindenmaier Date: Wed, 7 Nov 2001 18:39:22 +0000 (+0000) Subject: comments added X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=66b4ee69562e61429ef96ef718fc3ca0511c47f9;p=libfirm comments added [r268] --- diff --git a/ir/ir/irprog.h b/ir/ir/irprog.h index 84622d39a..a51636780 100644 --- a/ir/ir/irprog.h +++ b/ir/ir/irprog.h @@ -37,10 +37,16 @@ * 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. */ diff --git a/ir/tr/entity.h b/ir/tr/entity.h index 48e911443..89d23dbc3 100644 --- a/ir/tr/entity.h +++ b/ir/tr/entity.h @@ -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. diff --git a/ir/tr/type.c b/ir/tr/type.c index 558889401..23d997cc3 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -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) { diff --git a/ir/tr/type.h b/ir/tr/type.h index e3a7013c6..1c0faa55e 100644 --- a/ir/tr/type.h +++ b/ir/tr/type.h @@ -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.