+static int firm_get_arg_type_int(const lc_arg_occ_t *occ) {
+ return lc_arg_type_int;
+}
+
+
+static int bitset_get_arg_type(const lc_arg_occ_t *occ) {
+ return lc_arg_type_ptr;
+}
+
+static int bitset_emit(lc_appendable_t *app,
+ const lc_arg_occ_t *occ, const lc_arg_value_t *arg)
+{
+ int res = 2;
+ bitset_t *b = arg->v_ptr;
+ bitset_pos_t p;
+ char buf[32];
+ const char *prefix = "";
+
+ lc_arg_append(app, occ, "[", 1);
+ for(p = bitset_next_set(b, 0); p != -1; p = bitset_next_set(b, p)) {
+ int n;
+
+ n = snprintf(buf, sizeof(buf), "%s%d", prefix, (int) p);
+ lc_arg_append(app, occ, buf, n);
+ prefix = ", ";
+ res += n;
+ }
+ lc_arg_append(app, occ, "]", 1);
+
+ return res;
+}
+
+/**
+ * emit an opaque Firm dbg_info object
+ */
+static int firm_emit_dbg(lc_appendable_t *app,
+ const lc_arg_occ_t *occ, const lc_arg_value_t *arg)
+{
+ char buf[1024];
+ ir_node *irn = arg->v_ptr;
+ dbg_info *dbg = get_irn_dbg_info(irn);
+
+ buf[0] = '\0';
+ if (dbg && __dbg_info_snprint) {
+ if (__dbg_info_snprint(buf, sizeof(buf), dbg) <= 0)
+ buf[0] = '\0';
+ }
+ return lc_arg_append(app, occ, buf, strlen(buf));
+}
+
+/**
+ * Beware: do not set the entity ld_name
+ */
+static const char *get_entity_ld_name_ex(entity *ent) {
+ if (ent->ld_name)
+ return get_entity_ld_name(ent);
+ return get_entity_name(ent);