]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/AVR/AVRMachineFunctionInfo.h
Merge ^/head r340235 through r340367.
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / AVR / AVRMachineFunctionInfo.h
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 "llvm/CodeGen/MachineFunction.h"
18
19 namespace llvm {
20
21 /// Contains AVR-specific information for each MachineFunction.
22 class AVRMachineFunctionInfo : public MachineFunctionInfo {
23   /// Indicates if a register has been spilled by the register
24   /// allocator.
25   bool HasSpills;
26
27   /// Indicates if there are any fixed size allocas present.
28   /// Note that if there are only variable sized allocas this is set to false.
29   bool HasAllocas;
30
31   /// Indicates if arguments passed using the stack are being
32   /// used inside the function.
33   bool HasStackArgs;
34
35   /// Size of the callee-saved register portion of the
36   /// stack frame in bytes.
37   unsigned CalleeSavedFrameSize;
38
39   /// FrameIndex for start of varargs area.
40   int VarArgsFrameIndex;
41
42 public:
43   AVRMachineFunctionInfo()
44       : HasSpills(false), HasAllocas(false), HasStackArgs(false),
45         CalleeSavedFrameSize(0), VarArgsFrameIndex(0) {}
46
47   explicit AVRMachineFunctionInfo(MachineFunction &MF)
48       : HasSpills(false), HasAllocas(false), HasStackArgs(false),
49         CalleeSavedFrameSize(0), VarArgsFrameIndex(0) {}
50
51   bool getHasSpills() const { return HasSpills; }
52   void setHasSpills(bool B) { HasSpills = B; }
53
54   bool getHasAllocas() const { return HasAllocas; }
55   void setHasAllocas(bool B) { HasAllocas = B; }
56
57   bool getHasStackArgs() const { return HasStackArgs; }
58   void setHasStackArgs(bool B) { HasStackArgs = B; }
59
60   unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
61   void setCalleeSavedFrameSize(unsigned Bytes) { CalleeSavedFrameSize = Bytes; }
62
63   int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
64   void setVarArgsFrameIndex(int Idx) { VarArgsFrameIndex = Idx; }
65 };
66
67 } // end llvm namespace
68
69 #endif // LLVM_AVR_MACHINE_FUNCTION_INFO_H