mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
Move ARMSelectionDAGInfo from the TargetMachine to the subtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1ee246100e
commit
f7a2d5e387
@ -147,7 +147,8 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &CPU,
|
||||
: ARMGenSubtargetInfo(TT, CPU, FS), ARMProcFamily(Others),
|
||||
ARMProcClass(None), stackAlignment(4), CPUString(CPU), IsLittle(IsLittle),
|
||||
TargetTriple(TT), Options(Options), TargetABI(ARM_ABI_UNKNOWN),
|
||||
DL(computeDataLayout(initializeSubtargetDependencies(CPU, FS))) {}
|
||||
DL(computeDataLayout(initializeSubtargetDependencies(CPU, FS))),
|
||||
TSInfo(DL) {}
|
||||
|
||||
void ARMSubtarget::initializeEnvironment() {
|
||||
HasV4TOps = false;
|
||||
|
@ -14,6 +14,7 @@
|
||||
#ifndef ARMSUBTARGET_H
|
||||
#define ARMSUBTARGET_H
|
||||
|
||||
#include "ARMSelectionDAGInfo.h"
|
||||
#include "MCTargetDesc/ARMMCTargetDesc.h"
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/IR/DataLayout.h"
|
||||
@ -254,9 +255,11 @@ protected:
|
||||
ARMSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
|
||||
|
||||
const DataLayout *getDataLayout() const { return &DL; }
|
||||
const ARMSelectionDAGInfo *getSelectionDAGInfo() const { return &TSInfo; }
|
||||
|
||||
private:
|
||||
const DataLayout DL;
|
||||
ARMSelectionDAGInfo TSInfo;
|
||||
|
||||
void initializeEnvironment();
|
||||
void resetSubtargetFeatures(StringRef CPU, StringRef FS);
|
||||
|
@ -82,7 +82,6 @@ ARMTargetMachine::ARMTargetMachine(const Target &T, StringRef TT,
|
||||
: ARMBaseTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, isLittle),
|
||||
InstrInfo(Subtarget),
|
||||
TLInfo(*this),
|
||||
TSInfo(*getDataLayout()),
|
||||
FrameLowering(Subtarget) {
|
||||
initAsmInfo();
|
||||
if (!Subtarget.hasARMOps())
|
||||
@ -121,7 +120,6 @@ ThumbTargetMachine::ThumbTargetMachine(const Target &T, StringRef TT,
|
||||
? ((ARMBaseInstrInfo*)new Thumb2InstrInfo(Subtarget))
|
||||
: ((ARMBaseInstrInfo*)new Thumb1InstrInfo(Subtarget))),
|
||||
TLInfo(*this),
|
||||
TSInfo(*getDataLayout()),
|
||||
FrameLowering(Subtarget.hasThumb2()
|
||||
? new ARMFrameLowering(Subtarget)
|
||||
: (ARMFrameLowering*)new Thumb1FrameLowering(Subtarget)) {
|
||||
|
@ -69,7 +69,6 @@ class ARMTargetMachine : public ARMBaseTargetMachine {
|
||||
virtual void anchor();
|
||||
ARMInstrInfo InstrInfo;
|
||||
ARMTargetLowering TLInfo;
|
||||
ARMSelectionDAGInfo TSInfo;
|
||||
ARMFrameLowering FrameLowering;
|
||||
public:
|
||||
ARMTargetMachine(const Target &T, StringRef TT,
|
||||
@ -88,7 +87,7 @@ class ARMTargetMachine : public ARMBaseTargetMachine {
|
||||
}
|
||||
|
||||
const ARMSelectionDAGInfo *getSelectionDAGInfo() const override {
|
||||
return &TSInfo;
|
||||
return getSubtargetImpl()->getSelectionDAGInfo();
|
||||
}
|
||||
const ARMFrameLowering *getFrameLowering() const override {
|
||||
return &FrameLowering;
|
||||
@ -130,7 +129,6 @@ class ThumbTargetMachine : public ARMBaseTargetMachine {
|
||||
// Either Thumb1InstrInfo or Thumb2InstrInfo.
|
||||
std::unique_ptr<ARMBaseInstrInfo> InstrInfo;
|
||||
ARMTargetLowering TLInfo;
|
||||
ARMSelectionDAGInfo TSInfo;
|
||||
// Either Thumb1FrameLowering or ARMFrameLowering.
|
||||
std::unique_ptr<ARMFrameLowering> FrameLowering;
|
||||
public:
|
||||
@ -151,7 +149,7 @@ public:
|
||||
}
|
||||
|
||||
const ARMSelectionDAGInfo *getSelectionDAGInfo() const override {
|
||||
return &TSInfo;
|
||||
return getSubtargetImpl()->getSelectionDAGInfo();
|
||||
}
|
||||
|
||||
/// returns either Thumb1InstrInfo or Thumb2InstrInfo
|
||||
|
Loading…
Reference in New Issue
Block a user