+ return;
+ case IR_INITIALIZER_TARVAL:
+ case IR_INITIALIZER_NULL:
+ return;
+ case IR_INITIALIZER_COMPOUND:
+ for (i = 0; i < initializer->compound.n_initializers; ++i) {
+ ir_initializer_t *sub_initializer
+ = initializer->compound.initializers[i];
+ add_method_address_inititializer(sub_initializer, set);
+ }
+ return;
+ }
+ panic("invalid initializer found");
+}
+
+/**
+ * Add all method addresses in global initializers to the set.
+ *
+ * @note
+ * We do NOT check the type here, just it it's an entity address.
+ * The reason for this is code like:
+ *
+ * void *p = function;
+ *
+ * which is sometimes used to anchor functions.
+ */
+static void add_method_address(ir_entity *ent, eset *set)
+{
+ ir_type *tp;
+
+ /* ignore methods: these of course reference it's address
+ * TODO: remove this later once this incorrect self-initialisation is gone
+ */
+ tp = get_entity_type(ent);
+ if (is_Method_type(tp))
+ return;
+
+ if (ent->initializer != NULL) {
+ add_method_address_inititializer(get_entity_initializer(ent), set);
+ } else if (entity_has_compound_ent_values(ent)) {
+ size_t i, n;
+ for (i = 0, n = get_compound_ent_n_values(ent); i < n; ++i) {
+ ir_node *irn = get_compound_ent_value(ent, i);