aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-04-19 21:45:04 +0100
committergingerBill <bill@gingerbill.org>2020-04-19 21:45:04 +0100
commit97f7a558faaf206bb7d10eaf3adce99322fd9541 (patch)
tree2a3e8f91525692f14de4064751efae62699f10bb /src/types.cpp
parent2c91c21021e1c4d1d675ee430e0d7ccf88e882be (diff)
`#optional_ok` tag for procedures
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp9
1 files changed, 6 insertions, 3 deletions
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<Type *> 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);
}