aboutsummaryrefslogtreecommitdiff
path: root/src/entity.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-02-11 22:54:51 +0000
committergingerBill <bill@gingerbill.org>2022-02-11 22:54:51 +0000
commitf8afda3b221f6c2279a393c2c0fb8ab7ea1d59df (patch)
tree650b932fc9e448dfe283932636195abf71c7d77b /src/entity.cpp
parent416413bebfcddf2b7ae2bf20fb01b675339297eb (diff)
Add more objc attributes
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index 4d5b3b9e1..df8ee3faa 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -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;