Ensure that fastcall'ed function is correctly mangled & stack is

properly aligned


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34788 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov
2007-03-01 16:29:22 +00:00
parent 43c6e7cd9b
commit 9dd9abd87f
4 changed files with 28 additions and 14 deletions

View File

@@ -49,10 +49,8 @@ static X86FunctionInfo calculateFunctionInfo(const Function *F,
for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
AI != AE; ++AI)
Size += TD->getTypeSize(AI->getType());
// Size should be aligned to DWORD boundary
Size = ((Size + 3)/4)*4;
// Size should be aligned to DWORD boundary
Size += ((TD->getTypeSize(AI->getType()) + 3)/4)*4;
// We're not supporting tooooo huge arguments :)
Info.setBytesToPopOnReturn((unsigned int)Size);