diff options
author | Eric Christopher <echristo@gmail.com> | 2014-06-12 22:05:46 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-06-12 22:05:46 +0000 |
commit | e3466d37775439646f445202834a455bb21e9e95 (patch) | |
tree | d16641a09a3125a5be782277305b5c253eec4bcc /lib | |
parent | 647ab7f728681b0ab9800f6feacdc29afa7a517c (diff) | |
download | llvm-e3466d37775439646f445202834a455bb21e9e95.tar.gz llvm-e3466d37775439646f445202834a455bb21e9e95.tar.bz2 llvm-e3466d37775439646f445202834a455bb21e9e95.tar.xz |
Move PPCInstrInfo off of the target machine and onto the subtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210839 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/PowerPC/PPCSubtarget.cpp | 2 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCSubtarget.h | 3 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetMachine.cpp | 4 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetMachine.h | 9 |
4 files changed, 11 insertions, 7 deletions
diff --git a/lib/Target/PowerPC/PPCSubtarget.cpp b/lib/Target/PowerPC/PPCSubtarget.cpp index 899a27b74a..355902875d 100644 --- a/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/lib/Target/PowerPC/PPCSubtarget.cpp @@ -80,7 +80,7 @@ PPCSubtarget::PPCSubtarget(const std::string &TT, const std::string &CPU, : PPCGenSubtargetInfo(TT, CPU, FS), IsPPC64(is64Bit), TargetTriple(TT), OptLevel(OptLevel), FrameLowering(initializeSubtargetDependencies(CPU, FS)), - DL(getDataLayoutString(*this)) {} + DL(getDataLayoutString(*this)), InstrInfo(*this) {} /// SetJITMode - This is called to inform the subtarget info that we are /// producing code for the JIT. diff --git a/lib/Target/PowerPC/PPCSubtarget.h b/lib/Target/PowerPC/PPCSubtarget.h index 55145d3425..9d4c264ac5 100644 --- a/lib/Target/PowerPC/PPCSubtarget.h +++ b/lib/Target/PowerPC/PPCSubtarget.h @@ -15,6 +15,7 @@ #define POWERPCSUBTARGET_H #include "PPCFrameLowering.h" +#include "PPCInstrInfo.h" #include "llvm/ADT/Triple.h" #include "llvm/IR/DataLayout.h" #include "llvm/MC/MCInstrItineraries.h" @@ -106,6 +107,7 @@ protected: PPCFrameLowering FrameLowering; const DataLayout DL; + PPCInstrInfo InstrInfo; public: /// This constructor initializes the data members to match that @@ -138,6 +140,7 @@ public: const PPCFrameLowering *getFrameLowering() const { return &FrameLowering; } const DataLayout *getDataLayout() const { return &DL; } + const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; } /// initializeSubtargetDependencies - Initializes using a CPU and feature string /// so that we can use initializer lists for subtarget initialization. diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index 869fe89126..4e04dfa2a3 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -42,8 +42,8 @@ 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, is64Bit, OL), InstrInfo(Subtarget), - JITInfo(*this, is64Bit), TLInfo(*this), TSInfo(*this) { + Subtarget(TT, CPU, FS, is64Bit, OL), JITInfo(*this, is64Bit), + TLInfo(*this), TSInfo(*this) { initAsmInfo(); } diff --git a/lib/Target/PowerPC/PPCTargetMachine.h b/lib/Target/PowerPC/PPCTargetMachine.h index 632c40618f..ecfdf27591 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.h +++ b/lib/Target/PowerPC/PPCTargetMachine.h @@ -29,7 +29,6 @@ namespace llvm { /// class PPCTargetMachine : public LLVMTargetMachine { PPCSubtarget Subtarget; - PPCInstrInfo InstrInfo; PPCJITInfo JITInfo; PPCTargetLowering TLInfo; PPCSelectionDAGInfo TSInfo; @@ -40,7 +39,9 @@ public: Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL, bool is64Bit); - const PPCInstrInfo *getInstrInfo() const override { return &InstrInfo; } + const PPCInstrInfo *getInstrInfo() const override { + return getSubtargetImpl()->getInstrInfo(); + } const PPCFrameLowering *getFrameLowering() const override { return getSubtargetImpl()->getFrameLowering(); } @@ -51,8 +52,8 @@ public: const PPCSelectionDAGInfo* getSelectionDAGInfo() const override { return &TSInfo; } - const PPCRegisterInfo *getRegisterInfo() const override { - return &InstrInfo.getRegisterInfo(); + const PPCRegisterInfo *getRegisterInfo() const override { + return &getInstrInfo()->getRegisterInfo(); } const DataLayout *getDataLayout() const override { |