[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

wanglei via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 23:47:59 PDT 2023


wangleiat created this revision.
wangleiat added reviewers: SixWeining, xen0n, xry111, gonglingqin.
Herald added a project: All.
wangleiat requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Prior to this patch, paramter or return value whose type was a
structure containing empty structure members and fewer than three
floating-point members did not meet the calling convention.

With this patch, an empty struct will always be passed.

An empty struct type that is not non-trivial for the purposes of calls
will be treated as though it were the following C type:

  struct {
    char c;
  };

Change-Id: If5c7f499d38d1853261dc1dae6620b8fc9db7fd3


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151298

Files:
  clang/docs/ReleaseNotes.rst
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGenCXX/LoongArch/abi-lp64d-empty-struct.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151298.525027.patch
Type: text/x-patch
Size: 7218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230524/3aa5dec0/attachment.bin>


More information about the cfe-commits mailing list