2015-07-30 06:32:47 +08:00
|
|
|
//=== SystemZMachineFunctionInfo.h - SystemZ machine function info -*- C++ -*-//
|
2013-05-07 00:15:19 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H
|
2013-05-07 00:15:19 +08:00
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class SystemZMachineFunctionInfo : public MachineFunctionInfo {
|
2013-11-19 08:57:56 +08:00
|
|
|
virtual void anchor();
|
2013-05-07 00:15:19 +08:00
|
|
|
unsigned LowSavedGPR;
|
|
|
|
unsigned HighSavedGPR;
|
|
|
|
unsigned VarArgsFirstGPR;
|
|
|
|
unsigned VarArgsFirstFPR;
|
|
|
|
unsigned VarArgsFrameIndex;
|
|
|
|
unsigned RegSaveFrameIndex;
|
2016-04-04 20:44:55 +08:00
|
|
|
int FramePointerSaveIndex;
|
2013-05-07 00:15:19 +08:00
|
|
|
bool ManipulatesSP;
|
2015-02-18 17:13:27 +08:00
|
|
|
unsigned NumLocalDynamics;
|
2013-05-07 00:15:19 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit SystemZMachineFunctionInfo(MachineFunction &MF)
|
2013-07-03 17:11:00 +08:00
|
|
|
: LowSavedGPR(0), HighSavedGPR(0), VarArgsFirstGPR(0), VarArgsFirstFPR(0),
|
2016-04-04 20:44:55 +08:00
|
|
|
VarArgsFrameIndex(0), RegSaveFrameIndex(0), FramePointerSaveIndex(0),
|
|
|
|
ManipulatesSP(false), NumLocalDynamics(0) {}
|
2013-05-07 00:15:19 +08:00
|
|
|
|
|
|
|
// Get and set the first call-saved GPR that should be saved and restored
|
|
|
|
// by this function. This is 0 if no GPRs need to be saved or restored.
|
|
|
|
unsigned getLowSavedGPR() const { return LowSavedGPR; }
|
|
|
|
void setLowSavedGPR(unsigned Reg) { LowSavedGPR = Reg; }
|
|
|
|
|
|
|
|
// Get and set the last call-saved GPR that should be saved and restored
|
|
|
|
// by this function.
|
|
|
|
unsigned getHighSavedGPR() const { return HighSavedGPR; }
|
|
|
|
void setHighSavedGPR(unsigned Reg) { HighSavedGPR = Reg; }
|
|
|
|
|
|
|
|
// Get and set the number of fixed (as opposed to variable) arguments
|
|
|
|
// that are passed in GPRs to this function.
|
|
|
|
unsigned getVarArgsFirstGPR() const { return VarArgsFirstGPR; }
|
|
|
|
void setVarArgsFirstGPR(unsigned GPR) { VarArgsFirstGPR = GPR; }
|
|
|
|
|
|
|
|
// Likewise FPRs.
|
|
|
|
unsigned getVarArgsFirstFPR() const { return VarArgsFirstFPR; }
|
|
|
|
void setVarArgsFirstFPR(unsigned FPR) { VarArgsFirstFPR = FPR; }
|
|
|
|
|
|
|
|
// Get and set the frame index of the first stack vararg.
|
|
|
|
unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
|
|
|
|
void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; }
|
|
|
|
|
|
|
|
// Get and set the frame index of the register save area
|
|
|
|
// (i.e. the incoming stack pointer).
|
|
|
|
unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
|
|
|
|
void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; }
|
|
|
|
|
2016-04-04 20:44:55 +08:00
|
|
|
// Get and set the frame index of where the old frame pointer is stored.
|
|
|
|
int getFramePointerSaveIndex() const { return FramePointerSaveIndex; }
|
|
|
|
void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; }
|
|
|
|
|
2013-05-07 00:15:19 +08:00
|
|
|
// Get and set whether the function directly manipulates the stack pointer,
|
|
|
|
// e.g. through STACKSAVE or STACKRESTORE.
|
|
|
|
bool getManipulatesSP() const { return ManipulatesSP; }
|
|
|
|
void setManipulatesSP(bool MSP) { ManipulatesSP = MSP; }
|
2015-02-18 17:13:27 +08:00
|
|
|
|
|
|
|
// Count number of local-dynamic TLS symbols used.
|
|
|
|
unsigned getNumLocalDynamicTLSAccesses() const { return NumLocalDynamics; }
|
|
|
|
void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamics; }
|
2013-05-07 00:15:19 +08:00
|
|
|
};
|
|
|
|
|
2014-03-06 18:38:30 +08:00
|
|
|
} // end namespace llvm
|
2013-05-07 00:15:19 +08:00
|
|
|
|
|
|
|
#endif
|