blob: 5226e30491c35560a71caa45f33b418b6c843a49 [file] [log] [blame]
Dylan McKay751a4492015-12-21 23:13:15 +00001//===-- AVRMachineFuctionInfo.h - AVR machine function info -----*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Dylan McKay751a4492015-12-21 23:13:15 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file declares AVR-specific per-machine-function information.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_AVR_MACHINE_FUNCTION_INFO_H
14#define LLVM_AVR_MACHINE_FUNCTION_INFO_H
15
Dylan McKay751a4492015-12-21 23:13:15 +000016#include "llvm/CodeGen/MachineFunction.h"
17
18namespace llvm {
19
Dylan McKayd56676e2016-05-18 09:43:01 +000020/// Contains AVR-specific information for each MachineFunction.
Dylan McKay751a4492015-12-21 23:13:15 +000021class AVRMachineFunctionInfo : public MachineFunctionInfo {
22 /// Indicates if a register has been spilled by the register
23 /// allocator.
24 bool HasSpills;
25
26 /// Indicates if there are any fixed size allocas present.
27 /// Note that if there are only variable sized allocas this is set to false.
28 bool HasAllocas;
29
30 /// Indicates if arguments passed using the stack are being
31 /// used inside the function.
32 bool HasStackArgs;
33
34 /// Size of the callee-saved register portion of the
35 /// stack frame in bytes.
36 unsigned CalleeSavedFrameSize;
37
38 /// FrameIndex for start of varargs area.
39 int VarArgsFrameIndex;
40
41public:
42 AVRMachineFunctionInfo()
43 : HasSpills(false), HasAllocas(false), HasStackArgs(false),
44 CalleeSavedFrameSize(0), VarArgsFrameIndex(0) {}
45
46 explicit AVRMachineFunctionInfo(MachineFunction &MF)
47 : HasSpills(false), HasAllocas(false), HasStackArgs(false),
48 CalleeSavedFrameSize(0), VarArgsFrameIndex(0) {}
49
50 bool getHasSpills() const { return HasSpills; }
51 void setHasSpills(bool B) { HasSpills = B; }
52
53 bool getHasAllocas() const { return HasAllocas; }
54 void setHasAllocas(bool B) { HasAllocas = B; }
55
56 bool getHasStackArgs() const { return HasStackArgs; }
57 void setHasStackArgs(bool B) { HasStackArgs = B; }
58
59 unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
60 void setCalleeSavedFrameSize(unsigned Bytes) { CalleeSavedFrameSize = Bytes; }
61
62 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
63 void setVarArgsFrameIndex(int Idx) { VarArgsFrameIndex = Idx; }
64};
65
66} // end llvm namespace
67
68#endif // LLVM_AVR_MACHINE_FUNCTION_INFO_H