Objective-C, Darwin : Update message call codegen.
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 29 Sep 2020 18:16:12 +0000 (19:16 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 11 Oct 2020 12:38:29 +0000 (13:38 +0100)
commit3ba0afac60e80851c01541364d8991667809cec0
tree675129c31e9eb11d53a9bbc4a4642f5e48cc1683
parent75d4d7bc697dd1853e89a93e6c4fa1db9a709bc0
Objective-C, Darwin : Update message call codegen.

Platform compilers based on LLVM do not use the objc_sendMsg_fixit
and friends for newer editions of the OS (runtimes for Arm64 do not even
have those entries).

We need to arrange to allow for this codegen on modern Darwin.

The _fixit versions are needed for some OS versions (at least, up to
10.6) since the super2 call is not implemented there.  It does not
seem worth making the codegen more fine-grained at present.

Other parts of the codegen need to be made conditional on either the
runtime version or the linker capabilities.

gcc/objc/ChangeLog:

* objc-next-runtime-abi-02.c (TAG_MSGSENDSUPER): Revised
spelling.
(TAG_MSGSENDID): Likewise.
(TAG_MSGSENDSUPER_STRET): Likewise.
(TAG_MSGSENDID_STRET): Likewise.
(FIXUP_NEEDED): Likewise.
(TAG_FIXUP): New.
(next_runtime_02_initialize): Adjust message calls to use
fixup variants only when required.
(next_runtime_abi_02_get_arg_type_list_base): Correct
indent.
(build_v2_build_objc_method_call): New.
(build_v2_objc_method_fixup_call): Split out from ...
(next_runtime_abi_02_build_objc_method_call): ... here.
Arrange to adjust the call on the basis of the target
runtime.
gcc/objc/objc-next-runtime-abi-02.c