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

*** empty log message ***

[r339]
parent a97d5ade
......@@ -40,7 +40,7 @@ ir_prog *new_ir_prog (void) {
res->types = NEW_ARR_F (type *, 1);
res->glob_type = new_type_class(id_from_str (GLOBAL_TYPE_NAME,
strlen(GLOBAL_TYPE_NAME)));
add_irp_type((type *)res->glob_type);
add_irp_type(res->glob_type);
res->const_code_irg = new_const_code_irg();
......
......@@ -410,6 +410,7 @@ set_entity_irg(entity *ent, ir_graph *irg) {
assert (ent && ent->type);
assert (irg);
assert (is_method_type(ent->type));
assert (ent->peculiarity == existent);
ent->irg = irg;
}
......
......@@ -246,7 +246,9 @@ void* get_entity_link(entity *ent);
void set_entity_link(entity *ent, void *l);
/* The entity knows the corresponding irg if the entity is a method.
This allows to get from a Call to the called irg. */
This allows to get from a Call to the called irg.
Only entities of peculiarity "existent" can have a corresponding irg,
else the field is fixed to NULL. (Get returns NULL, set asserts.) */
ir_graph *get_entity_irg(entity *ent);
void set_entity_irg(entity *ent, ir_graph *irg);
......
/*
/*10 2002/03/19 13:08:33
** Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
** All rights reserved.
**
......@@ -64,12 +64,10 @@ struct entity {
void *link; /* To store some intermediate information */
unsigned long visit; /* visited counter for walks of the type information */
/* for methods */
enum peculiarity peculiarity;
ir_graph *irg; /* If (type == method_type) this is the corresponding irg.
The ir_graph constructor automatically sets this field.
@@@ Does this go here, or should it be in type_method,
or should Call have an attribute ent??
Yes, it must be here. */
peculiarity peculiarity;
};
......
/****h* libfirm/type
/****h* libfirm/type6 2002/03/19 13:08:33
*
* NAME
* file type.h - datastructure to hold type information.
......@@ -270,7 +270,7 @@ void set_class_supertype (type *clss, type *supertype, int pos);
void remove_class_supertype(type *clss, type *supertype);
/* This enumeration flags the peculiarity of entities and types. */
typedef enum {
typedef enum peculiarity {
description, /* Represents only a description. The entity/type is never
allocated, no code/data exists for this entity/type. */
existent /* The entity/type (can) exist. */
......
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