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