- ir_address_not_taken = 0, /**< The address is NOT taken. */
- ir_address_taken_unknown = 1, /**< The state of the address taken flag is unknown. */
- ir_address_taken = 2 /**< The address IS taken. */
-} ir_address_taken_state;
-
-/** Return the state of the address taken flag of an entity. */
-ir_address_taken_state get_entity_address_taken(const ir_entity *ent);
+ ir_usage_none = 0, /**< This entity is unused. */
+ ir_usage_address_taken = 1 << 0, /**< The address of this entity was taken. */
+ ir_usage_write = 1 << 1, /**< The entity was written to. */
+ ir_usage_read = 1 << 2, /**< The entity was read. */
+ ir_usage_reinterpret_cast = 1 << 3, /**< The entity was read but with a wrong mode
+ (an implicit reinterpret cast) */
+ /** Unknown access */
+ ir_usage_unknown
+ = ir_usage_address_taken | ir_usage_write | ir_usage_read
+ | ir_usage_reinterpret_cast
+} ir_entity_usage;
+
+/** Return the entity usage */
+ir_entity_usage get_entity_usage(const ir_entity *ent);