+
+/******************************************************************************
+ _____ _ _____ _
+ / ____| | | / ____| |
+ | | __ _ __ __ _ _ __ | |__ | (___ | |_ ___ _ __ __ _ __ _ ___
+ | | |_ | '__/ _` | '_ \| '_ \ \___ \| __/ _ \| '__/ _` |/ _` |/ _ \
+ | |__| | | | (_| | |_) | | | | ____) | || (_) | | | (_| | (_| | __/
+ \_____|_| \__,_| .__/|_| |_| |_____/ \__\___/|_| \__,_|\__, |\___|
+ | | __/ |
+ |_| |___/
+ ******************************************************************************/
+
+typedef struct _neighb_t neighb_t;
+typedef struct _affinity_node_t affinity_node_t;
+
+struct _neighb_t {
+ neighb_t *next; /** the next neighbour entry*/
+ const ir_node *irn; /** the neighbour itself */
+ int costs; /** the costs of the edge (affinity_node_t->irn, neighb_t->irn) */
+};
+
+struct _affinity_node_t {
+ const ir_node *irn; /** a node with affinity edges */
+ int degree; /** number of affinity edges in the linked list below */
+ neighb_t *neighbours; /** a linked list of all affinity neighbours */
+ void *data; /** stuff that is attachable. */
+};
+
+
+static INLINE affinity_node_t *get_affinity_info(const copy_opt_t *co, const ir_node *irn) {
+ affinity_node_t find;
+
+ ASSERT_GS_AVAIL(co);
+
+ find.irn = irn;
+ return set_find(co->nodes, &find, sizeof(find), hash_irn(irn));
+}
+
+#define co_gs_nodes_begin(co) set_first((co)->nodes)
+#define co_gs_nodes_next(co) set_next((co)->nodes)
+#define co_gs_nodes_break(co) set_break((co)->nodes)
+
+#define co_gs_foreach_aff_node(co, aff_node) for (aff_node = co_gs_nodes_begin(co); aff_node; aff_node = co_gs_nodes_next(co))
+#define co_gs_foreach_neighb(aff_node, neighb) for (neighb = aff_node->neighbours; neighb; neighb = neighb->next)