/3rd_party/llvm/lib/Target/X86/X86FrameLowering.h

https://code.google.com/p/softart/ · C++ Header · 76 lines · 45 code · 17 blank · 14 comment · 0 complexity · 6014a25dcc25c462df8edcb1fb535428 MD5 · raw file

  1. //===-- X86TargetFrameLowering.h - Define frame lowering for X86 -*- C++ -*-==//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This class implements X86-specific bits of TargetFrameLowering class.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef X86_FRAMELOWERING_H
  14. #define X86_FRAMELOWERING_H
  15. #include "X86Subtarget.h"
  16. #include "llvm/MC/MCDwarf.h"
  17. #include "llvm/Target/TargetFrameLowering.h"
  18. namespace llvm {
  19. class MCSymbol;
  20. class X86TargetMachine;
  21. class X86FrameLowering : public TargetFrameLowering {
  22. const X86TargetMachine &TM;
  23. const X86Subtarget &STI;
  24. public:
  25. explicit X86FrameLowering(const X86TargetMachine &tm, const X86Subtarget &sti)
  26. : TargetFrameLowering(StackGrowsDown,
  27. sti.getStackAlignment(),
  28. (sti.is64Bit() ? -8 : -4)),
  29. TM(tm), STI(sti) {
  30. }
  31. void emitCalleeSavedFrameMoves(MachineFunction &MF, MCSymbol *Label,
  32. unsigned FramePtr) const;
  33. /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
  34. /// the function.
  35. void emitPrologue(MachineFunction &MF) const;
  36. void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
  37. void adjustForSegmentedStacks(MachineFunction &MF) const;
  38. void adjustForHiPEPrologue(MachineFunction &MF) const;
  39. void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
  40. RegScavenger *RS = NULL) const;
  41. bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
  42. MachineBasicBlock::iterator MI,
  43. const std::vector<CalleeSavedInfo> &CSI,
  44. const TargetRegisterInfo *TRI) const;
  45. bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
  46. MachineBasicBlock::iterator MI,
  47. const std::vector<CalleeSavedInfo> &CSI,
  48. const TargetRegisterInfo *TRI) const;
  49. bool hasFP(const MachineFunction &MF) const;
  50. bool hasReservedCallFrame(const MachineFunction &MF) const;
  51. int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
  52. int getFrameIndexReference(const MachineFunction &MF, int FI,
  53. unsigned &FrameReg) const;
  54. void eliminateCallFramePseudoInstr(MachineFunction &MF,
  55. MachineBasicBlock &MBB,
  56. MachineBasicBlock::iterator MI) const;
  57. };
  58. } // End llvm namespace
  59. #endif