From 97f7a558faaf206bb7d10eaf3adce99322fd9541 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 19 Apr 2020 21:45:04 +0100 Subject: `#optional_ok` tag for procedures --- src/types.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/types.cpp') diff --git a/src/types.cpp b/src/types.cpp index 530a02df7..1590d0a43 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -232,6 +232,7 @@ struct TypeUnion { Array abi_compat_params; \ Type * abi_compat_result_type; \ i32 variadic_index; \ + /* TODO(bill): Make this a flag set rather than bools */ \ bool variadic; \ bool abi_types_set; \ bool require_results; \ @@ -242,6 +243,7 @@ struct TypeUnion { bool has_named_results; \ bool diverging; /* no return */ \ bool return_by_pointer; \ + bool optional_ok; \ u64 tags; \ isize specialization_count; \ ProcCallingConvention calling_convention; \ @@ -1979,9 +1981,10 @@ bool are_types_identical(Type *x, Type *y) { case Type_Proc: if (y->kind == Type_Proc) { return x->Proc.calling_convention == y->Proc.calling_convention && - x->Proc.c_vararg == y->Proc.c_vararg && - x->Proc.variadic == y->Proc.variadic && - x->Proc.diverging == y->Proc.diverging && + x->Proc.c_vararg == y->Proc.c_vararg && + x->Proc.variadic == y->Proc.variadic && + x->Proc.diverging == y->Proc.diverging && + x->Proc.optional_ok == y->Proc.optional_ok && are_types_identical(x->Proc.params, y->Proc.params) && are_types_identical(x->Proc.results, y->Proc.results); } -- cgit v1.2.3