aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/cc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/cc/cc.c')
-rw-r--r--sys/cmd/cc/cc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/cmd/cc/cc.c b/sys/cmd/cc/cc.c
index d5cd995..a25fd69 100644
--- a/sys/cmd/cc/cc.c
+++ b/sys/cmd/cc/cc.c
@@ -94,6 +94,19 @@ END:
// -----------------------------------------------------------------------
// type interning
+Type *
+type()
+{
+ Type *t;
+
+ if (C.type.len >= C.type.cap) {
+ C.type.cap += 100;
+ C.type.info = realloc(C.type.info, C.type.cap * sizeof(*C.type.info));
+ }
+
+ return C.type.info + C.type.len++;
+}
+
// -----------------------------------------------------------------------
// universal compiler builtins