[all-commits] [llvm/llvm-project] aa4bca: Remove the unused/undefined `_cmd` parameter in `o...

Michael Wyman via All-commits all-commits at lists.llvm.org
Wed Sep 21 15:45:36 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aa4bcaab9600b42165587ec6f135399ff933bd14
      https://github.com/llvm/llvm-project/commit/aa4bcaab9600b42165587ec6f135399ff933bd14
  Author: Michael Wyman <michael at mwyman.com>
  Date:   2022-09-21 (Wed, 21 Sep 2022)

  Changed paths:
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGObjC.cpp
    M clang/lib/CodeGen/CGObjCMac.cpp
    M clang/test/CodeGenObjC/direct-method.m

  Log Message:
  -----------
  Remove the unused/undefined `_cmd` parameter in `objc_direct` methods.

When `objc_direct` methods were implemented, the implicit `_cmd` parameter was left as an argument to the method implementation function, but was unset by callers; if the method body referenced the `_cmd` variable, a selector load would be emitted inside the body. However, this leaves an unused argument in the ABI, and is unnecessary.

This change removes the empty/unset argument, and if `_cmd` is referenced inside an `objc_direct` method it will emit local storage for the implicit variable. From the ABI perspective, `objc_direct` methods will have the implicit `self` parameter, immediately followed by whatever explicit arguments are defined on the method, rather than having one unset/undefined register in the middle.

Differential Revision: https://reviews.llvm.org/D131424




More information about the All-commits mailing list