summaryrefslogtreecommitdiff
path: root/parse/node.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-15 00:11:44 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-15 00:11:44 -0800
commit994b042eac3300dd62bbbc7dedbb6d9a0b525638 (patch)
tree79d2ac32ff3d01168ddd270a77aecd3a41b0f2dc /parse/node.c
parent64a7a7346e02999cf451ee45220b86ba7c69c56f (diff)
downloadmc-994b042eac3300dd62bbbc7dedbb6d9a0b525638.tar.gz
More fixes to void values.
We now unbreak varargs, and compare them correctly.
Diffstat (limited to 'parse/node.c')
-rw-r--r--parse/node.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/parse/node.c b/parse/node.c
index 8d0decf..1f1309a 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -221,8 +221,6 @@ Node *mkimplstmt(Srcloc loc, Node *name, Type *t, Node **decls, size_t ndecls)
return n;
}
-Node *mkintlit(Srcloc loc, uvlong val) { return mkexpr(loc, Olit, mkint(loc, val), NULL); }
-
Node *mklbl(Srcloc loc, char *lbl)
{
Node *n;
@@ -273,6 +271,10 @@ Node *mkint(Srcloc loc, uint64_t val)
return n;
}
+Node *mkintlit(Srcloc loc, uvlong val) {
+ return mkexpr(loc, Olit, mkint(loc, val), NULL);
+}
+
Node *mkchar(Srcloc loc, uint32_t val)
{
Node *n;
@@ -374,6 +376,14 @@ Node *mkbool(Srcloc loc, int val)
return n;
}
+Node *mkboollit(Srcloc loc, int val) {
+ Node *e;
+
+ e = mkexpr(loc, Olit, mkbool(loc, val), NULL);
+ e->expr.type = mktype(loc, Tybool);
+ return e;
+}
+
Node *mkvoid(Srcloc loc)
{
Node *n;