- add block Phi list resource
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 28 Oct 2008 13:17:26 +0000 (13:17 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 28 Oct 2008 13:17:26 +0000 (13:17 +0000)
- check, that only local/global resources are allocated

[r23266]

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

index caf0659..8ced6c8 100644 (file)
@@ -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;
 
index 45b2bdc..155fded 100644 (file)
@@ -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;
 }
index 22dff63..1bde093 100644 (file)
@@ -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;
 }