[Mangler] Calculate the argument list byte count suffix correctly when returning...
authorWesley Wiser <wesleywiser@microsoft.com>
Wed, 29 Sep 2021 18:36:13 +0000 (11:36 -0700)
committerReid Kleckner <rnk@google.com>
Wed, 29 Sep 2021 18:42:28 +0000 (11:42 -0700)
commit2dd883439c7886182902c0aa17b34c0a8ed88b66
treea07dbae8a6daef767f0c94fe6f09a27ce1bd4e37
parent385b2189cc4446745e1ea4ac803c22b3daef73ec
[Mangler] Calculate the argument list byte count suffix correctly when returning large values

`__stdcall`, `__fastcall` and `__vectorcall` return large values via a
hidden pointer argument. However, the size of that argument should not
be included in the argument list byte count suffix added to the
function's decorated name.

This patch fixes that issue so that LLVM generates the same decorated
name as MSVC does.

MSVC example: https://godbolt.org/z/nc35MKPhr

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D110719
llvm/lib/IR/Mangler.cpp
llvm/test/CodeGen/X86/stdcall.ll
llvm/test/CodeGen/X86/vectorcall.ll