Silence -Wunused-variable in release builds.
[llvm/stm8.git] / lib / Target / XCore / XCoreRegisterInfo.h
blob801d9eba21712cd2c8710782b55d34d9a3c7f41c
1 //===- XCoreRegisterInfo.h - XCore Register Information Impl ----*- 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 file contains the XCore implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef XCOREREGISTERINFO_H
15 #define XCOREREGISTERINFO_H
17 #include "llvm/Target/TargetRegisterInfo.h"
19 #define GET_REGINFO_HEADER
20 #include "XCoreGenRegisterInfo.inc"
22 namespace llvm {
24 class TargetInstrInfo;
26 struct XCoreRegisterInfo : public XCoreGenRegisterInfo {
27 private:
28 const TargetInstrInfo &TII;
30 void loadConstant(MachineBasicBlock &MBB,
31 MachineBasicBlock::iterator I,
32 unsigned DstReg, int64_t Value, DebugLoc dl) const;
34 void storeToStack(MachineBasicBlock &MBB,
35 MachineBasicBlock::iterator I,
36 unsigned SrcReg, int Offset, DebugLoc dl) const;
38 void loadFromStack(MachineBasicBlock &MBB,
39 MachineBasicBlock::iterator I,
40 unsigned DstReg, int Offset, DebugLoc dl) const;
42 public:
43 XCoreRegisterInfo(const TargetInstrInfo &tii);
45 /// Code Generation virtual methods...
47 const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
49 BitVector getReservedRegs(const MachineFunction &MF) const;
51 bool requiresRegisterScavenging(const MachineFunction &MF) const;
53 bool useFPForScavengingIndex(const MachineFunction &MF) const;
55 void eliminateCallFramePseudoInstr(MachineFunction &MF,
56 MachineBasicBlock &MBB,
57 MachineBasicBlock::iterator I) const;
59 void eliminateFrameIndex(MachineBasicBlock::iterator II,
60 int SPAdj, RegScavenger *RS = NULL) const;
62 // Debug information queries.
63 unsigned getRARegister() const;
64 unsigned getFrameRegister(const MachineFunction &MF) const;
66 //! Return the array of argument passing registers
67 /*!
68 \note The size of this array is returned by getArgRegsSize().
70 static const unsigned *getArgRegs(const MachineFunction *MF = 0);
72 //! Return the size of the argument passing register array
73 static unsigned getNumArgRegs(const MachineFunction *MF = 0);
75 //! Return whether to emit frame moves
76 static bool needsFrameMoves(const MachineFunction &MF);
78 //! Get DWARF debugging register number
79 int getDwarfRegNum(unsigned RegNum, bool isEH) const;
80 int getLLVMRegNum(unsigned RegNum, bool isEH) const;
83 } // end namespace llvm
85 #endif