Move the PPCSelectionDAGInfo off the TargetMachine and onto the

subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210854 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2014-06-12 23:02:32 +00:00
parent 8c5dc520ef
commit cccc317ee0
4 changed files with 6 additions and 5 deletions

@ -81,7 +81,7 @@ PPCSubtarget::PPCSubtarget(const std::string &TT, const std::string &CPU,
OptLevel(OptLevel),
FrameLowering(initializeSubtargetDependencies(CPU, FS)),
DL(getDataLayoutString(*this)), InstrInfo(*this), JITInfo(*this),
TLInfo(TM) {}
TLInfo(TM), TSInfo(&DL) {}
/// SetJITMode - This is called to inform the subtarget info that we are
/// producing code for the JIT.

@ -18,6 +18,7 @@
#include "PPCInstrInfo.h"
#include "PPCISelLowering.h"
#include "PPCJITInfo.h"
#include "PPCSelectionDAGInfo.h"
#include "llvm/ADT/Triple.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/MC/MCInstrItineraries.h"
@ -112,6 +113,7 @@ protected:
PPCInstrInfo InstrInfo;
PPCJITInfo JITInfo;
PPCTargetLowering TLInfo;
PPCSelectionDAGInfo TSInfo;
public:
/// This constructor initializes the data members to match that
@ -147,6 +149,7 @@ public:
const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
PPCJITInfo *getJITInfo() { return &JITInfo; }
const PPCTargetLowering *getTargetLowering() const { return &TLInfo; }
const PPCSelectionDAGInfo *getSelectionDAGInfo() const { return &TSInfo; }
/// initializeSubtargetDependencies - Initializes using a CPU and feature string
/// so that we can use initializer lists for subtarget initialization.

@ -42,8 +42,7 @@ PPCTargetMachine::PPCTargetMachine(const Target &T, StringRef TT, StringRef CPU,
Reloc::Model RM, CodeModel::Model CM,
CodeGenOpt::Level OL, bool is64Bit)
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
Subtarget(TT, CPU, FS, *this, is64Bit, OL),
TSInfo(Subtarget.getDataLayout()) {
Subtarget(TT, CPU, FS, *this, is64Bit, OL) {
initAsmInfo();
}

@ -29,7 +29,6 @@ namespace llvm {
///
class PPCTargetMachine : public LLVMTargetMachine {
PPCSubtarget Subtarget;
PPCSelectionDAGInfo TSInfo;
public:
PPCTargetMachine(const Target &T, StringRef TT,
@ -48,7 +47,7 @@ public:
return getSubtargetImpl()->getTargetLowering();
}
const PPCSelectionDAGInfo* getSelectionDAGInfo() const override {
return &TSInfo;
return getSubtargetImpl()->getSelectionDAGInfo();
}
const PPCRegisterInfo *getRegisterInfo() const override {
return &getInstrInfo()->getRegisterInfo();