summaryrefslogtreecommitdiff
path: root/parse/dump.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-06-18 12:59:26 -0400
committerOri Bernstein <ori@eigenstate.org>2013-06-18 12:59:26 -0400
commit8c2fb645b95fa69e53e910102c601f3a80007251 (patch)
treee48319b535302bb6c39342831739eb04c05ad688 /parse/dump.c
parentbc18d36c3cf2e2ceea1e78a21242423d6878ed12 (diff)
downloadmc-8c2fb645b95fa69e53e910102c601f3a80007251.tar.gz
Move away from literal types that aren't actual compile time constants.
Diffstat (limited to 'parse/dump.c')
-rw-r--r--parse/dump.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/parse/dump.c b/parse/dump.c
index 5ce0c48..6dff854 100644
--- a/parse/dump.c
+++ b/parse/dump.c
@@ -61,6 +61,7 @@ static void outstab(Stab *st, FILE *fd, int depth)
size_t i, n;
void **k;
char *ty;
+ Type *t;
indent(fd, depth);
fprintf(fd, "Stab %p (super = %p, name=\"%s\")\n", st, st->super, namestr(st->name));
@@ -74,8 +75,9 @@ static void outstab(Stab *st, FILE *fd, int depth)
fprintf(fd, "T ");
/* already indented */
outname(k[i], fd);
- ty = tystr(gettype(st, k[i]));
- fprintf(fd, " = %s\n", ty);
+ t = gettype(st, k[i]);
+ ty = tystr(t);
+ fprintf(fd, " = %s [tid=%d]\n", ty, t->tid);
free(ty);
}
free(k);
@@ -172,9 +174,10 @@ static void outnode(Node *n, FILE *fd, int depth)
break;
case Nexpr:
ty = tystr(n->expr.type);
- fprintf(fd, " (type = %s, op = %s, isconst = %d, did=%zd)\n",
- ty, opstr(n->expr.op), n->expr.isconst, n->expr.did);
+ fprintf(fd, " (type = %s [tid %d], op = %s, isconst = %d, did=%zd)\n",
+ ty, n->expr.type->tid, opstr(n->expr.op), n->expr.isconst, n->expr.did);
free(ty);
+ outnode(n->expr.idx, fd, depth + 1);
for (i = 0; i < n->expr.nargs; i++)
outnode(n->expr.args[i], fd, depth+1);
break;
@@ -190,16 +193,6 @@ static void outnode(Node *n, FILE *fd, int depth)
fprintf(fd, " Lfunc\n");
outnode(n->lit.fnval, fd, depth+1);
break;
- case Larray:
- fprintf(fd, " Larray\n");
- for (i = 0; i < n->lit.nelt; i++)
- outnode(n->lit.seqval[i], fd, depth+1);
- break;
- case Lstruct:
- fprintf(fd, " Lstruct\n");
- for (i = 0; i < n->lit.nelt; i++)
- outnode(n->lit.seqval[i], fd, depth+1);
- break;
}
break;
case Nfunc:
@@ -222,11 +215,6 @@ static void outnode(Node *n, FILE *fd, int depth)
fprintf(stderr, "Nnone not a real node type!");
fprintf(fd, "Nnone\n");
break;
- case Nidxinit:
- fprintf(fd, "\n");
- outnode(n->idxinit.idx, fd, depth + 1);
- outnode(n->idxinit.init, fd, depth + 1);
- break;
}
}