Rewrite objc SEL/Class register handling code

This commit is contained in:
gingerBill
2025-04-03 09:33:14 +01:00
parent d31ad3cd7f
commit cd5bef4f61
4 changed files with 96 additions and 90 deletions
+11 -10
View File
@@ -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;
};