+/**
+ * Add the nodes of the list src in front to the nodes of the list dst.
+ */
+static call_entry *replace_entry_by_call_list(call_entry *dst, call_entry *src) {
+ call_entry *entry, *nentry, *head, *tail;
+
+ /* Note that the src list points to Call nodes in the inlined graph, but
+ we need Call nodes in our graph. Luckily the inliner leaves this information
+ in the link field. */
+ head = tail = NULL;
+ for (entry = src; entry != NULL; entry = entry->next) {
+ nentry = obstack_alloc(&temp_obst, sizeof(*nentry));
+ nentry->call = get_irn_link(entry->call);
+ nentry->callee = entry->callee;
+ nentry->next = NULL;
+ nentry->loop_depth = entry->loop_depth + dst->loop_depth;
+ if (head == NULL)
+ head = nentry;
+ else
+ tail->next = nentry;
+ tail = nentry;
+ }
+ /* skip the head of dst */
+ if (head != NULL) {
+ tail->next = dst->next;
+ } else {
+ head = dst->next;
+ }
+ return head;
+}
+