1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Don't count inreg params when mangling fastcall functions

This is consistent with MSVC.

llvm-svn: 214981
This commit is contained in:
Reid Kleckner 2014-08-06 18:09:04 +00:00
parent e340c78d47
commit bec7530633
3 changed files with 5 additions and 3 deletions

View File

@ -72,6 +72,9 @@ static void AddFastCallStdCallSuffix(raw_ostream &OS, const Function *F,
unsigned ArgWords = 0;
for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
AI != AE; ++AI) {
// Skip arguments in registers to handle typical fastcall lowering.
if (F->getAttributes().hasAttribute(AI->getArgNo() + 1, Attribute::InReg))
continue;
Type *Ty = AI->getType();
// 'Dereference' type in case of byval or inalloca parameter attribute.
if (AI->hasByValOrInAllocaAttr())

View File

@ -23,6 +23,5 @@ define x86_thiscallcc void @g(i8* %this, %struct.Six* byval %a) {
define x86_fastcallcc void @h(i32 inreg %x, i32 inreg %y, %struct.Six* byval %a) {
ret void
}
; FIXME: This should be @h@8.
; CHECK-LABEL: @h@16:
; CHECK-LABEL: @h@8:
; CHECK: retl $8

View File

@ -109,7 +109,7 @@ entry:
ret i32 %3
}
; CHECK-LABEL: @fastcall_thunk@8:
; CHECK-LABEL: @fastcall_thunk@4:
; CHECK-NOT: mov %{{.*}}, {{.*(.*esp.*)}}
; CHECK: jmpl
; CHECK-NOT: ret