mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Rename FunctionFrameInfo to MachineFrameInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5201 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eb24db9727
commit
aa09b75d22
@ -1,6 +1,6 @@
|
||||
//===-- CodeGen/FunctionFrameInfo.h - Abstract Stack Frame Rep --*- C++ -*-===//
|
||||
//===-- CodeGen/MachineFrameInfo.h - Abstract Stack Frame Rep. --*- C++ -*-===//
|
||||
//
|
||||
// The FunctionFrameInfo class represents an abstract stack frame until
|
||||
// The MachineFrameInfo class represents an abstract stack frame until
|
||||
// prolog/epilog code is inserted. This class is key to allowing stack frame
|
||||
// representation optimizations, such as frame pointer elimination. It also
|
||||
// allows more mundane (but still important) optimizations, such as reordering
|
||||
@ -31,7 +31,7 @@
|
||||
#ifndef LLVM_CODEGEN_FUNCTIONFRAMEINFO_H
|
||||
#define LLVM_CODEGEN_FUNCTIONFRAMEINFO_H
|
||||
|
||||
class FunctionFrameInfo {
|
||||
class MachineFrameInfo {
|
||||
|
||||
// StackObject - Represent a single object allocated on the stack.
|
||||
struct StackObject {
|
||||
@ -83,7 +83,7 @@ class FunctionFrameInfo {
|
||||
///
|
||||
unsigned MaxCallFrameSize;
|
||||
public:
|
||||
FunctionFrameInfo() {
|
||||
MachineFrameInfo() {
|
||||
NumFixedObjects = StackSize = 0;
|
||||
HasVarSizedObjects = false;
|
||||
HasCalls = false;
|
||||
@ -181,7 +181,7 @@ public:
|
||||
return Objects.size()-NumFixedObjects-1;
|
||||
}
|
||||
|
||||
/// CreateVariableSizedObject - Notify the FunctionFrameInfo object that a
|
||||
/// CreateVariableSizedObject - Notify the MachineFrameInfo object that a
|
||||
/// variable sized object has been created. This must be created whenever a
|
||||
/// variable sized object is created, whether or not the index returned is
|
||||
/// actually used.
|
||||
|
@ -20,7 +20,7 @@ class TargetMachine;
|
||||
class Pass;
|
||||
class SSARegMap;
|
||||
class MachineFunctionInfo;
|
||||
class FunctionFrameInfo;
|
||||
class MachineFrameInfo;
|
||||
|
||||
Pass *createMachineCodeConstructionPass(TargetMachine &Target);
|
||||
Pass *createMachineCodeDestructionPass();
|
||||
@ -40,7 +40,7 @@ class MachineFunction : private Annotation {
|
||||
MachineFunctionInfo *MFInfo;
|
||||
|
||||
// Keep track of objects allocated on the stack.
|
||||
FunctionFrameInfo *FrameInfo;
|
||||
MachineFrameInfo *FrameInfo;
|
||||
|
||||
public:
|
||||
MachineFunction(const Function *Fn, const TargetMachine& target);
|
||||
@ -64,7 +64,7 @@ public:
|
||||
/// This object contains information about objects allocated on the stack
|
||||
/// frame of the current function in an abstract way.
|
||||
///
|
||||
FunctionFrameInfo *getFrameInfo() const { return FrameInfo; }
|
||||
MachineFrameInfo *getFrameInfo() const { return FrameInfo; }
|
||||
|
||||
/// MachineFunctionInfo - Keep track of various per-function pieces of
|
||||
/// information for the sparc backend.
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||
#include "llvm/CodeGen/SSARegMap.h"
|
||||
#include "llvm/CodeGen/FunctionFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Support/InstVisitor.h"
|
||||
#include "llvm/Target/MRegisterInfo.h"
|
||||
@ -345,7 +345,7 @@ void ISel::LoadArgumentsToVirtualRegs(Function &Fn) {
|
||||
// ...
|
||||
//
|
||||
unsigned ArgOffset = 0;
|
||||
FunctionFrameInfo *FFI = F->getFrameInfo();
|
||||
MachineFrameInfo *MFI = F->getFrameInfo();
|
||||
|
||||
for (Function::aiterator I = Fn.abegin(), E = Fn.aend(); I != E; ++I) {
|
||||
unsigned Reg = getReg(*I);
|
||||
@ -355,26 +355,26 @@ void ISel::LoadArgumentsToVirtualRegs(Function &Fn) {
|
||||
|
||||
switch (getClassB(I->getType())) {
|
||||
case cByte:
|
||||
FI = FFI->CreateFixedObject(1, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(1, ArgOffset);
|
||||
addFrameReference(BuildMI(BB, X86::MOVmr8, 4, Reg), FI);
|
||||
break;
|
||||
case cShort:
|
||||
FI = FFI->CreateFixedObject(2, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(2, ArgOffset);
|
||||
addFrameReference(BuildMI(BB, X86::MOVmr16, 4, Reg), FI);
|
||||
break;
|
||||
case cInt:
|
||||
FI = FFI->CreateFixedObject(4, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(4, ArgOffset);
|
||||
addFrameReference(BuildMI(BB, X86::MOVmr32, 4, Reg), FI);
|
||||
break;
|
||||
case cFP:
|
||||
unsigned Opcode;
|
||||
if (I->getType() == Type::FloatTy) {
|
||||
Opcode = X86::FLDr32;
|
||||
FI = FFI->CreateFixedObject(4, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(4, ArgOffset);
|
||||
} else {
|
||||
Opcode = X86::FLDr64;
|
||||
ArgOffset += 4; // doubles require 4 additional bytes
|
||||
FI = FFI->CreateFixedObject(8, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(8, ArgOffset);
|
||||
}
|
||||
addFrameReference(BuildMI(BB, Opcode, 4, Reg), FI);
|
||||
break;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||
#include "llvm/CodeGen/SSARegMap.h"
|
||||
#include "llvm/CodeGen/FunctionFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Support/InstVisitor.h"
|
||||
#include "llvm/Target/MRegisterInfo.h"
|
||||
@ -345,7 +345,7 @@ void ISel::LoadArgumentsToVirtualRegs(Function &Fn) {
|
||||
// ...
|
||||
//
|
||||
unsigned ArgOffset = 0;
|
||||
FunctionFrameInfo *FFI = F->getFrameInfo();
|
||||
MachineFrameInfo *MFI = F->getFrameInfo();
|
||||
|
||||
for (Function::aiterator I = Fn.abegin(), E = Fn.aend(); I != E; ++I) {
|
||||
unsigned Reg = getReg(*I);
|
||||
@ -355,26 +355,26 @@ void ISel::LoadArgumentsToVirtualRegs(Function &Fn) {
|
||||
|
||||
switch (getClassB(I->getType())) {
|
||||
case cByte:
|
||||
FI = FFI->CreateFixedObject(1, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(1, ArgOffset);
|
||||
addFrameReference(BuildMI(BB, X86::MOVmr8, 4, Reg), FI);
|
||||
break;
|
||||
case cShort:
|
||||
FI = FFI->CreateFixedObject(2, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(2, ArgOffset);
|
||||
addFrameReference(BuildMI(BB, X86::MOVmr16, 4, Reg), FI);
|
||||
break;
|
||||
case cInt:
|
||||
FI = FFI->CreateFixedObject(4, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(4, ArgOffset);
|
||||
addFrameReference(BuildMI(BB, X86::MOVmr32, 4, Reg), FI);
|
||||
break;
|
||||
case cFP:
|
||||
unsigned Opcode;
|
||||
if (I->getType() == Type::FloatTy) {
|
||||
Opcode = X86::FLDr32;
|
||||
FI = FFI->CreateFixedObject(4, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(4, ArgOffset);
|
||||
} else {
|
||||
Opcode = X86::FLDr64;
|
||||
ArgOffset += 4; // doubles require 4 additional bytes
|
||||
FI = FFI->CreateFixedObject(8, ArgOffset);
|
||||
FI = MFI->CreateFixedObject(8, ArgOffset);
|
||||
}
|
||||
addFrameReference(BuildMI(BB, Opcode, 4, Reg), FI);
|
||||
break;
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/CodeGen/FunctionFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "Support/CommandLine.h"
|
||||
|
||||
namespace {
|
||||
@ -139,8 +139,8 @@ void X86RegisterInfo::eliminateFrameIndex(MachineFunction &MF,
|
||||
int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex);
|
||||
|
||||
if (!hasFP(MF) && hasSPAdjust(MF)) {
|
||||
const FunctionFrameInfo *FFI = MF.getFrameInfo();
|
||||
Offset += FFI->getStackSize() + FFI->getMaxCallFrameSize();
|
||||
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
Offset += MFI->getStackSize() + MFI->getMaxCallFrameSize();
|
||||
}
|
||||
|
||||
MI.SetMachineOperandConst(i, MachineOperand::MO_SignExtendedImmed, Offset);
|
||||
@ -159,15 +159,15 @@ void X86RegisterInfo::processFunctionBeforeFrameFinalized(MachineFunction &MF)
|
||||
void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB
|
||||
MachineBasicBlock::iterator MBBI = MBB.begin();
|
||||
const FunctionFrameInfo *FFI = MF.getFrameInfo();
|
||||
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
MachineInstr *MI;
|
||||
|
||||
// Get the number of bytes to allocate from the FrameInfo
|
||||
unsigned NumBytes = FFI->getStackSize();
|
||||
unsigned NumBytes = MFI->getStackSize();
|
||||
if (hasFP(MF)) {
|
||||
// Get the offset of the stack slot for the EBP register... which is
|
||||
// guaranteed to be the last slot by processFunctionBeforeFrameFinalized.
|
||||
int EBPOffset = FFI->getObjectOffset(FFI->getObjectIndexEnd()-1);
|
||||
int EBPOffset = MFI->getObjectOffset(MFI->getObjectIndexEnd()-1);
|
||||
|
||||
MI = addRegOffset(BuildMI(X86::MOVrm32, 5), // mov [ESP-<offset>], EBP
|
||||
X86::ESP, EBPOffset).addReg(X86::EBP);
|
||||
@ -187,7 +187,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
// in the function immediately on entry to the current function. This
|
||||
// eliminates the need for add/sub ESP brackets around call sites.
|
||||
//
|
||||
NumBytes += FFI->getMaxCallFrameSize();
|
||||
NumBytes += MFI->getMaxCallFrameSize();
|
||||
}
|
||||
|
||||
if (NumBytes) {
|
||||
@ -199,7 +199,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
|
||||
void X86RegisterInfo::emitEpilogue(MachineFunction &MF,
|
||||
MachineBasicBlock &MBB) const {
|
||||
const FunctionFrameInfo *FFI = MF.getFrameInfo();
|
||||
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
MachineBasicBlock::iterator MBBI = MBB.end()-1;
|
||||
MachineInstr *MI;
|
||||
assert((*MBBI)->getOpcode() == X86::RET &&
|
||||
@ -208,7 +208,7 @@ void X86RegisterInfo::emitEpilogue(MachineFunction &MF,
|
||||
if (hasFP(MF)) {
|
||||
// Get the offset of the stack slot for the EBP register... which is
|
||||
// guaranteed to be the last slot by processFunctionBeforeFrameFinalized.
|
||||
int EBPOffset = FFI->getObjectOffset(FFI->getObjectIndexEnd()-1);
|
||||
int EBPOffset = MFI->getObjectOffset(MFI->getObjectIndexEnd()-1);
|
||||
|
||||
// mov ESP, EBP
|
||||
MI = BuildMI(X86::MOVrr32, 1,X86::ESP).addReg(X86::EBP);
|
||||
@ -221,8 +221,8 @@ void X86RegisterInfo::emitEpilogue(MachineFunction &MF,
|
||||
if (!hasSPAdjust(MF)) return;
|
||||
|
||||
// Get the number of bytes allocated from the FrameInfo...
|
||||
unsigned NumBytes = FFI->getStackSize();
|
||||
NumBytes += FFI->getMaxCallFrameSize();
|
||||
unsigned NumBytes = MFI->getStackSize();
|
||||
NumBytes += MFI->getMaxCallFrameSize();
|
||||
|
||||
if (NumBytes) { // adjust stack pointer back: ESP += numbytes
|
||||
MI =BuildMI(X86::ADDri32, 2, X86::ESP).addReg(X86::ESP).addZImm(NumBytes);
|
||||
|
Loading…
Reference in New Issue
Block a user