mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-20 20:38:48 +00:00
Move ARMJITInfo off of the TargetMachine and down onto the subtarget.
This required untangling a mess of headers that included around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210953 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
087f56e927
commit
58c99da4d8
@ -15,6 +15,7 @@
|
|||||||
#include "ARM.h"
|
#include "ARM.h"
|
||||||
#include "ARMBaseInstrInfo.h"
|
#include "ARMBaseInstrInfo.h"
|
||||||
#include "ARMConstantPoolValue.h"
|
#include "ARMConstantPoolValue.h"
|
||||||
|
#include "ARMMachineFunctionInfo.h"
|
||||||
#include "ARMRelocations.h"
|
#include "ARMRelocations.h"
|
||||||
#include "ARMSubtarget.h"
|
#include "ARMSubtarget.h"
|
||||||
#include "ARMTargetMachine.h"
|
#include "ARMTargetMachine.h"
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "ARMJITInfo.h"
|
#include "ARMJITInfo.h"
|
||||||
#include "ARMConstantPoolValue.h"
|
#include "ARMConstantPoolValue.h"
|
||||||
|
#include "ARMMachineFunctionInfo.h"
|
||||||
#include "ARMRelocations.h"
|
#include "ARMRelocations.h"
|
||||||
#include "MCTargetDesc/ARMBaseInfo.h"
|
#include "MCTargetDesc/ARMBaseInfo.h"
|
||||||
#include "llvm/CodeGen/JITCodeEmitter.h"
|
#include "llvm/CodeGen/JITCodeEmitter.h"
|
||||||
@ -334,3 +335,10 @@ void ARMJITInfo::relocate(void *Function, MachineRelocation *MR,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ARMJITInfo::Initialize(const MachineFunction &MF, bool isPIC) {
|
||||||
|
const ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
|
||||||
|
ConstPoolId2AddrMap.resize(AFI->getNumPICLabels());
|
||||||
|
JumpTableId2AddrMap.resize(AFI->getNumJumpTables());
|
||||||
|
IsPIC = isPIC;
|
||||||
|
}
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#ifndef ARMJITINFO_H
|
#ifndef ARMJITINFO_H
|
||||||
#define ARMJITINFO_H
|
#define ARMJITINFO_H
|
||||||
|
|
||||||
#include "ARMMachineFunctionInfo.h"
|
|
||||||
#include "llvm/ADT/DenseMap.h"
|
#include "llvm/ADT/DenseMap.h"
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||||
@ -103,12 +102,7 @@ namespace llvm {
|
|||||||
/// Resize constant pool ids to CONSTPOOL_ENTRY addresses map; resize
|
/// Resize constant pool ids to CONSTPOOL_ENTRY addresses map; resize
|
||||||
/// jump table ids to jump table bases map; remember if codegen relocation
|
/// jump table ids to jump table bases map; remember if codegen relocation
|
||||||
/// model is PIC.
|
/// model is PIC.
|
||||||
void Initialize(const MachineFunction &MF, bool isPIC) {
|
void Initialize(const MachineFunction &MF, bool isPIC);
|
||||||
const ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
|
|
||||||
ConstPoolId2AddrMap.resize(AFI->getNumPICLabels());
|
|
||||||
JumpTableId2AddrMap.resize(AFI->getNumJumpTables());
|
|
||||||
IsPIC = isPIC;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// getConstantPoolEntryAddr - The ARM target puts all constant
|
/// getConstantPoolEntryAddr - The ARM target puts all constant
|
||||||
/// pool entries into constant islands. This returns the address of the
|
/// pool entries into constant islands. This returns the address of the
|
||||||
|
@ -12,3 +12,13 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
void ARMFunctionInfo::anchor() { }
|
void ARMFunctionInfo::anchor() { }
|
||||||
|
|
||||||
|
ARMFunctionInfo::ARMFunctionInfo(MachineFunction &MF)
|
||||||
|
: isThumb(MF.getTarget().getSubtarget<ARMSubtarget>().isThumb()),
|
||||||
|
hasThumb2(MF.getTarget().getSubtarget<ARMSubtarget>().hasThumb2()),
|
||||||
|
StByValParamsPadding(0), ArgRegsSaveSize(0), HasStackFrame(false),
|
||||||
|
RestoreSPFromFP(false), LRSpilledForFarJump(false),
|
||||||
|
FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0),
|
||||||
|
GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0), JumpTableUId(0),
|
||||||
|
PICLabelUId(0), VarArgsFrameIndex(0), HasITBlocks(false),
|
||||||
|
GlobalBaseReg(0) {}
|
||||||
|
@ -130,16 +130,7 @@ public:
|
|||||||
JumpTableUId(0), PICLabelUId(0),
|
JumpTableUId(0), PICLabelUId(0),
|
||||||
VarArgsFrameIndex(0), HasITBlocks(false), GlobalBaseReg(0) {}
|
VarArgsFrameIndex(0), HasITBlocks(false), GlobalBaseReg(0) {}
|
||||||
|
|
||||||
explicit ARMFunctionInfo(MachineFunction &MF) :
|
explicit ARMFunctionInfo(MachineFunction &MF);
|
||||||
isThumb(MF.getTarget().getSubtarget<ARMSubtarget>().isThumb()),
|
|
||||||
hasThumb2(MF.getTarget().getSubtarget<ARMSubtarget>().hasThumb2()),
|
|
||||||
StByValParamsPadding(0),
|
|
||||||
ArgRegsSaveSize(0), HasStackFrame(false), RestoreSPFromFP(false),
|
|
||||||
LRSpilledForFarJump(false),
|
|
||||||
FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0),
|
|
||||||
GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0),
|
|
||||||
JumpTableUId(0), PICLabelUId(0),
|
|
||||||
VarArgsFrameIndex(0), HasITBlocks(false), GlobalBaseReg(0) {}
|
|
||||||
|
|
||||||
bool isThumbFunction() const { return isThumb; }
|
bool isThumbFunction() const { return isThumb; }
|
||||||
bool isThumb1OnlyFunction() const { return isThumb && !hasThumb2; }
|
bool isThumb1OnlyFunction() const { return isThumb && !hasThumb2; }
|
||||||
|
@ -148,7 +148,7 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &CPU,
|
|||||||
ARMProcClass(None), stackAlignment(4), CPUString(CPU), IsLittle(IsLittle),
|
ARMProcClass(None), stackAlignment(4), CPUString(CPU), IsLittle(IsLittle),
|
||||||
TargetTriple(TT), Options(Options), TargetABI(ARM_ABI_UNKNOWN),
|
TargetTriple(TT), Options(Options), TargetABI(ARM_ABI_UNKNOWN),
|
||||||
DL(computeDataLayout(initializeSubtargetDependencies(CPU, FS))),
|
DL(computeDataLayout(initializeSubtargetDependencies(CPU, FS))),
|
||||||
TSInfo(DL) {}
|
TSInfo(DL), JITInfo() {}
|
||||||
|
|
||||||
void ARMSubtarget::initializeEnvironment() {
|
void ARMSubtarget::initializeEnvironment() {
|
||||||
HasV4TOps = false;
|
HasV4TOps = false;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#ifndef ARMSUBTARGET_H
|
#ifndef ARMSUBTARGET_H
|
||||||
#define ARMSUBTARGET_H
|
#define ARMSUBTARGET_H
|
||||||
|
|
||||||
|
#include "ARMJITInfo.h"
|
||||||
#include "ARMSelectionDAGInfo.h"
|
#include "ARMSelectionDAGInfo.h"
|
||||||
#include "MCTargetDesc/ARMMCTargetDesc.h"
|
#include "MCTargetDesc/ARMMCTargetDesc.h"
|
||||||
#include "llvm/ADT/Triple.h"
|
#include "llvm/ADT/Triple.h"
|
||||||
@ -256,10 +257,12 @@ protected:
|
|||||||
|
|
||||||
const DataLayout *getDataLayout() const { return &DL; }
|
const DataLayout *getDataLayout() const { return &DL; }
|
||||||
const ARMSelectionDAGInfo *getSelectionDAGInfo() const { return &TSInfo; }
|
const ARMSelectionDAGInfo *getSelectionDAGInfo() const { return &TSInfo; }
|
||||||
|
ARMJITInfo *getJITInfo() { return &JITInfo; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const DataLayout DL;
|
const DataLayout DL;
|
||||||
ARMSelectionDAGInfo TSInfo;
|
ARMSelectionDAGInfo TSInfo;
|
||||||
|
ARMJITInfo JITInfo;
|
||||||
|
|
||||||
void initializeEnvironment();
|
void initializeEnvironment();
|
||||||
void resetSubtargetFeatures(StringRef CPU, StringRef FS);
|
void resetSubtargetFeatures(StringRef CPU, StringRef FS);
|
||||||
|
@ -53,7 +53,6 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, StringRef TT,
|
|||||||
bool isLittle)
|
bool isLittle)
|
||||||
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
|
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
|
||||||
Subtarget(TT, CPU, FS, isLittle, Options),
|
Subtarget(TT, CPU, FS, isLittle, Options),
|
||||||
JITInfo(),
|
|
||||||
InstrItins(Subtarget.getInstrItineraryData()) {
|
InstrItins(Subtarget.getInstrItineraryData()) {
|
||||||
|
|
||||||
// Default to triple-appropriate float ABI
|
// Default to triple-appropriate float ABI
|
||||||
|
@ -33,7 +33,6 @@ class ARMBaseTargetMachine : public LLVMTargetMachine {
|
|||||||
protected:
|
protected:
|
||||||
ARMSubtarget Subtarget;
|
ARMSubtarget Subtarget;
|
||||||
private:
|
private:
|
||||||
ARMJITInfo JITInfo;
|
|
||||||
InstrItineraryData InstrItins;
|
InstrItineraryData InstrItins;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -44,7 +43,6 @@ public:
|
|||||||
CodeGenOpt::Level OL,
|
CodeGenOpt::Level OL,
|
||||||
bool isLittle);
|
bool isLittle);
|
||||||
|
|
||||||
ARMJITInfo *getJITInfo() override { return &JITInfo; }
|
|
||||||
const ARMSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
const ARMSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
||||||
const ARMTargetLowering *getTargetLowering() const override {
|
const ARMTargetLowering *getTargetLowering() const override {
|
||||||
// Implemented by derived classes
|
// Implemented by derived classes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user