blob: fcaa8a1d6c728ee72076574c27bfae7843720094 [file] [log] [blame]
Nick Lewyckyc3890d22015-07-29 22:32:47 +00001//=== MSP430MachineFunctionInfo.h - MSP430 machine function info -*- C++ -*-==//
Anton Korobeynikov1af0b612009-05-03 13:11:04 +00002//
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 MSP430-specific per-machine-function information.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_MSP430_MSP430MACHINEFUNCTIONINFO_H
15#define LLVM_LIB_TARGET_MSP430_MSP430MACHINEFUNCTIONINFO_H
Anton Korobeynikov1af0b612009-05-03 13:11:04 +000016
17#include "llvm/CodeGen/MachineFunction.h"
18
19namespace llvm {
20
21/// MSP430MachineFunctionInfo - This class is derived from MachineFunction and
22/// contains private MSP430 target-specific information for each MachineFunction.
23class MSP430MachineFunctionInfo : public MachineFunctionInfo {
David Blaikiea379b1812011-12-20 02:50:00 +000024 virtual void anchor();
25
Anton Korobeynikov1af0b612009-05-03 13:11:04 +000026 /// CalleeSavedFrameSize - Size of the callee-saved register portion of the
27 /// stack frame in bytes.
28 unsigned CalleeSavedFrameSize;
29
Anton Korobeynikovff4ab512009-12-07 02:28:10 +000030 /// ReturnAddrIndex - FrameIndex for return slot.
31 int ReturnAddrIndex;
32
Anton Korobeynikov568afeb2012-11-21 17:28:27 +000033 /// VarArgsFrameIndex - FrameIndex for start of varargs area.
34 int VarArgsFrameIndex;
35
Vadzim Dambrouskieafb8052017-03-02 20:25:10 +000036 /// SRetReturnReg - Some subtargets require that sret lowering includes
37 /// returning the value of the returned struct in a register. This field
38 /// holds the virtual register into which the sret argument is passed.
39 unsigned SRetReturnReg;
40
Anton Korobeynikov1af0b612009-05-03 13:11:04 +000041public:
42 MSP430MachineFunctionInfo() : CalleeSavedFrameSize(0) {}
43
Dan Gohmand185a7a2009-06-05 23:05:51 +000044 explicit MSP430MachineFunctionInfo(MachineFunction &MF)
Vadzim Dambrouskieafb8052017-03-02 20:25:10 +000045 : CalleeSavedFrameSize(0), ReturnAddrIndex(0), SRetReturnReg(0) {}
Anton Korobeynikov1af0b612009-05-03 13:11:04 +000046
47 unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
48 void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
Anton Korobeynikovff4ab512009-12-07 02:28:10 +000049
Vadzim Dambrouskieafb8052017-03-02 20:25:10 +000050 unsigned getSRetReturnReg() const { return SRetReturnReg; }
51 void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
52
Anton Korobeynikovff4ab512009-12-07 02:28:10 +000053 int getRAIndex() const { return ReturnAddrIndex; }
54 void setRAIndex(int Index) { ReturnAddrIndex = Index; }
Anton Korobeynikov568afeb2012-11-21 17:28:27 +000055
56 int getVarArgsFrameIndex() const { return VarArgsFrameIndex;}
57 void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
Anton Korobeynikov1af0b612009-05-03 13:11:04 +000058};
59
Alexander Kornienkof00654e2015-06-23 09:49:53 +000060} // End llvm namespace
Anton Korobeynikov1af0b612009-05-03 13:11:04 +000061
62#endif