add set_irp function, correct new_ir_prog docu
authorMatthias Braun <matze@braunis.de>
Fri, 18 Jun 2010 15:16:27 +0000 (15:16 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 18 Jun 2010 15:16:27 +0000 (15:16 +0000)
[r27637]

include/libfirm/irprog.h
ir/ir/irprog.c

index f654939..926f44d 100644 (file)
@@ -94,8 +94,13 @@ FIRM_API ir_resources_t irp_resources_reserved(const ir_prog *irp);
 FIRM_API ir_prog *get_irp(void);
 
 /**
- * Creates a new ir_prog (a module or compilation unit),
- * returns it and sets irp with it.
+ * Set current irp
+ */
+FIRM_API void set_irp(ir_prog *irp);
+
+/**
+ * Creates a new ir_prog (a module or compilation unit).
+ * Note: This does not set irp to the newly created ir_prog
  *
  * @param name  the name of this irp (module)
  */
index b13e4bb..47e0631 100644 (file)
 /* A variable from where everything in the ir can be accessed. */
 ir_prog *irp;
 ir_prog *get_irp(void) { return irp; }
+void set_irp(ir_prog *new_irp)
+{
+       irp = new_irp;
+}
 
 /**
  *  Create a new incomplete ir_prog.