• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- AVRMachineFuctionInfo.h - AVR machine function info -----*- 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 declares AVR-specific per-machine-function information.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_AVR_MACHINE_FUNCTION_INFO_H
15 #define LLVM_AVR_MACHINE_FUNCTION_INFO_H
16 
17 #include "AVRConfig.h"
18 
19 #include "llvm/CodeGen/MachineFunction.h"
20 
21 namespace llvm {
22 
23 /**
24  * Contains AVR-specific information for each MachineFunction.
25  */
26 class AVRMachineFunctionInfo : public MachineFunctionInfo {
27   /// Indicates if a register has been spilled by the register
28   /// allocator.
29   bool HasSpills;
30 
31   /// Indicates if there are any fixed size allocas present.
32   /// Note that if there are only variable sized allocas this is set to false.
33   bool HasAllocas;
34 
35   /// Indicates if arguments passed using the stack are being
36   /// used inside the function.
37   bool HasStackArgs;
38 
39   /// Size of the callee-saved register portion of the
40   /// stack frame in bytes.
41   unsigned CalleeSavedFrameSize;
42 
43   /// FrameIndex for start of varargs area.
44   int VarArgsFrameIndex;
45 
46 public:
AVRMachineFunctionInfo()47   AVRMachineFunctionInfo()
48       : HasSpills(false), HasAllocas(false), HasStackArgs(false),
49         CalleeSavedFrameSize(0), VarArgsFrameIndex(0) {}
50 
AVRMachineFunctionInfo(MachineFunction & MF)51   explicit AVRMachineFunctionInfo(MachineFunction &MF)
52       : HasSpills(false), HasAllocas(false), HasStackArgs(false),
53         CalleeSavedFrameSize(0), VarArgsFrameIndex(0) {}
54 
getHasSpills()55   bool getHasSpills() const { return HasSpills; }
setHasSpills(bool B)56   void setHasSpills(bool B) { HasSpills = B; }
57 
getHasAllocas()58   bool getHasAllocas() const { return HasAllocas; }
setHasAllocas(bool B)59   void setHasAllocas(bool B) { HasAllocas = B; }
60 
getHasStackArgs()61   bool getHasStackArgs() const { return HasStackArgs; }
setHasStackArgs(bool B)62   void setHasStackArgs(bool B) { HasStackArgs = B; }
63 
getCalleeSavedFrameSize()64   unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
setCalleeSavedFrameSize(unsigned Bytes)65   void setCalleeSavedFrameSize(unsigned Bytes) { CalleeSavedFrameSize = Bytes; }
66 
getVarArgsFrameIndex()67   int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
setVarArgsFrameIndex(int Idx)68   void setVarArgsFrameIndex(int Idx) { VarArgsFrameIndex = Idx; }
69 };
70 
71 } // end llvm namespace
72 
73 #endif // LLVM_AVR_MACHINE_FUNCTION_INFO_H
74