mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Remove the TargetMachine forwards for TargetSubtargetInfo based
information and update all callers. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -36,6 +36,7 @@
|
||||
#include "llvm/Target/TargetFrameLowering.h"
|
||||
#include "llvm/Target/TargetLowering.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||
using namespace llvm;
|
||||
|
||||
#define DEBUG_TYPE "codegen"
|
||||
@ -55,7 +56,7 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
|
||||
unsigned FunctionNum, MachineModuleInfo &mmi,
|
||||
GCModuleInfo* gmi)
|
||||
: Fn(F), Target(TM), Ctx(mmi.getContext()), MMI(mmi), GMI(gmi) {
|
||||
if (TM.getRegisterInfo())
|
||||
if (TM.getSubtargetImpl()->getRegisterInfo())
|
||||
RegInfo = new (Allocator) MachineRegisterInfo(TM);
|
||||
else
|
||||
RegInfo = nullptr;
|
||||
@ -70,13 +71,15 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
|
||||
getStackAlignment(AttributeSet::FunctionIndex));
|
||||
|
||||
ConstantPool = new (Allocator) MachineConstantPool(TM);
|
||||
Alignment = TM.getTargetLowering()->getMinFunctionAlignment();
|
||||
Alignment =
|
||||
TM.getSubtargetImpl()->getTargetLowering()->getMinFunctionAlignment();
|
||||
|
||||
// FIXME: Shouldn't use pref alignment if explicit alignment is set on Fn.
|
||||
if (!Fn->getAttributes().hasAttribute(AttributeSet::FunctionIndex,
|
||||
Attribute::OptimizeForSize))
|
||||
Alignment = std::max(Alignment,
|
||||
TM.getTargetLowering()->getPrefFunctionAlignment());
|
||||
Alignment = std::max(
|
||||
Alignment,
|
||||
TM.getSubtargetImpl()->getTargetLowering()->getPrefFunctionAlignment());
|
||||
|
||||
FunctionNumber = FunctionNum;
|
||||
JumpTableInfo = nullptr;
|
||||
@ -350,7 +353,8 @@ void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const {
|
||||
// Print Constant Pool
|
||||
ConstantPool->print(OS);
|
||||
|
||||
const TargetRegisterInfo *TRI = getTarget().getRegisterInfo();
|
||||
const TargetRegisterInfo *TRI =
|
||||
getTarget().getSubtargetImpl()->getRegisterInfo();
|
||||
|
||||
if (RegInfo && !RegInfo->livein_empty()) {
|
||||
OS << "Function Live Ins: ";
|
||||
@ -459,7 +463,7 @@ unsigned MachineFunction::addLiveIn(unsigned PReg,
|
||||
/// normal 'L' label is returned.
|
||||
MCSymbol *MachineFunction::getJTISymbol(unsigned JTI, MCContext &Ctx,
|
||||
bool isLinkerPrivate) const {
|
||||
const DataLayout *DL = getTarget().getDataLayout();
|
||||
const DataLayout *DL = getTarget().getSubtargetImpl()->getDataLayout();
|
||||
assert(JumpTableInfo && "No jump tables");
|
||||
assert(JTI < JumpTableInfo->getJumpTables().size() && "Invalid JTI!");
|
||||
|
||||
@ -474,7 +478,7 @@ MCSymbol *MachineFunction::getJTISymbol(unsigned JTI, MCContext &Ctx,
|
||||
/// getPICBaseSymbol - Return a function-local symbol to represent the PIC
|
||||
/// base.
|
||||
MCSymbol *MachineFunction::getPICBaseSymbol() const {
|
||||
const DataLayout *DL = getTarget().getDataLayout();
|
||||
const DataLayout *DL = getTarget().getSubtargetImpl()->getDataLayout();
|
||||
return Ctx.GetOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix())+
|
||||
Twine(getFunctionNumber())+"$pb");
|
||||
}
|
||||
@ -484,7 +488,7 @@ MCSymbol *MachineFunction::getPICBaseSymbol() const {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
const TargetFrameLowering *MachineFrameInfo::getFrameLowering() const {
|
||||
return TM.getFrameLowering();
|
||||
return TM.getSubtargetImpl()->getFrameLowering();
|
||||
}
|
||||
|
||||
/// ensureMaxAlignment - Make sure the function is at least Align bytes
|
||||
@ -600,7 +604,7 @@ MachineFrameInfo::getPristineRegs(const MachineBasicBlock *MBB) const {
|
||||
const MachineFunction *MF = MBB->getParent();
|
||||
assert(MF && "MBB must be part of a MachineFunction");
|
||||
const TargetMachine &TM = MF->getTarget();
|
||||
const TargetRegisterInfo *TRI = TM.getRegisterInfo();
|
||||
const TargetRegisterInfo *TRI = TM.getSubtargetImpl()->getRegisterInfo();
|
||||
BitVector BV(TRI->getNumRegs());
|
||||
|
||||
// Before CSI is calculated, no registers are considered pristine. They can be
|
||||
@ -625,8 +629,10 @@ MachineFrameInfo::getPristineRegs(const MachineBasicBlock *MBB) const {
|
||||
}
|
||||
|
||||
unsigned MachineFrameInfo::estimateStackSize(const MachineFunction &MF) const {
|
||||
const TargetFrameLowering *TFI = MF.getTarget().getFrameLowering();
|
||||
const TargetRegisterInfo *RegInfo = MF.getTarget().getRegisterInfo();
|
||||
const TargetFrameLowering *TFI =
|
||||
MF.getTarget().getSubtargetImpl()->getFrameLowering();
|
||||
const TargetRegisterInfo *RegInfo =
|
||||
MF.getTarget().getSubtargetImpl()->getRegisterInfo();
|
||||
unsigned MaxAlign = getMaxAlignment();
|
||||
int Offset = 0;
|
||||
|
||||
@ -676,7 +682,8 @@ unsigned MachineFrameInfo::estimateStackSize(const MachineFunction &MF) const {
|
||||
void MachineFrameInfo::print(const MachineFunction &MF, raw_ostream &OS) const{
|
||||
if (Objects.empty()) return;
|
||||
|
||||
const TargetFrameLowering *FI = MF.getTarget().getFrameLowering();
|
||||
const TargetFrameLowering *FI =
|
||||
MF.getTarget().getSubtargetImpl()->getFrameLowering();
|
||||
int ValOffset = (FI ? FI->getOffsetOfLocalArea() : 0);
|
||||
|
||||
OS << "Frame Objects:\n";
|
||||
@ -820,7 +827,7 @@ void MachineJumpTableInfo::dump() const { print(dbgs()); }
|
||||
void MachineConstantPoolValue::anchor() { }
|
||||
|
||||
const DataLayout *MachineConstantPool::getDataLayout() const {
|
||||
return TM.getDataLayout();
|
||||
return TM.getSubtargetImpl()->getDataLayout();
|
||||
}
|
||||
|
||||
Type *MachineConstantPoolEntry::getType() const {
|
||||
|
Reference in New Issue
Block a user