Commit 66b4ee69 authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

comments added

[r268]
parent 27747c3a
......@@ -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. */
......
......@@ -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.
......
......@@ -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) {
......
......@@ -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.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment