2011-01-10 12:39:04 +00:00
|
|
|
//=- SystemZFrameLowering.h - Define frame lowering for z/System -*- C++ -*--=//
|
2010-11-15 00:06:54 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SYSTEMZ_FRAMEINFO_H
|
|
|
|
#define SYSTEMZ_FRAMEINFO_H
|
|
|
|
|
|
|
|
#include "SystemZ.h"
|
|
|
|
#include "SystemZSubtarget.h"
|
2011-01-10 12:39:04 +00:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2010-11-27 23:05:03 +00:00
|
|
|
#include "llvm/ADT/IndexedMap.h"
|
2010-11-15 00:06:54 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class SystemZSubtarget;
|
|
|
|
|
2011-01-10 12:39:04 +00:00
|
|
|
class SystemZFrameLowering : public TargetFrameLowering {
|
2010-11-27 23:05:03 +00:00
|
|
|
IndexedMap<unsigned> RegSpillOffsets;
|
2010-11-15 00:06:54 +00:00
|
|
|
protected:
|
|
|
|
const SystemZSubtarget &STI;
|
|
|
|
|
|
|
|
public:
|
2011-01-10 12:39:04 +00:00
|
|
|
explicit SystemZFrameLowering(const SystemZSubtarget &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;
|
2010-11-18 21:19:35 +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-27 23:05:25 +00:00
|
|
|
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
|
|
|
RegScavenger *RS) const;
|
|
|
|
|
2010-11-18 21:19:35 +00:00
|
|
|
bool hasReservedCallFrame(const MachineFunction &MF) const { return true; }
|
|
|
|
bool hasFP(const MachineFunction &MF) const;
|
2010-11-20 15:59:32 +00:00
|
|
|
int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
|
2010-11-15 00:06:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|