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)
*/
/* 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.