aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.hpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2025-04-03 09:33:14 +0100
committergingerBill <bill@gingerbill.org>2025-04-03 09:37:38 +0100
commitcd5bef4f610ec3ee32957cbca354ccbfef310921 (patch)
tree5fd9959ab6d0c36f6a76ae15a16b42ed7bda6275 /src/llvm_backend.hpp
parentd31ad3cd7fbc2dcbc42f2edfa4adacbaf75770ad (diff)
Rewrite objc SEL/Class register handling code
Diffstat (limited to 'src/llvm_backend.hpp')
-rw-r--r--src/llvm_backend.hpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/llvm_backend.hpp b/src/llvm_backend.hpp
index f9f96a906..3e01ada5f 100644
--- a/src/llvm_backend.hpp
+++ b/src/llvm_backend.hpp
@@ -143,11 +143,6 @@ struct lbPadType {
LLVMTypeRef type;
};
-struct lbObjcRef {
- Entity * entity;
- lbAddr local_module_addr;
-};
-
struct lbModule {
LLVMModuleRef mod;
LLVMContextRef ctx;
@@ -199,11 +194,8 @@ struct lbModule {
PtrMap<void *, LLVMMetadataRef> debug_values;
- RecursiveMutex objc_classes_mutex;
- RecursiveMutex objc_selectors_mutex;
-
- StringMap<lbObjcRef> objc_classes;
- StringMap<lbObjcRef> objc_selectors;
+ StringMap<lbAddr> objc_classes;
+ StringMap<lbAddr> objc_selectors;
PtrMap<u64/*type hash*/, lbAddr> map_cell_info_map; // address of runtime.Map_Info
PtrMap<u64/*type hash*/, lbAddr> map_info_map; // address of runtime.Map_Cell_Info
@@ -222,6 +214,13 @@ struct lbEntityCorrection {
char const *cname;
};
+struct lbObjCGlobal {
+ lbModule *module;
+ gbString global_name;
+ String name;
+ Type * type;
+};
+
struct lbGenerator : LinkerData {
CheckerInfo *info;
@@ -239,6 +238,8 @@ struct lbGenerator : LinkerData {
lbProcedure *objc_names;
MPSCQueue<lbEntityCorrection> entities_to_correct_linkage;
+ MPSCQueue<lbObjCGlobal> objc_selectors;
+ MPSCQueue<lbObjCGlobal> objc_classes;
};