Give struct vpi_ref a magic

to be able to use our standard miniobj facilities on it, PAN_dump_struct
in this case.

As vpi_ref is static const in VGC, there is no real reason for magic
checks other than that.
parent 21eb6a17
...@@ -46,6 +46,8 @@ void v_noreturn_ VPI_Fail(const char *func, const char *file, int line, ...@@ -46,6 +46,8 @@ void v_noreturn_ VPI_Fail(const char *func, const char *file, int line,
*/ */
struct vpi_ref { struct vpi_ref {
unsigned magic;
#define VPI_REF_MAGIC 0xd955f567
unsigned source; unsigned source;
unsigned offset; unsigned offset;
unsigned line; unsigned line;
......
...@@ -410,7 +410,7 @@ EmitCoordinates(const struct vcc *tl, struct vsb *vsb) ...@@ -410,7 +410,7 @@ EmitCoordinates(const struct vcc *tl, struct vsb *vsb)
pos++; pos++;
} }
VSB_printf(vsb, " [%3u] = { %u, %8tu, %4u, %3u, ", VSB_printf(vsb, " [%3u] = { VPI_REF_MAGIC, %u, %8tu, %4u, %3u, ",
t->cnt, sp->idx, t->b - sp->b, lin, pos + 1); t->cnt, sp->idx, t->b - sp->b, lin, pos + 1);
if (t->tok == CSRC) if (t->tok == CSRC)
VSB_cat(vsb, " \"C{\"},\n"); VSB_cat(vsb, " \"C{\"},\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment