include 'dump'
[libfirm] / ir / ana2 / pto_name.h
1 /* -*- c -*- */
2
3 /*
4   Project:     libFIRM
5   File name:   ir/ana/pto_name.h
6   Purpose:     Names for abstract objects
7   Author:      Florian
8   Modified by:
9   Created:     Sat Nov 13 19:35:27 CET 2004
10   CVS-ID:      $Id$
11   Copyright:   (c) 1999-2004 Universität Karlsruhe
12   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
13 */
14
15
16 # ifndef _PTO_NAME_
17 # define _PTO_NAME_
18
19 # include "pto_comp.h"          /* for pto_t */
20 # include "irnode.h"
21 # include "type.h"
22 # include "qset.h"
23
24 /* ===================================================
25    Global Defines:
26    =================================================== */
27
28 /* ===================================================
29    Global Data Types:
30    =================================================== */
31 typedef enum desc_kind_enum {
32   none,
33   object,
34   array
35 } desc_kind_t;
36
37 /* abstract super class for all descriptors */
38 typedef struct desc_str
39 {
40   int id;
41   desc_kind_t kind;
42   type *tp;
43   ir_node *node;                /* allocation node */
44   struct desc_str *prev;        /* linked list */
45 } desc_t;
46
47 /* object descriptor */
48 typedef struct obj_desc_str
49 {
50   int id;
51   desc_kind_t kind;
52   type *tp;
53   ir_node *node;                /* allocation node */
54   struct desc_str *prev;        /* linked list */
55
56   int n_fields;
57   entity **fields;
58   qset_t **values;
59 } obj_desc_t;
60
61 /* array descriptor */
62 typedef struct arr_desc_str
63 {
64   int id;
65   desc_kind_t kind;
66   type *tp;
67   ir_node *node;                /* allocation node */
68   struct desc_str *prev;        /* linked list */
69
70   qset_t *value;
71 } arr_desc_t;
72
73 /* ===================================================
74    Global Prototypes:
75    =================================================== */
76 /* Dump all names to a file of the given name */
77 void pto_dump_names (const char*);
78
79 /* Find the given descriptor's entry for the given entity */
80 qset_t *get_entry (desc_t*, entity*);
81
82 /* get a new descriptor for the given type at the given node */
83 desc_t *new_name (type*, ir_node*);
84
85 /* get a new descriptor for the given (presumably static) entity */
86 desc_t *new_ent_name (entity*);
87
88 /* Initialise the name module */
89 void pto_name_init (void);
90
91 /* Cleanup the name module */
92 void pto_name_cleanup (void);
93
94 /* ===================================================
95    Global Variables:
96    =================================================== */
97
98
99 # endif /* not defined _PTO_NAME_ */
100
101
102 \f
103 /*
104   $Log$
105   Revision 1.4  2004/11/30 15:49:27  liekweg
106   include 'dump'
107
108   Revision 1.3  2004/11/30 14:47:54  liekweg
109   fix initialisation; do correct iteration
110
111   Revision 1.2  2004/11/24 14:53:56  liekweg
112   Bugfixes
113
114   Revision 1.1  2004/11/18 16:37:34  liekweg
115   rewritten
116
117
118 */