2015-07-29 22:32:47 +00:00
|
|
|
//===- XCoreMachineFunctionInfo.h - XCore machine function info -*- C++ -*-===//
|
2008-11-07 10:59:00 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares XCore-specific per-machine-function information.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#ifndef LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
|
2008-11-07 10:59:00 +00:00
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
2012-12-04 07:12:27 +00:00
|
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
2008-11-07 10:59:00 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
// Forward declarations
|
|
|
|
class Function;
|
|
|
|
|
|
|
|
/// XCoreFunctionInfo - This class is derived from MachineFunction private
|
|
|
|
/// XCore target-specific information for each MachineFunction.
|
|
|
|
class XCoreFunctionInfo : public MachineFunctionInfo {
|
2011-12-20 02:50:00 +00:00
|
|
|
virtual void anchor();
|
2014-01-06 14:20:41 +00:00
|
|
|
bool LRSpillSlotSet;
|
2008-11-07 10:59:00 +00:00
|
|
|
int LRSpillSlot;
|
2014-01-06 14:20:41 +00:00
|
|
|
bool FPSpillSlotSet;
|
2008-11-07 10:59:00 +00:00
|
|
|
int FPSpillSlot;
|
2014-02-18 11:21:48 +00:00
|
|
|
bool EHSpillSlotSet;
|
|
|
|
int EHSpillSlot[2];
|
2014-02-27 17:47:54 +00:00
|
|
|
unsigned ReturnStackOffset;
|
|
|
|
bool ReturnStackOffsetSet;
|
2008-11-07 10:59:00 +00:00
|
|
|
int VarArgsFrameIndex;
|
2013-12-02 11:05:28 +00:00
|
|
|
mutable int CachedEStackSize;
|
2014-03-07 06:08:31 +00:00
|
|
|
std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>>
|
|
|
|
SpillLabels;
|
2008-11-07 10:59:00 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
XCoreFunctionInfo() :
|
2014-01-06 14:20:41 +00:00
|
|
|
LRSpillSlotSet(false),
|
|
|
|
FPSpillSlotSet(false),
|
2014-02-18 11:21:48 +00:00
|
|
|
EHSpillSlotSet(false),
|
2014-02-27 17:47:54 +00:00
|
|
|
ReturnStackOffsetSet(false),
|
2013-12-02 11:05:28 +00:00
|
|
|
VarArgsFrameIndex(0),
|
|
|
|
CachedEStackSize(-1) {}
|
2008-11-07 10:59:00 +00:00
|
|
|
|
2009-06-05 23:05:51 +00:00
|
|
|
explicit XCoreFunctionInfo(MachineFunction &MF) :
|
2014-01-06 14:20:41 +00:00
|
|
|
LRSpillSlotSet(false),
|
|
|
|
FPSpillSlotSet(false),
|
2014-02-18 11:21:48 +00:00
|
|
|
EHSpillSlotSet(false),
|
2014-02-27 17:47:54 +00:00
|
|
|
ReturnStackOffsetSet(false),
|
2013-12-02 11:05:28 +00:00
|
|
|
VarArgsFrameIndex(0),
|
|
|
|
CachedEStackSize(-1) {}
|
2008-11-07 10:59:00 +00:00
|
|
|
|
|
|
|
~XCoreFunctionInfo() {}
|
|
|
|
|
|
|
|
void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
|
|
|
|
int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
|
2014-01-06 14:20:41 +00:00
|
|
|
|
|
|
|
int createLRSpillSlot(MachineFunction &MF);
|
|
|
|
bool hasLRSpillSlot() { return LRSpillSlotSet; }
|
|
|
|
int getLRSpillSlot() const {
|
2014-02-18 11:21:48 +00:00
|
|
|
assert(LRSpillSlotSet && "LR Spill slot not set");
|
2014-01-06 14:20:41 +00:00
|
|
|
return LRSpillSlot;
|
|
|
|
}
|
|
|
|
|
|
|
|
int createFPSpillSlot(MachineFunction &MF);
|
|
|
|
bool hasFPSpillSlot() { return FPSpillSlotSet; }
|
|
|
|
int getFPSpillSlot() const {
|
2014-02-18 11:21:48 +00:00
|
|
|
assert(FPSpillSlotSet && "FP Spill slot not set");
|
2014-01-06 14:20:41 +00:00
|
|
|
return FPSpillSlot;
|
|
|
|
}
|
|
|
|
|
2014-02-18 11:21:48 +00:00
|
|
|
const int* createEHSpillSlot(MachineFunction &MF);
|
|
|
|
bool hasEHSpillSlot() { return EHSpillSlotSet; }
|
|
|
|
const int* getEHSpillSlot() const {
|
|
|
|
assert(EHSpillSlotSet && "EH Spill slot not set");
|
|
|
|
return EHSpillSlot;
|
|
|
|
}
|
|
|
|
|
2014-02-27 17:47:54 +00:00
|
|
|
void setReturnStackOffset(unsigned value) {
|
|
|
|
assert(!ReturnStackOffsetSet && "Return stack offset set twice");
|
|
|
|
ReturnStackOffset = value;
|
|
|
|
ReturnStackOffsetSet = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned getReturnStackOffset() const {
|
|
|
|
assert(ReturnStackOffsetSet && "Return stack offset not set");
|
|
|
|
return ReturnStackOffset;
|
|
|
|
}
|
|
|
|
|
2013-12-02 11:05:28 +00:00
|
|
|
bool isLargeFrame(const MachineFunction &MF) const;
|
|
|
|
|
2014-03-07 06:08:31 +00:00
|
|
|
std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>> &
|
|
|
|
getSpillLabels() {
|
2008-11-07 10:59:00 +00:00
|
|
|
return SpillLabels;
|
|
|
|
}
|
|
|
|
};
|
2015-06-23 09:49:53 +00:00
|
|
|
} // End llvm namespace
|
2008-11-07 10:59:00 +00:00
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#endif
|