[all-commits] [llvm/llvm-project] b8a50e: [MS] Simplify rules for passing C++ records

Reid Kleckner via All-commits all-commits at lists.llvm.org
Thu Sep 24 16:30:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b8a50e920704436ddcbe0cc9d2020935d7e37095
      https://github.com/llvm/llvm-project/commit/b8a50e920704436ddcbe0cc9d2020935d7e37095
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-09-24 (Thu, 24 Sep 2020)

  Changed paths:
    M clang/lib/CodeGen/MicrosoftCXXABI.cpp
    M clang/test/CodeGenCXX/inalloca-overaligned.cpp

  Log Message:
  -----------
  [MS] Simplify rules for passing C++ records

Regardless of the target architecture, we should always use the C rules
(RAA_Default) for records that "canBePassedInRegisters". Those are
trivially copyable things, and things marked with [[trivial_abi]].

This should be NFC, although it changes where the final decision about
x86_32 overaligned records is made. The current x86_32 C rules say that
overaligned things are passed indirectly, so there is no functional
difference.


  Commit: ecfc9b971269a86b101cddf1fd9f0976be4096d0
      https://github.com/llvm/llvm-project/commit/ecfc9b971269a86b101cddf1fd9f0976be4096d0
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-09-24 (Thu, 24 Sep 2020)

  Changed paths:
    M clang/lib/CodeGen/MicrosoftCXXABI.cpp
    A clang/test/CodeGenCXX/microsoft-abi-unknown-arch.cpp

  Log Message:
  -----------
  [MS] For unknown ISAs, pass non-trivially copyable arguments indirectly

Passing them directly is likely to be non-conforming, since it usually
involves copying the bytes of the record. For unknown architectures, we
don't know what MSVC does or will do, but we should at least try to
conform as well as we can.


Compare: https://github.com/llvm/llvm-project/compare/43804364e2bc...ecfc9b971269


More information about the All-commits mailing list