Initial revision
[libfirm] / ir / tr / entity.h
1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
3 **
4 ** Authors: Martin Trapp, Christian Schaefer,
5 **          Goetz Lindenmaier
6 **
7 ** entity.h: declarations for entity
8 */
9
10 # ifndef _ENTITY_H_
11 # define _ENTITY_H_
12
13 # include "ident.h"
14 # include "type.h"
15
16 /*******************************************************************/
17 /** general                                                       **/
18 /*******************************************************************/
19
20 /* initalize entity */
21 void init_entity (void);
22
23
24 /*******************************************************************/
25 /** ENTITY                                                        **/
26 /*******************************************************************/
27
28 typedef struct entity {
29   firm_kind kind;
30   ident *name;          /* name of this entity */
31   // type_class *owner;    /* The class this entity belongs to */
32   type *owner;          /* The class this entity belongs to */
33   ident *ld_name;       // don't know what this is good for.
34   type *type;           /* The type of this entity, e.g., a method type, a
35                            basic type of the language or a class itself */
36   unsigned long visit;  /* visited counter for walks of the type information */
37 } entity;
38
39 /* create a new entity */
40 entity      *new_entity (/*type_class *owner,*/ type *owner,
41                          ident *name, type *type);
42
43 /* manipulate fields of entity */
44 /*
45   char        *get_entity_name     (entity *);  */
46 ident       *get_entity_ident    (entity *);
47 /*
48 void         set_entity_ld_name  (entity *, char *ld_name);
49 void         set_entity_ld_ident (entity *, ident *ld_ident);
50 */
51
52 // type_class *get_entity_owner (entity *);
53 type  *get_entity_owner (entity *);
54 // void  set_entity_owner (entity *, union type *);
55 void   set_entity_owner (entity *, type *);
56 inline void  assert_legal_owner_of_ent(type *);
57
58 ident *get_entity_ld_name  (entity *); /** resolve name conflict!! standard: ident **/
59 /*
60 char        *get_entity_ld_ident (entity *);
61 void         set_entity_ld_name  (entity *, char *ld_name);
62 void         set_entity_ld_ident (entity *, ident *ld_ident);
63 */
64
65 type  *get_entity_type (entity *);
66 void         set_entity_type (entity *, type *);
67
68 # endif /* _ENTITY_H_ */