-#define is_entity(thing) _is_entity(thing)
-#define get_entity_name(ent) _get_entity_name(ent)
-#define get_entity_ident(ent) _get_entity_ident(ent)
-#define get_entity_owner(ent) _get_entity_owner(ent)
-#define get_entity_ld_ident(ent) _get_entity_ld_ident(ent)
-#define set_entity_ld_ident(ent, ld_ident) _set_entity_ld_ident(ent, ld_ident)
-#define get_entity_ld_name(ent) _get_entity_ld_name(ent)
-#define get_entity_type(ent) _get_entity_type(ent)
-#define set_entity_type(ent, type) _set_entity_type(ent, type)
-#define get_entity_allocation(ent) _get_entity_allocation(ent)
-#define set_entity_allocation(ent, al) _set_entity_allocation(ent, al)
-#define get_entity_visibility(ent) _get_entity_visibility(ent)
-#define get_entity_variability(ent) _get_entity_variability(ent)
-#define get_entity_volatility(ent) _get_entity_volatility(ent)
-#define set_entity_volatility(ent, vol) _set_entity_volatility(ent, vol)
-#define get_entity_peculiarity(ent) _get_entity_peculiarity(ent)
-#define set_entity_peculiarity(ent, pec) _set_entity_peculiarity(ent, pec)
-#define get_entity_stickyness(ent) _get_entity_stickyness(ent)
-#define set_entity_stickyness(ent, stickyness) _set_entity_stickyness(ent, stickyness)
-#define get_entity_offset_bits(ent) _get_entity_offset_bits(ent)
-#define get_entity_offset_bytes(ent) _get_entity_offset_bytes(ent)
-#define set_entity_offset_bits(ent, offset) _set_entity_offset_bits(ent, offset)
-#define set_entity_offset_bytes(ent, offset) _set_entity_offset_bytes(ent, offset)
-#define get_entity_link(ent) _get_entity_link(ent)
-#define set_entity_link(ent, l) _set_entity_link(ent, l)
-#define get_entity_irg(ent) _get_entity_irg(ent)
+static INLINE unsigned long
+_get_entity_visited(entity *ent) {
+ assert(ent && ent->kind == k_entity);
+ return ent->visit;
+}
+
+static INLINE void
+_set_entity_visited(entity *ent, unsigned long num) {
+ assert(ent && ent->kind == k_entity);
+ ent->visit = num;
+}
+
+static INLINE void
+_mark_entity_visited(entity *ent) {
+ assert(ent && ent->kind == k_entity);
+ ent->visit = firm_type_visited;
+}
+
+static INLINE int
+_entity_visited(entity *ent) {
+ return _get_entity_visited(ent) >= firm_type_visited;
+}
+
+static INLINE int
+_entity_not_visited(entity *ent) {
+ return _get_entity_visited(ent) < firm_type_visited;
+}
+
+#define is_entity(thing) _is_entity(thing)
+#define get_entity_name(ent) _get_entity_name(ent)
+#define get_entity_ident(ent) _get_entity_ident(ent)
+#define get_entity_owner(ent) _get_entity_owner(ent)
+#define get_entity_ld_ident(ent) _get_entity_ld_ident(ent)
+#define set_entity_ld_ident(ent, ld_ident) _set_entity_ld_ident(ent, ld_ident)
+#define get_entity_ld_name(ent) _get_entity_ld_name(ent)
+#define get_entity_type(ent) _get_entity_type(ent)
+#define set_entity_type(ent, type) _set_entity_type(ent, type)
+#define get_entity_allocation(ent) _get_entity_allocation(ent)
+#define set_entity_allocation(ent, al) _set_entity_allocation(ent, al)
+#define get_entity_visibility(ent) _get_entity_visibility(ent)
+#define get_entity_variability(ent) _get_entity_variability(ent)
+#define get_entity_volatility(ent) _get_entity_volatility(ent)
+#define set_entity_volatility(ent, vol) _set_entity_volatility(ent, vol)
+#define get_entity_peculiarity(ent) _get_entity_peculiarity(ent)
+#define set_entity_peculiarity(ent, pec) _set_entity_peculiarity(ent, pec)
+#define get_entity_stickyness(ent) _get_entity_stickyness(ent)
+#define set_entity_stickyness(ent, stickyness) _set_entity_stickyness(ent, stickyness)
+#define get_entity_offset_bits(ent) _get_entity_offset_bits(ent)
+#define get_entity_offset_bytes(ent) _get_entity_offset_bytes(ent)
+#define set_entity_offset_bits(ent, offset) _set_entity_offset_bits(ent, offset)
+#define set_entity_offset_bytes(ent, offset) _set_entity_offset_bytes(ent, offset)
+#define get_entity_link(ent) _get_entity_link(ent)
+#define set_entity_link(ent, l) _set_entity_link(ent, l)
+#define get_entity_irg(ent) _get_entity_irg(ent)
+#define get_entity_visited(ent) _get_entity_visited(ent)
+#define set_entity_visited(ent, num) _set_entity_visited(ent, num)
+#define mark_entity_visited(ent) _mark_entity_visited(ent)
+#define entity_visited(ent) _entity_visited(ent)
+#define entity_not_visited(ent) _entity_not_visited(ent)