diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2011-01-10 12:39:04 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2011-01-10 12:39:04 +0000 |
commit | 16c29b5f285f375be53dabaa73e3e91107485fe4 (patch) | |
tree | df7ee2e7da3560e6169260f744977299af674494 /lib/Target/MSP430 | |
parent | badbd2fde9b8debd6265e8ece511fb01123d1d5f (diff) | |
download | external_llvm-16c29b5f285f375be53dabaa73e3e91107485fe4.zip external_llvm-16c29b5f285f375be53dabaa73e3e91107485fe4.tar.gz external_llvm-16c29b5f285f375be53dabaa73e3e91107485fe4.tar.bz2 |
Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs and fixes here and there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123170 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MSP430')
-rw-r--r-- | lib/Target/MSP430/MSP430FrameLowering.cpp (renamed from lib/Target/MSP430/MSP430FrameInfo.cpp) | 22 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430FrameLowering.h (renamed from lib/Target/MSP430/MSP430FrameInfo.h) | 10 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430RegisterInfo.cpp | 14 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430RegisterInfo.td | 4 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430TargetMachine.cpp | 2 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430TargetMachine.h | 10 |
6 files changed, 32 insertions, 30 deletions
diff --git a/lib/Target/MSP430/MSP430FrameInfo.cpp b/lib/Target/MSP430/MSP430FrameLowering.cpp index 7e7a0e4..9d37353 100644 --- a/lib/Target/MSP430/MSP430FrameInfo.cpp +++ b/lib/Target/MSP430/MSP430FrameLowering.cpp @@ -1,4 +1,4 @@ -//=======- MSP430FrameInfo.cpp - MSP430 Frame Information ------*- C++ -*-====// +//======-- MSP430FrameLowering.cpp - MSP430 Frame Information -------=========// // // The LLVM Compiler Infrastructure // @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// // -// This file contains the MSP430 implementation of TargetFrameInfo class. +// This file contains the MSP430 implementation of TargetFrameLowering class. // //===----------------------------------------------------------------------===// -#include "MSP430FrameInfo.h" +#include "MSP430FrameLowering.h" #include "MSP430InstrInfo.h" #include "MSP430MachineFunctionInfo.h" #include "llvm/Function.h" @@ -26,7 +26,7 @@ using namespace llvm; -bool MSP430FrameInfo::hasFP(const MachineFunction &MF) const { +bool MSP430FrameLowering::hasFP(const MachineFunction &MF) const { const MachineFrameInfo *MFI = MF.getFrameInfo(); return (DisableFramePointerElim(MF) || @@ -34,11 +34,11 @@ bool MSP430FrameInfo::hasFP(const MachineFunction &MF) const { MFI->isFrameAddressTaken()); } -bool MSP430FrameInfo::hasReservedCallFrame(const MachineFunction &MF) const { +bool MSP430FrameLowering::hasReservedCallFrame(const MachineFunction &MF) const { return !MF.getFrameInfo()->hasVarSizedObjects(); } -void MSP430FrameInfo::emitPrologue(MachineFunction &MF) const { +void MSP430FrameLowering::emitPrologue(MachineFunction &MF) const { MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB MachineFrameInfo *MFI = MF.getFrameInfo(); MSP430MachineFunctionInfo *MSP430FI = MF.getInfo<MSP430MachineFunctionInfo>(); @@ -103,8 +103,8 @@ void MSP430FrameInfo::emitPrologue(MachineFunction &MF) const { } } -void MSP430FrameInfo::emitEpilogue(MachineFunction &MF, - MachineBasicBlock &MBB) const { +void MSP430FrameLowering::emitEpilogue(MachineFunction &MF, + MachineBasicBlock &MBB) const { const MachineFrameInfo *MFI = MF.getFrameInfo(); MSP430MachineFunctionInfo *MSP430FI = MF.getInfo<MSP430MachineFunctionInfo>(); const MSP430InstrInfo &TII = @@ -177,7 +177,7 @@ void MSP430FrameInfo::emitEpilogue(MachineFunction &MF, // FIXME: Can we eleminate these in favour of generic code? bool -MSP430FrameInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB, +MSP430FrameLowering::spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector<CalleeSavedInfo> &CSI, const TargetRegisterInfo *TRI) const { @@ -203,8 +203,8 @@ MSP430FrameInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB, } bool -MSP430FrameInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, +MSP430FrameLowering::restoreCalleeSavedRegisters(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MI, const std::vector<CalleeSavedInfo> &CSI, const TargetRegisterInfo *TRI) const { if (CSI.empty()) diff --git a/lib/Target/MSP430/MSP430FrameInfo.h b/lib/Target/MSP430/MSP430FrameLowering.h index f80a348..b636827 100644 --- a/lib/Target/MSP430/MSP430FrameInfo.h +++ b/lib/Target/MSP430/MSP430FrameLowering.h @@ -1,4 +1,4 @@ -//===-- MSP430FrameInfo.h - Define TargetFrameInfo for MSP430 --*- C++ -*--===// +//==- MSP430FrameLowering.h - Define frame lowering for MSP430 --*- C++ -*--==// // // The LLVM Compiler Infrastructure // @@ -16,18 +16,18 @@ #include "MSP430.h" #include "MSP430Subtarget.h" -#include "llvm/Target/TargetFrameInfo.h" +#include "llvm/Target/TargetFrameLowering.h" namespace llvm { class MSP430Subtarget; -class MSP430FrameInfo : public TargetFrameInfo { +class MSP430FrameLowering : public TargetFrameLowering { protected: const MSP430Subtarget &STI; public: - explicit MSP430FrameInfo(const MSP430Subtarget &sti) - : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 2, -2), STI(sti) { + explicit MSP430FrameLowering(const MSP430Subtarget &sti) + : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 2, -2), STI(sti) { } /// emitProlog/emitEpilog - These methods insert prolog and epilog code into diff --git a/lib/Target/MSP430/MSP430RegisterInfo.cpp b/lib/Target/MSP430/MSP430RegisterInfo.cpp index 646375c..1da6d8d 100644 --- a/lib/Target/MSP430/MSP430RegisterInfo.cpp +++ b/lib/Target/MSP430/MSP430RegisterInfo.cpp @@ -33,12 +33,12 @@ MSP430RegisterInfo::MSP430RegisterInfo(MSP430TargetMachine &tm, const TargetInstrInfo &tii) : MSP430GenRegisterInfo(MSP430::ADJCALLSTACKDOWN, MSP430::ADJCALLSTACKUP), TM(tm), TII(tii) { - StackAlign = TM.getFrameInfo()->getStackAlignment(); + StackAlign = TM.getFrameLowering()->getStackAlignment(); } const unsigned* MSP430RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const { - const TargetFrameInfo *TFI = MF->getTarget().getFrameInfo(); + const TargetFrameLowering *TFI = MF->getTarget().getFrameLowering(); const Function* F = MF->getFunction(); static const unsigned CalleeSavedRegs[] = { MSP430::FPW, MSP430::R5W, MSP430::R6W, MSP430::R7W, @@ -74,7 +74,7 @@ MSP430RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const { BitVector MSP430RegisterInfo::getReservedRegs(const MachineFunction &MF) const { BitVector Reserved(getNumRegs()); - const TargetFrameInfo *TFI = MF.getTarget().getFrameInfo(); + const TargetFrameLowering *TFI = MF.getTarget().getFrameLowering(); // Mark 4 special registers as reserved. Reserved.set(MSP430::PCW); @@ -97,7 +97,7 @@ MSP430RegisterInfo::getPointerRegClass(unsigned Kind) const { void MSP430RegisterInfo:: eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const { - const TargetFrameInfo *TFI = MF.getTarget().getFrameInfo(); + const TargetFrameLowering *TFI = MF.getTarget().getFrameLowering(); if (!TFI->hasReservedCallFrame(MF)) { // If the stack pointer can be changed after prologue, turn the @@ -163,7 +163,7 @@ MSP430RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, MachineInstr &MI = *II; MachineBasicBlock &MBB = *MI.getParent(); MachineFunction &MF = *MBB.getParent(); - const TargetFrameInfo *TFI = MF.getTarget().getFrameInfo(); + const TargetFrameLowering *TFI = MF.getTarget().getFrameLowering(); DebugLoc dl = MI.getDebugLoc(); while (!MI.getOperand(i).isFI()) { ++i; @@ -216,7 +216,7 @@ MSP430RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, void MSP430RegisterInfo::processFunctionBeforeFrameFinalized(MachineFunction &MF) const { - const TargetFrameInfo *TFI = MF.getTarget().getFrameInfo(); + const TargetFrameLowering *TFI = MF.getTarget().getFrameLowering(); // Create a frame entry for the FPW register that must be saved. if (TFI->hasFP(MF)) { @@ -232,7 +232,7 @@ unsigned MSP430RegisterInfo::getRARegister() const { } unsigned MSP430RegisterInfo::getFrameRegister(const MachineFunction &MF) const { - const TargetFrameInfo *TFI = MF.getTarget().getFrameInfo(); + const TargetFrameLowering *TFI = MF.getTarget().getFrameLowering(); return TFI->hasFP(MF) ? MSP430::FPW : MSP430::SPW; } diff --git a/lib/Target/MSP430/MSP430RegisterInfo.td b/lib/Target/MSP430/MSP430RegisterInfo.td index cca02e0..ab7b59b 100644 --- a/lib/Target/MSP430/MSP430RegisterInfo.td +++ b/lib/Target/MSP430/MSP430RegisterInfo.td @@ -79,7 +79,7 @@ def GR8 : RegisterClass<"MSP430", [i8], 8, GR8Class::iterator GR8Class::allocation_order_end(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); - const TargetFrameInfo *TFI = TM.getFrameInfo(); + const TargetFrameLowering *TFI = TM.getFrameLowering(); // Depending on whether the function uses frame pointer or not, last 5 or 4 // registers on the list above are reserved if (TFI->hasFP(MF)) @@ -106,7 +106,7 @@ def GR16 : RegisterClass<"MSP430", [i16], 16, GR16Class::iterator GR16Class::allocation_order_end(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); - const TargetFrameInfo *TFI = TM.getFrameInfo(); + const TargetFrameLowering *TFI = TM.getFrameLowering(); // Depending on whether the function uses frame pointer or not, last 5 or 4 // registers on the list above are reserved if (TFI->hasFP(MF)) diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp index 603f460..fba9536 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -34,7 +34,7 @@ MSP430TargetMachine::MSP430TargetMachine(const Target &T, // FIXME: Check TargetData string. DataLayout("e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16"), InstrInfo(*this), TLInfo(*this), TSInfo(*this), - FrameInfo(Subtarget) { } + FrameLowering(Subtarget) { } bool MSP430TargetMachine::addInstSelector(PassManagerBase &PM, diff --git a/lib/Target/MSP430/MSP430TargetMachine.h b/lib/Target/MSP430/MSP430TargetMachine.h index 8fccab1..cee3b04 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.h +++ b/lib/Target/MSP430/MSP430TargetMachine.h @@ -17,12 +17,12 @@ #include "MSP430InstrInfo.h" #include "MSP430ISelLowering.h" -#include "MSP430FrameInfo.h" +#include "MSP430FrameLowering.h" #include "MSP430SelectionDAGInfo.h" #include "MSP430RegisterInfo.h" #include "MSP430Subtarget.h" #include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetFrameInfo.h" +#include "llvm/Target/TargetFrameLowering.h" #include "llvm/Target/TargetMachine.h" namespace llvm { @@ -35,13 +35,15 @@ class MSP430TargetMachine : public LLVMTargetMachine { MSP430InstrInfo InstrInfo; MSP430TargetLowering TLInfo; MSP430SelectionDAGInfo TSInfo; - MSP430FrameInfo FrameInfo; + MSP430FrameLowering FrameLowering; public: MSP430TargetMachine(const Target &T, const std::string &TT, const std::string &FS); - virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } + virtual const TargetFrameLowering *getFrameLowering() const { + return &FrameLowering; + } virtual const MSP430InstrInfo *getInstrInfo() const { return &InstrInfo; } virtual const TargetData *getTargetData() const { return &DataLayout;} virtual const MSP430Subtarget *getSubtargetImpl() const { return &Subtarget; } |