2011-01-10 12:39:04 +00:00
|
|
|
//===-- XCoreFrameLowering.h - Frame info for XCore Target -------*- 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 contains XCore frame information that doesn't fit anywhere else
|
|
|
|
// cleanly...
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef XCOREFRAMEINFO_H
|
|
|
|
#define XCOREFRAMEINFO_H
|
|
|
|
|
2011-01-10 12:39:04 +00:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2008-11-07 10:59:00 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2010-11-15 00:06:54 +00:00
|
|
|
class XCoreSubtarget;
|
2008-11-07 10:59:00 +00:00
|
|
|
|
2011-01-10 12:39:04 +00:00
|
|
|
class XCoreFrameLowering: public TargetFrameLowering {
|
2010-11-15 00:06:54 +00:00
|
|
|
const XCoreSubtarget &STI;
|
2008-11-07 10:59:00 +00:00
|
|
|
public:
|
2011-01-10 12:39:04 +00:00
|
|
|
XCoreFrameLowering(const XCoreSubtarget &STI);
|
2010-11-15 00:06:54 +00:00
|
|
|
|
|
|
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
|
|
|
/// the function.
|
|
|
|
void emitPrologue(MachineFunction &MF) const;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
2008-11-07 10:59:00 +00:00
|
|
|
|
2010-11-27 23:05:03 +00:00
|
|
|
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MI,
|
|
|
|
const std::vector<CalleeSavedInfo> &CSI,
|
|
|
|
const TargetRegisterInfo *TRI) const;
|
|
|
|
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MI,
|
|
|
|
const std::vector<CalleeSavedInfo> &CSI,
|
|
|
|
const TargetRegisterInfo *TRI) const;
|
|
|
|
|
2010-11-18 21:19:35 +00:00
|
|
|
bool hasFP(const MachineFunction &MF) const;
|
|
|
|
|
2010-11-18 23:25:52 +00:00
|
|
|
void getInitialFrameState(std::vector<MachineMove> &Moves) const;
|
|
|
|
|
2010-11-27 23:05:25 +00:00
|
|
|
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
|
|
|
RegScavenger *RS = NULL) const;
|
|
|
|
|
|
|
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
|
|
|
|
2008-11-07 10:59:00 +00:00
|
|
|
//! Stack slot size (4 bytes)
|
|
|
|
static int stackSlotSize() {
|
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // XCOREFRAMEINFO_H
|