[all-commits] [llvm/llvm-project] 87dc7d: [clang][CodeGen] Factor out Swift ABI hooks (NFCI)

Sergei Barannikov via All-commits all-commits at lists.llvm.org
Sun Aug 7 09:23:57 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 87dc7d4b619d9823b4d5d33bbc3ff3a193b9da2f
      https://github.com/llvm/llvm-project/commit/87dc7d4b619d9823b4d5d33bbc3ff3a193b9da2f
  Author: Sergei Barannikov <barannikov88 at gmail.com>
  Date:   2022-08-08 (Mon, 08 Aug 2022)

  Changed paths:
    M clang/lib/CodeGen/ABIInfo.h
    M clang/lib/CodeGen/SwiftCallingConv.cpp
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/lib/CodeGen/TargetInfo.h

  Log Message:
  -----------
  [clang][CodeGen] Factor out Swift ABI hooks (NFCI)

Swift calling conventions stands out in the way that they are lowered in
mostly target-independent manner, with very few customization points.
As such, swift-related methods of ABIInfo do not reference the rest of
ABIInfo and vice versa.
This change follows interface segregation principle; it removes
dependency of SwiftABIInfo on ABIInfo. Targets must now implement
SwiftABIInfo separately if they support Swift calling conventions.

Almost all targets implemented `shouldPassIndirectly` the same way. This
de-facto default implementation has been moved into the base class.

`isSwiftErrorInRegister` used to be virtual, now it is not. It didn't
accept any arguments which could have an effect on the returned value.
This is now a static property of the target ABI.

Reviewed By: rusyaev-roman, inclyc

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




More information about the All-commits mailing list