aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ast.c b/src/ast.c
index 89c8aea..790eb81 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -88,6 +88,12 @@ Type* type_new(TypeKind kind) {
return ty;
}
+Type* type_dup(Type* src) {
+ Type* ty = malloc(sizeof(Type));
+ memcpy(ty, src, sizeof(Type));
+ return ty;
+}
+
Type* type_new_ptr(Type* base) {
Type* ty = type_new(TypeKind_ptr);
ty->base = base;