aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
diff options
context:
space:
mode:
Diffstat (limited to 'qbe.c')
-rw-r--r--qbe.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/qbe.c b/qbe.c
index a20851d..ceede55 100644
--- a/qbe.c
+++ b/qbe.c
@@ -71,6 +71,15 @@ struct switchcase {
struct value *body;
};
+struct function {
+ char *name;
+ struct declaration *namedecl;
+ struct type *type;
+ struct block *start, *end;
+ struct hashtable *gotos;
+ uint64_t lastid;
+};
+
struct representation i8 = {'w', 'b'};
struct representation i16 = {'w', 'h'};
struct representation i32 = {'w', 'w'};
@@ -397,6 +406,12 @@ mkfunc(char *name, struct type *t, struct scope *s)
return f;
}
+struct type *
+functype(struct function *f)
+{
+ return f->type;
+}
+
void
funclabel(struct function *f, struct value *v)
{