locations
[ccc.git] / ast.c
diff --git a/ast.c b/ast.c
index cb484c4..8b087f0 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -229,6 +229,14 @@ struct expr *expr_unop(enum unop op, struct expr *l)
        return res;
 }
 
+struct type *type_basic(enum basictype type)
+{
+       struct type *res = safe_malloc(sizeof(struct type));
+       res->type = tbasic;
+       res->data.tbasic = type;
+       return res;
+}
+
 struct type *type_list(struct type *type)
 {
        struct type *res = safe_malloc(sizeof(struct type));