Loads do not remove any nodes from the exec after sets. Also fix a 'node leak'.
[libfirm] / ir / ana2 / pto_name.h
1 /* -*- c -*- */
2
3 /*
4  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
5  *
6  * This file is part of libFirm.
7  *
8  * This file may be distributed and/or modified under the terms of the
9  * GNU General Public License version 2 as published by the Free Software
10  * Foundation and appearing in the file LICENSE.GPL included in the
11  * packaging of this file.
12  *
13  * Licensees holding valid libFirm Professional Edition licenses may use
14  * this file in accordance with the libFirm Commercial License.
15  * Agreement provided with the Software.
16  *
17  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE.
20  */
21
22 /**
23  * @file
24  * @brief    Names for abstract objects
25  * @author   Florian
26  * @date     Sat Nov 13 19:35:27 CET 2004
27  * @version  $Id$
28  */
29 # ifndef FIRM_ANA2_PTO_NAME_H
30 # define FIRM_ANA2_PTO_NAME_H
31
32 # include "pto_comp.h"          /* for pto_t */
33 # include "irnode.h"
34 # include "type.h"
35 # include "qset.h"
36
37 /* ===================================================
38    Global Defines:
39    =================================================== */
40
41 /* ===================================================
42    Global Data Types:
43    =================================================== */
44 typedef enum desc_kind_enum {
45   none,
46   object,
47   array
48 } desc_kind_t;
49
50 /* abstract super class for all descriptors */
51 typedef struct desc_str
52 {
53   int id;
54   int visit;
55   int ctx;
56   int col_idx;
57   desc_kind_t kind;
58   ir_type *tp;
59   ir_node *node;                /* allocation node */
60   struct desc_str *prev;        /* linked list */
61 } desc_t;
62
63 /* object descriptor */
64 typedef struct obj_desc_str
65 {
66   int id;
67   int visit;
68   int ctx;
69   int col_idx;
70   desc_kind_t kind;
71   ir_type *tp;
72   ir_node *node;                /* allocation node */
73   struct desc_str *prev;        /* linked list */
74
75   int n_fields;
76   ir_entity **fields;
77   qset_t **values;
78 } obj_desc_t;
79
80 /* array descriptor */
81 typedef struct arr_desc_str
82 {
83   int id;
84   int visit;
85   int ctx;
86   int col_idx;
87   desc_kind_t kind;
88   ir_type *tp;
89   ir_node *node;                /* allocation node */
90   struct desc_str *prev;        /* linked list */
91
92   qset_t *value;
93 } arr_desc_t;
94
95 /* ===================================================
96    Global Prototypes:
97    =================================================== */
98 /* Dump all names to a file of the given name */
99 void pto_dump_names (const char*);
100
101 /* Find the given descriptor's entry for the given entity */
102 qset_t *get_entry (desc_t*, ir_entity*);
103
104 /* get a new descriptor for the given type at the given node */
105 desc_t *new_name (ir_type*, ir_node*, int);
106
107 /* get a new descriptor for the given (presumably static) entity */
108 desc_t *new_ent_name (ir_entity*);
109
110 /* Initialise the name module */
111 void pto_name_init (void);
112
113 /* Cleanup the name module */
114 void pto_name_cleanup (void);
115
116 /* ===================================================
117    Global Variables:
118    =================================================== */
119
120
121 # endif
122
123
124 \f
125 /*
126   $Log$
127   Revision 1.8  2006/12/13 19:46:47  beck
128   rename type entity into ir_entity
129
130   Revision 1.7  2006/01/13 22:00:15  beck
131   renamed all types 'type' to 'ir_type'
132
133   Revision 1.6  2004/12/15 13:30:41  liekweg
134   print yet nicer names
135
136   Revision 1.5  2004/12/06 12:52:09  liekweg
137   colorize name dump
138
139   Revision 1.4  2004/11/30 15:49:27  liekweg
140   include 'dump'
141
142   Revision 1.3  2004/11/30 14:47:54  liekweg
143   fix initialisation; do correct iteration
144
145   Revision 1.2  2004/11/24 14:53:56  liekweg
146   Bugfixes
147
148   Revision 1.1  2004/11/18 16:37:34  liekweg
149   rewritten
150
151
152 */