out edges for entities and types
[libfirm] / ir / ir / irprog.c
index 5c46830..d8a2e59 100644 (file)
@@ -23,6 +23,7 @@
 # include "typegmod.h"
 
 #define GLOBAL_TYPE_NAME "GlobalType"
+#define INITAL_PROG_NAME "no_name_set"
 
 /* A variable from where everything in the ir can be accessed. */
 ir_prog *irp;
@@ -62,14 +63,13 @@ ir_prog *new_ir_prog (void) {
   /* res->obst      = (struct obstack *) xmalloc (sizeof (struct obstack)); */
   res->graphs = NEW_ARR_F (ir_graph *, 0);
   res->types  = NEW_ARR_F (type *, 0);
-  res->name   = new_id_from_str("no_name_set");
+  res->name   = new_id_from_str(INITAL_PROG_NAME);
 
 #ifdef DEBUG_libfirm
   res->max_node_nr = 0;
 #endif
 
-  res->glob_type = new_type_class(new_id_from_chars (GLOBAL_TYPE_NAME,
-                                              strlen(GLOBAL_TYPE_NAME)));
+  res->glob_type = new_type_class(new_id_from_str (GLOBAL_TYPE_NAME));
   /* Remove type from type list.  Must be treated differently than
      other types. */
   remove_irp_type_from_list(res->glob_type);
@@ -146,7 +146,6 @@ ir_graph *(get_irp_irg)(int pos){
 void set_irp_irg(int pos, ir_graph *irg) {
   assert (irp && irg);
   assert (pos < (ARR_LEN((irp)->graphs)));
-  /* Strangely the first element of the array is NULL.  Why??  */
   irp->graphs[pos] = irg;
 }
 
@@ -172,7 +171,6 @@ type *(get_irp_type) (int pos) {
 void  set_irp_type(int pos, type *typ) {
   assert (irp && typ);
   assert (pos < (ARR_LEN((irp)->types)));
-  /* Strangely the first element of the array is NULL.  Why??  */
   irp->types[pos] = typ;
 }
 
@@ -188,6 +186,9 @@ int get_irp_new_node_nr() {
 void   set_irp_prog_name(ident *name) {
   irp->name = name;
 }
+int irp_prog_name_is_set(void) {
+  return irp->name != new_id_from_str(INITAL_PROG_NAME);
+}
 ident *get_irp_prog_ident(void) {
   return irp->name;
 }
@@ -218,3 +219,12 @@ ir_node** get_irp_ip_outedges(void)
 {
   return(irp -> ip_outedges);
 }
+
+
+irg_callee_info_state get_irp_callee_info_state(void) {
+  return irp->callee_info_state;
+}
+
+void set_irp_callee_info_state(irg_callee_info_state s) {
+  irp->callee_info_state = s;
+}