From: Michael Beck Date: Tue, 21 Feb 2006 13:58:17 +0000 (+0000) Subject: made get_irp_new_node_nr() inline X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=3c6f3a3a01268bcc56fb969231e8e92951727317;p=libfirm made get_irp_new_node_nr() inline [r7365] --- diff --git a/ir/ir/irprog.c b/ir/ir/irprog.c index 06d79f44a..230fe56bb 100644 --- a/ir/ir/irprog.c +++ b/ir/ir/irprog.c @@ -253,14 +253,6 @@ void add_irp_mode(ir_mode *mode) { ARR_APP1(ir_mode *, irp->modes, mode); } -#ifdef DEBUG_libfirm -int get_irp_new_node_nr() { - assert(irp); - irp->max_node_nr = irp->max_node_nr + 1; - return irp->max_node_nr - 1; -} -#endif - /*- File name / executable name or the like -*/ void set_irp_prog_name(ident *name) { irp->name = name; diff --git a/ir/ir/irprog_t.h b/ir/ir/irprog_t.h index 75dd92458..6174d2b25 100644 --- a/ir/ir/irprog_t.h +++ b/ir/ir/irprog_t.h @@ -80,7 +80,7 @@ struct ir_prog { ir_class_cast_state class_cast_state; /**< kind of cast operations in code. */ #ifdef DEBUG_libfirm - long max_node_nr; /**< to generate unique numbers for nodes. */ + long max_node_nr; /**< to generate unique numbers for nodes. */ #endif }; @@ -137,8 +137,12 @@ _get_irp_mode(int pos) { #ifdef DEBUG_libfirm /** Returns a new, unique number to number nodes or the like. */ -int get_irp_new_node_nr(void); -#endif +static INLINE long +get_irp_new_node_nr(void) { + assert(irp); + return irp->max_node_nr++; +} +#endif /* DEBUG_libfirm */ static INLINE ir_graph * _get_const_code_irg(void) {