save name of compiled file in irprog.
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 20 Nov 2003 14:23:34 +0000 (14:23 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 20 Nov 2003 14:23:34 +0000 (14:23 +0000)
[r2067]

ir/ir/irprog.c
ir/ir/irprog.h

index 53759f4..6a891af 100644 (file)
@@ -57,6 +57,7 @@ ir_prog *new_ir_prog (void) {
   /* res->obst      = (struct obstack *) xmalloc (sizeof (struct obstack)); */
   res->graphs = NEW_ARR_F (ir_graph *, 1);
   res->types  = NEW_ARR_F (type *, 1);
+  res->name   = NULL;
 
 #ifdef DEBUG_libfirm
   res->max_node_nr = 0;
@@ -174,7 +175,19 @@ int get_irp_new_node_nr() {
 }
 #endif
 
-ir_graph *get_const_code_irg()
+/** File name / executable name or the like **/
+void   set_irp_prog_name(ident *name) {
+  irp->name = name;
+}
+ident *get_irp_prog_ident(void) {
+  return irp->name;
+}
+const char  *get_irp_prog_name(void) {
+  return get_id_str(irp->name);
+}
+
+
+ir_graph *get_const_code_irg(void)
 {
   return irp->const_code_irg;
 }
index 23ac069..08c829b 100644 (file)
@@ -117,6 +117,10 @@ void  set_irp_type(int pos, type *typ);
 /** Returns the "global" type of the irp. */
 type *get_glob_type(void);
 
+/** File name / executable name or the like. Initially NULL! **/
+void   set_irp_prog_name (ident *name);
+ident *get_irp_prog_ident(void);
+const char  *get_irp_prog_name (void);
 
 /**
  *   Returns an irgraph that only contains constant