From: Michael Beck Date: Tue, 28 Oct 2008 13:17:26 +0000 (+0000) Subject: - add block Phi list resource X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=4dd80912e32dd1e7a5b22eef240fca9c7ef845b2;p=libfirm - add block Phi list resource - check, that only local/global resources are allocated [r23266] --- diff --git a/include/libfirm/irgraph.h b/include/libfirm/irgraph.h index caf0659b1..8ced6c844 100644 --- a/include/libfirm/irgraph.h +++ b/include/libfirm/irgraph.h @@ -509,12 +509,20 @@ void set_irg_block_visited(ir_graph *irg, ir_visited_t i); * if 2 parties try to use the flags. */ enum ir_resources_enum_t { + /* local (irg) resources */ IR_RESOURCE_BLOCK_VISITED = 1 << 0, /**< Block visited flags are used. */ IR_RESOURCE_BLOCK_MARK = 1 << 1, /**< Block mark bits are used. */ IR_RESOURCE_IRN_VISITED = 1 << 2, /**< IR-node visited flags are used. */ IR_RESOURCE_IRN_LINK = 1 << 3, /**< IR-node link fields are used. */ IR_RESOURCE_LOOP_LINK = 1 << 4, /**< IR-loop link fields are used. */ - IR_RESOURCE_ENTITY_LINK = 1 << 5 /**< IR-entity link fields are used. */ + IR_RESOURCE_PHI_LIST = 1 << 5, /**< Block Phi lists are used. */ + + /* global (irp) resources */ + IR_RESOURCE_ENTITY_LINK = 1 << 8, /**< IR-entity link fields are used. */ + + /* masks */ + IR_RESOURCE_LOCAL_MASK = 0x00FF, /**< Mask for all local resources. */ + IR_RESOURCE_GLOBAL_MASK = 0xFF00 /**< Mask for all global resources. */ }; typedef unsigned ir_resources_t; diff --git a/ir/ir/irgraph.c b/ir/ir/irgraph.c index 45b2bdc88..155fded88 100644 --- a/ir/ir/irgraph.c +++ b/ir/ir/irgraph.c @@ -1053,6 +1053,7 @@ void *get_irg_loc_description(ir_graph *irg, int n) { #ifndef NDEBUG void ir_reserve_resources(ir_graph *irg, ir_resources_t resources) { + assert((resources & ~IR_RESOURCE_LOCAL_MASK) == 0); assert((irg->reserved_resources & resources) == 0); irg->reserved_resources |= resources; } diff --git a/ir/ir/irprog.c b/ir/ir/irprog.c index 22dff63d5..1bde093c0 100644 --- a/ir/ir/irprog.c +++ b/ir/ir/irprog.c @@ -436,6 +436,7 @@ ident *get_irp_asm(int pos) { #ifndef NDEBUG void irp_reserve_resources(ir_prog *irp, ir_resources_t resources) { + assert((resources & ~IR_RESOURCE_GLOBAL_MASK) == 0); assert((irp->reserved_resources & resources) == 0); irp->reserved_resources |= resources; }