131d157ae1ac2cd9c787dc3c1d28e64c682803844Jia Liu//===-- XCoreMachineFuctionInfo.h - XCore machine function info -*- C++ -*-===// 2b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// 3b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// The LLVM Compiler Infrastructure 4b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// 5b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// This file is distributed under the University of Illinois Open Source 6b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// License. See LICENSE.TXT for details. 7b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// 8b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne//===----------------------------------------------------------------------===// 9b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// 10b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// This file declares XCore-specific per-machine-function information. 11b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// 12b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne//===----------------------------------------------------------------------===// 13b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 14b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne#ifndef XCOREMACHINEFUNCTIONINFO_H 15b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne#define XCOREMACHINEFUNCTIONINFO_H 16b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 17b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne#include "llvm/CodeGen/MachineFunction.h" 18b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne#include "llvm/CodeGen/MachineFrameInfo.h" 19b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne#include <vector> 20b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 21b25baef26f03b9909b65dd5f762b38f93000445dRichard Osbornenamespace llvm { 22b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 23b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne// Forward declarations 24b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborneclass Function; 25b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 26b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne/// XCoreFunctionInfo - This class is derived from MachineFunction private 27b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne/// XCore target-specific information for each MachineFunction. 28b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborneclass XCoreFunctionInfo : public MachineFunctionInfo { 292d24e2a396a1d211baaeedf32148a3b657240170David Blaikie virtual void anchor(); 30b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne bool UsesLR; 31b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne int LRSpillSlot; 32b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne int FPSpillSlot; 33b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne int VarArgsFrameIndex; 342e9919a5e5fe76f4b1e3290103c4bfd149ebba9cChris Lattner std::vector<std::pair<MCSymbol*, CalleeSavedInfo> > SpillLabels; 35b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 36b25baef26f03b9909b65dd5f762b38f93000445dRichard Osbornepublic: 37b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne XCoreFunctionInfo() : 38b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne UsesLR(false), 39b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne LRSpillSlot(0), 40b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne FPSpillSlot(0), 41b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne VarArgsFrameIndex(0) {} 42b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 432392efef1bd2599231ab659dd6ba4233bf5df94cDan Gohman explicit XCoreFunctionInfo(MachineFunction &MF) : 44b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne UsesLR(false), 45b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne LRSpillSlot(0), 46b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne FPSpillSlot(0), 47b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne VarArgsFrameIndex(0) {} 48b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 49b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne ~XCoreFunctionInfo() {} 50b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 51b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; } 52b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne int getVarArgsFrameIndex() const { return VarArgsFrameIndex; } 53b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 54b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne void setUsesLR(bool val) { UsesLR = val; } 55b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne bool getUsesLR() const { return UsesLR; } 56b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 57b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne void setLRSpillSlot(int off) { LRSpillSlot = off; } 58b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne int getLRSpillSlot() const { return LRSpillSlot; } 59b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 60b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne void setFPSpillSlot(int off) { FPSpillSlot = off; } 61b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne int getFPSpillSlot() const { return FPSpillSlot; } 62b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 632e9919a5e5fe76f4b1e3290103c4bfd149ebba9cChris Lattner std::vector<std::pair<MCSymbol*, CalleeSavedInfo> > &getSpillLabels() { 64b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne return SpillLabels; 65b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne } 66b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne}; 67b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne} // End llvm namespace 68b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne 69b25baef26f03b9909b65dd5f762b38f93000445dRichard Osborne#endif // XCOREMACHINEFUNCTIONINFO_H 70