aboutsummaryrefslogtreecommitdiff
path: root/src/entity.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2022-02-15 15:48:56 +0000
committerGitHub <noreply@github.com>2022-02-15 15:48:56 +0000
commit9e98494fff550c84a6d9c73032f3c9556f9b4c43 (patch)
tree3448b7b6dd725433a57e16348eb2d7e688e565ad /src/entity.cpp
parent86d334282cf039860ddd9e894fbb552c1111ca4f (diff)
parent803648be894659409beb3c2b5e76b7b491ddf7c5 (diff)
Merge pull request #1482 from odin-lang/objc-intrinsics
Improve support Objective-C code through intrinsics and Metal API
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index 8327a517e..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;
@@ -186,6 +208,8 @@ struct Entity {
Type * type_parameter_specialization;
String ir_mangled_name;
bool is_type_alias;
+ String objc_class_name;
+ TypeNameObjCMetadata *objc_metadata;
} TypeName;
struct {
u64 tags;