mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-09 06:23:14 +00:00
Add more objc attributes
This commit is contained in:
@@ -122,6 +122,28 @@ enum ProcedureOptimizationMode : u32 {
|
||||
ProcedureOptimizationMode_Speed,
|
||||
};
|
||||
|
||||
|
||||
BlockingMutex global_type_name_objc_metadata_mutex;
|
||||
|
||||
struct TypeNameObjCMetadataEntry {
|
||||
String name;
|
||||
Entity *entity;
|
||||
};
|
||||
struct TypeNameObjCMetadata {
|
||||
BlockingMutex *mutex;
|
||||
Array<TypeNameObjCMetadataEntry> type_entries;
|
||||
Array<TypeNameObjCMetadataEntry> value_entries;
|
||||
};
|
||||
|
||||
TypeNameObjCMetadata *create_type_name_obj_c_metadata() {
|
||||
TypeNameObjCMetadata *md = gb_alloc_item(permanent_allocator(), TypeNameObjCMetadata);
|
||||
md->mutex = gb_alloc_item(permanent_allocator(), BlockingMutex);
|
||||
mutex_init(md->mutex);
|
||||
array_init(&md->type_entries, heap_allocator());
|
||||
array_init(&md->value_entries, heap_allocator());
|
||||
return md;
|
||||
}
|
||||
|
||||
// An Entity is a named "thing" in the language
|
||||
struct Entity {
|
||||
EntityKind kind;
|
||||
@@ -187,6 +209,7 @@ struct Entity {
|
||||
String ir_mangled_name;
|
||||
bool is_type_alias;
|
||||
String objc_class_name;
|
||||
TypeNameObjCMetadata *objc_metadata;
|
||||
} TypeName;
|
||||
struct {
|
||||
u64 tags;
|
||||
|
||||
Reference in New Issue
Block a user