992935ca685f3c4599e9f3b715c566a475a16022
[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;       /* Unique name of this entity, i.e., the mangled
34                            name.  E.g., for a class `A' with field `a' this
35                            is the ident for `A_a'. */
36   type *type;           /* The type of this entity, e.g., a method type, a
37                            basic type of the language or a class itself */
38   unsigned long visit;  /* visited counter for walks of the type information */
39 } entity;
40
41 /* create a new entity */
42 entity      *new_entity (/*type_class *owner,*/ type *owner,
43                          ident *name, type *type);
44
45 /* manipulate fields of entity */
46 /*
47   char        *get_entity_name     (entity *);  */
48 ident       *get_entity_ident    (entity *);
49 /*
50 void         set_entity_ld_name  (entity *, char *ld_name);
51 void         set_entity_ld_ident (entity *, ident *ld_ident);
52 */
53
54 // type_class *get_entity_owner (entity *);
55 type  *get_entity_owner (entity *);
56 // void  set_entity_owner (entity *, union type *);
57 void   set_entity_owner (entity *, type *);
58 inline void  assert_legal_owner_of_ent(type *);
59
60 ident *get_entity_ld_name  (entity *); /** resolve name conflict!! standard: ident **/
61 /*
62 char        *get_entity_ld_ident (entity *);
63 void         set_entity_ld_name  (entity *, char *ld_name);
64 void         set_entity_ld_ident (entity *, ident *ld_ident);
65 */
66
67 type  *get_entity_type (entity *);
68 void         set_entity_type (entity *, type *);
69
70 # endif /* _ENTITY_H_ */