[X86] Remove unneeded parameters and deduplicate stack alignment code

NFC

llvm-svn: 240033
diff --git a/llvm/lib/Target/X86/X86FrameLowering.h b/llvm/lib/Target/X86/X86FrameLowering.h
index 38d21e8..13c4c31 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.h
+++ b/llvm/lib/Target/X86/X86FrameLowering.h
@@ -18,6 +18,7 @@
 
 namespace llvm {
 
+class MCCFIInstruction;
 class X86Subtarget;
 class X86RegisterInfo;
 
@@ -43,6 +44,8 @@
   /// instruction operands should be used to manipulate StackPtr and FramePtr.
   bool Uses64BitFramePtr;
 
+  unsigned StackPtr;
+
   /// Emit a call to the target's stack probe function. This is required for all
   /// large stack allocations on Windows. The caller is required to materialize
   /// the number of bytes to probe in RAX/EAX.
@@ -104,15 +107,12 @@
   /// stack adjustment is returned as a positive value for ADD/LEA and
   /// a negative for SUB.
   int mergeSPUpdates(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI,
-                     unsigned StackPtr, bool doMergeWithPrevious) const;
+                     bool doMergeWithPrevious) const;
 
   /// Emit a series of instructions to increment / decrement the stack
   /// pointer by a constant value.
   void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI,
-                    unsigned StackPtr, int64_t NumBytes, bool Is64BitTarget,
-                    bool Is64BitStackPtr, bool UseLEA,
-                    const TargetInstrInfo &TII,
-                    const TargetRegisterInfo &TRI) const;
+                    int64_t NumBytes, bool UseLEA) const;
 
   /// Check that LEA can be used on SP in an epilogue sequence for \p MF.
   bool canUseLEAForSPInEpilogue(const MachineFunction &MF) const;
@@ -135,6 +135,15 @@
                               uint64_t Amount) const;
 
   uint64_t calculateMaxStackAlign(const MachineFunction &MF) const;
+
+  /// Wraps up getting a CFI index and building a MachineInstr for it.
+  void BuildCFI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
+                DebugLoc DL, MCCFIInstruction CFIInst) const;
+
+  /// Aligns the stack pointer by ANDing it with -MaxAlign.
+  void BuildStackAlignAND(MachineBasicBlock &MBB,
+                          MachineBasicBlock::iterator MBBI, DebugLoc DL,
+                          uint64_t MaxAlign) const;
 };
 
 } // End llvm namespace