1894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===- SparcMachineFunctionInfo.h - Sparc Machine Function Info -*- C++ -*-===//
2894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
3894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//                     The LLVM Compiler Infrastructure
4894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
5894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file is distributed under the University of Illinois Open Source
6894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// License. See LICENSE.TXT for details.
7894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
8894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
9894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
10894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file declares  Sparc specific per-machine-function information.
11894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
12894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
13894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#ifndef SPARCMACHINEFUNCTIONINFO_H
14894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#define SPARCMACHINEFUNCTIONINFO_H
15894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
16894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include "llvm/CodeGen/MachineFunction.h"
17894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
18894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumannamespace llvm {
19894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
20894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  class SparcMachineFunctionInfo : public MachineFunctionInfo {
21894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  private:
22894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    unsigned GlobalBaseReg;
23894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
24894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    /// VarArgsFrameOffset - Frame offset to start of varargs area.
25894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    int VarArgsFrameOffset;
26894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
2719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    /// SRetReturnReg - Holds the virtual register into which the sret
2819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    /// argument is passed.
2919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    unsigned SRetReturnReg;
30894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  public:
3119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    SparcMachineFunctionInfo()
3219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman      : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0) {}
33894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    explicit SparcMachineFunctionInfo(MachineFunction &MF)
3419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman      : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0) {}
35894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
36894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    unsigned getGlobalBaseReg() const { return GlobalBaseReg; }
37894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; }
38894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
39894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    int getVarArgsFrameOffset() const { return VarArgsFrameOffset; }
40894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    void setVarArgsFrameOffset(int Offset) { VarArgsFrameOffset = Offset; }
4119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman
4219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    unsigned getSRetReturnReg() const { return SRetReturnReg; }
4319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
44894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  };
45894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
46894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
47894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#endif
48