From fefcae4fca6f882e5475238a4aa64fab4b2a4469 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 18 Jun 2010 15:16:27 +0000 Subject: [PATCH] add set_irp function, correct new_ir_prog docu [r27637] --- include/libfirm/irprog.h | 9 +++++++-- ir/ir/irprog.c | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/libfirm/irprog.h b/include/libfirm/irprog.h index f6549390b..926f44d3b 100644 --- a/include/libfirm/irprog.h +++ b/include/libfirm/irprog.h @@ -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) */ diff --git a/ir/ir/irprog.c b/ir/ir/irprog.c index b13e4bbc3..47e063121 100644 --- a/ir/ir/irprog.c +++ b/ir/ir/irprog.c @@ -44,6 +44,10 @@ /* 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. -- 2.20.1