simplify some overly general code. The stack always grows down on x86.
authorChris Lattner <sabre@nondot.org>
Sat, 13 Mar 2010 08:04:35 +0000 (08:04 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 13 Mar 2010 08:04:35 +0000 (08:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98431 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86RegisterInfo.cpp

index 3c087bdeb989e141dbf08ee00a415ed2c184e2ce..d3a5b15d8fda9065defbea8db24358bd701fe670 100644 (file)
@@ -938,10 +938,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
   std::vector<MachineMove> &Moves = MMI->getFrameMoves();
   const TargetData *TD = MF.getTarget().getTargetData();
   uint64_t NumBytes = 0;
-  int stackGrowth =
-    (MF.getTarget().getFrameInfo()->getStackGrowthDirection() ==
-     TargetFrameInfo::StackGrowsUp ?
-       TD->getPointerSize() : -TD->getPointerSize());
+  int stackGrowth = -TD->getPointerSize();
 
   if (HasFP) {
     // Calculate required stack adjustment.
@@ -978,8 +975,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
       }
 
       // Change the rule for the FramePtr to be an "offset" rule.
-      MachineLocation FPDst(MachineLocation::VirtualFP,
-                            2 * stackGrowth);
+      MachineLocation FPDst(MachineLocation::VirtualFP, 2 * stackGrowth);
       MachineLocation FPSrc(FramePtr);
       Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc));
     }