Branch: Tag:

2022-05-07

2022-05-07 18:09:50 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: More tracing.

4717:    aflags, bflags, remap_flags);       marker = alloc_remap_marker(remap, CAR_TO_INT(a), remap_flags); +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "$%d = ", marker); +  simple_describe_type(tmp); +  fprintf(stderr, "\n"); +  simple_describe_remap_state(remap); +  }    /* Marker value */    store_marker(remap, marker, tmp, remap_flags);   
4734:    }    }    +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "$%d = ", marker | 0x100); +  simple_describe_type(tmp); +  fprintf(stderr, " (backpatch value)\n"); +  simple_describe_remap_state(remap); +  }    /* Value to backpatch. */    store_marker(remap, marker | 0x100, tmp, remap_flags);   
4755:       marker = alloc_remap_marker(remap, CAR_TO_INT(b),    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "$%d = ", marker); +  simple_describe_type(tmp); +  fprintf(stderr, "\n"); +  simple_describe_remap_state(remap); +  }    /* Marker value */    store_marker(remap, marker, tmp,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);
4773:    }    }    +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "$%d = ", marker | 0x100); +  simple_describe_type(tmp); +  fprintf(stderr, " (backpatch value)\n"); +  simple_describe_remap_state(remap); +  }    /* Value to backpatch. */    store_marker(remap, marker | 0x100, tmp,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);
5009:    */    tmp2 = remap_markers(b->cdr, remap,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "tmp: "); +  simple_describe_type(tmp); +  fprintf(stderr, "\ntmp2: "); +  simple_describe_type(tmp2); +  fprintf(stderr, "\nop: 0x%04x\n", op); +  }    ret = low_type_binop(op, tmp, tmp2, NULL, aflags, bflags, 0); -  +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "tmp op tmp2: "); +  simple_describe_type(ret); +  fprintf(stderr, "\n"); +  }    if (orig_markers) {    do_free_mapping(remap->markers[marker_set]);    remap->markers[marker_set] = orig_markers;
6192:    }    }    +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "bounds: "); +  for (i = 0; i < nbounds; i++) { +  fprintf(stderr, "%s%d[0b%d%d]", i?", ":"", bounds[i], +  (ab[i]>>1) & 1, ab[i] & 1); +  } +  fprintf(stderr, "\n"); +  if (!peek_stack_mark()) { +  fprintf(stderr, "==> NULL\n"); +  } +  } +     nbounds = peek_stack_mark();    if (!nbounds) {    pop_stack_mark();
6209:    for (i = 1; i < nbounds; i++) {    push_type(T_OR);    } +  +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "==> "); +  simple_describe_type(peek_type_stack()); +  fprintf(stderr, "\n"); +  } +     return pop_unfinished_type();    }