Add support for Objective-C method implementation with Odin calling convention.

Use @objc_context_provider to provide a context for a type.
This commit is contained in:
Harold Brenes
2025-04-23 01:41:38 -04:00
parent 730c844fc6
commit 47abea1229
6 changed files with 169 additions and 22 deletions
+23
View File
@@ -874,6 +874,29 @@ gb_internal Type *base_type(Type *t) {
return t;
}
gb_internal Type *base_named_type(Type *t) {
if (t->kind != Type_Named) {
return t_invalid;
}
Type *prev_named = t;
t = t->Named.base;
for (;;) {
if (t == nullptr) {
break;
}
if (t->kind != Type_Named) {
break;
}
if (t == t->Named.base) {
return t_invalid;
}
prev_named = t;
t = t->Named.base;
}
return prev_named;
}
gb_internal Type *base_enum_type(Type *t) {
Type *bt = base_type(t);
if (bt != nullptr &&