diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2022-02-14 18:32:10 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2022-02-14 18:32:10 +0000 |
| commit | 32c7e817450e8f089eec81a147d20b919db088ff (patch) | |
| tree | 66e9c197f484e6661cf3aeb96fae556285f81ac7 /src/llvm_backend_utility.cpp | |
| parent | 03aec70287714fb9d66864e6db0d9e6375c18362 (diff) | |
Use `objc_allocateClassPair` for `intrinsics.objc_register_class`
Diffstat (limited to 'src/llvm_backend_utility.cpp')
| -rw-r--r-- | src/llvm_backend_utility.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp index 75fb89314..98b7e07f0 100644 --- a/src/llvm_backend_utility.cpp +++ b/src/llvm_backend_utility.cpp @@ -1908,9 +1908,11 @@ lbValue lb_handle_objc_register_class(lbProcedure *p, Ast *expr) { String name = tav.value.value_string; lbAddr dst = lb_handle_objc_find_or_register_class(p, name); - auto args = array_make<lbValue>(permanent_allocator(), 1); - args[0] = lb_const_value(m, t_cstring, exact_value_string(name)); - lbValue ptr = lb_emit_runtime_call(p, "objc_lookUpClass", args); + auto args = array_make<lbValue>(permanent_allocator(), 3); + args[0] = lb_const_nil(m, t_objc_Class); + args[1] = lb_const_nil(m, t_objc_Class); + args[2] = lb_const_int(m, t_uint, 0); + lbValue ptr = lb_emit_runtime_call(p, "objc_allocateClassPair", args); lb_addr_store(p, dst, ptr); return lb_addr_load(p, dst); |