diff options
| author | Harold Brenes <harold@hbrenes.com> | 2025-04-22 19:16:29 -0400 |
|---|---|---|
| committer | Harold Brenes <harold@hbrenes.com> | 2025-04-22 19:18:53 -0400 |
| commit | bca02f81cd5affa288bac0cc0ed08fe730072aec (patch) | |
| tree | 1a8cea710264b1cbacc079fb516ba800320e4341 /src/llvm_backend.cpp | |
| parent | b3b4d501ca6c1af70c0ceef7610f6c5d83a2d296 (diff) | |
Include the ivar in the Objective-C class unconditionally of it being used or not.
Allow pseudo-fields for ivar access.
Diffstat (limited to 'src/llvm_backend.cpp')
| -rw-r--r-- | src/llvm_backend.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index ef975b8c1..257625849 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -1707,9 +1707,8 @@ gb_internal void lb_finalize_objc_names(lbGenerator *gen, lbProcedure *p) { // Add ivar if we have one Type *ivar_type = class_type->Named.type_name->TypeName.objc_ivar; - lbObjCGlobal *g_ivar = map_get(&ivar_map, class_type); - if (ivar_type != nullptr && g_ivar != nullptr) { + if (ivar_type != nullptr) { // Register a single ivar for this class Type *ivar_base = ivar_type->Named.base; // TODO(harold): No idea if I can use this, but I assume so? @@ -1734,7 +1733,7 @@ gb_internal void lb_finalize_objc_names(lbGenerator *gen, lbProcedure *p) { lb_emit_runtime_call(p, "objc_registerClassPair", args); } - // Register ivars + // Register ivar offsets for any `objc_ivar_get` expressions emitted. Type *ptr_u32 = alloc_type_pointer(t_u32); for (auto const& kv : ivar_map) { lbObjCGlobal const& g = kv.value; |