• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- AVRRegisterInfo.h - AVR 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 AVR implementation of the TargetRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_AVR_REGISTER_INFO_H
15 #define LLVM_AVR_REGISTER_INFO_H
16 
17 #include "llvm/CodeGen/TargetRegisterInfo.h"
18 
19 #define GET_REGINFO_HEADER
20 #include "AVRGenRegisterInfo.inc"
21 
22 namespace llvm {
23 
24 /// Utilities relating to AVR registers.
25 class AVRRegisterInfo : public AVRGenRegisterInfo {
26 public:
27   AVRRegisterInfo();
28 
29 public:
30   const uint16_t *
31   getCalleeSavedRegs(const MachineFunction *MF = 0) const override;
32   const uint32_t *getCallPreservedMask(const MachineFunction &MF,
33                                        CallingConv::ID CC) const override;
34   BitVector getReservedRegs(const MachineFunction &MF) const override;
35 
36   const TargetRegisterClass *
37   getLargestLegalSuperClass(const TargetRegisterClass *RC,
38                             const MachineFunction &MF) const override;
39 
40   /// Stack Frame Processing Methods
41   void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
42                            unsigned FIOperandNum,
43                            RegScavenger *RS = NULL) const override;
44 
45   unsigned getFrameRegister(const MachineFunction &MF) const override;
46 
47   const TargetRegisterClass *
48   getPointerRegClass(const MachineFunction &MF,
49                      unsigned Kind = 0) const override;
50 
51   /// Splits a 16-bit `DREGS` register into the lo/hi register pair.
52   /// \param Reg A 16-bit register to split.
53   void splitReg(unsigned Reg, unsigned &LoReg, unsigned &HiReg) const;
54 
trackLivenessAfterRegAlloc(const MachineFunction &)55   bool trackLivenessAfterRegAlloc(const MachineFunction &) const override {
56     return true;
57   }
58 
59 };
60 
61 } // end namespace llvm
62 
63 #endif // LLVM_AVR_REGISTER_INFO_H
64