projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CVS:
[libfirm]
/
ir
/
ir
/
irprog.c
diff --git
a/ir/ir/irprog.c
b/ir/ir/irprog.c
index
18c55e1
..
f7355f2
100644
(file)
--- a/
ir/ir/irprog.c
+++ b/
ir/ir/irprog.c
@@
-6,18
+6,22
@@
** irprog.c: ir representation of a program
*/
** irprog.c: ir representation of a program
*/
-# include "irprog.h"
+# include "irprog
_t
.h"
# include "array.h"
# include "obst.h"
#define GLOBAL_TYPE_NAME "GlobalType"
# include "array.h"
# include "obst.h"
#define GLOBAL_TYPE_NAME "GlobalType"
+/* A variable from where everything in the ir can be accessed. */
+ir_prog *irp;
+
/* initializes ir_prog. Calles the constructor for an ir_prog. */
void init_irprog(void) {
new_ir_prog ();
}
/* initializes ir_prog. Calles the constructor for an ir_prog. */
void init_irprog(void) {
new_ir_prog ();
}
-/* Create a new ir prog. Automatically called by init_firm through init_irprog. */
+/* Create a new ir prog. Automatically called by init_firm through
+ init_irprog. */
ir_prog *new_ir_prog (void) {
ir_prog *res;
ir_prog *new_ir_prog (void) {
ir_prog *res;
@@
-31,6
+35,10
@@
ir_prog *new_ir_prog (void) {
strlen(GLOBAL_TYPE_NAME)));
add_irp_type((type *)res->glob_type);
strlen(GLOBAL_TYPE_NAME)));
add_irp_type((type *)res->glob_type);
+#ifdef DEBUG_libfirm
+ res->max_node_nr = 1;
+#endif
+
return res;
}
return res;
}
@@
-107,8
+115,10
@@
void set_irp_type(int pos, type *typ) {
}
}
+#ifdef DEBUG_libfirm
int get_irp_new_node_nr() {
assert(irp);
irp->max_node_nr = irp->max_node_nr + 1;
return irp->max_node_nr - 1;
}
int get_irp_new_node_nr() {
assert(irp);
irp->max_node_nr = irp->max_node_nr + 1;
return irp->max_node_nr - 1;
}
+#endif