Align stack size to DWORD boundary
authorAnton Korobeynikov <asl@math.spbu.ru>
Sat, 14 Oct 2006 20:53:35 +0000 (20:53 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sat, 14 Oct 2006 20:53:35 +0000 (20:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30964 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86AsmPrinter.cpp

index 4ab72eef8ef167d6473961a2f900af1eb87ed04c..829219dac5bc0d9b8c9fedf47c6599cacc3f1754 100644 (file)
@@ -53,6 +53,9 @@ static X86FunctionInfo calculateFunctionInfo(const Function *F,
        AI != AE; ++AI)
     Size += TD->getTypeSize(AI->getType());
 
+  // Size should be aligned to DWORD boundary
+  Size = ((Size + 3)/4)*4;
+  
   // We're not supporting tooooo huge arguments :)
   Info.setBytesToPopOnReturn((unsigned int)Size);
   return Info;