From fe1686d29a43261f8d8d18fbd09bcc8ba3f19e81 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 2 Jul 2014 00:54:07 +0000 Subject: [PATCH] Remove the cached InstrItineraryData on the TargetMachine, it's unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212149 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Mips/MipsTargetMachine.cpp | 23 ++++++++++------------- lib/Target/Mips/MipsTargetMachine.h | 5 +++-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index 20d52141993..25234b90233 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -80,19 +80,16 @@ static std::string computeDataLayout(const MipsSubtarget &ST) { // offset from the stack/frame pointer, using StackGrowsUp enables // an easier handling. // Using CodeModel::Large enables different CALL behavior. -MipsTargetMachine:: -MipsTargetMachine(const Target &T, StringRef TT, - StringRef CPU, StringRef FS, const TargetOptions &Options, - Reloc::Model RM, CodeModel::Model CM, - CodeGenOpt::Level OL, - bool isLittle) - : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), - Subtarget(TT, CPU, FS, isLittle, RM, this), - DL(computeDataLayout(Subtarget)), - InstrInfo(MipsInstrInfo::create(*this)), - FrameLowering(MipsFrameLowering::create(*this, Subtarget)), - TLInfo(MipsTargetLowering::create(*this)), TSInfo(DL), - InstrItins(Subtarget.getInstrItineraryData()), JITInfo() { +MipsTargetMachine::MipsTargetMachine(const Target &T, StringRef TT, + StringRef CPU, StringRef FS, + const TargetOptions &Options, + Reloc::Model RM, CodeModel::Model CM, + CodeGenOpt::Level OL, bool isLittle) + : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), + Subtarget(TT, CPU, FS, isLittle, RM, this), + DL(computeDataLayout(Subtarget)), InstrInfo(MipsInstrInfo::create(*this)), + FrameLowering(MipsFrameLowering::create(*this, Subtarget)), + TLInfo(MipsTargetLowering::create(*this)), TSInfo(DL), JITInfo() { initAsmInfo(); } diff --git a/lib/Target/Mips/MipsTargetMachine.h b/lib/Target/Mips/MipsTargetMachine.h index a5aa39bc9f4..fee8410d316 100644 --- a/lib/Target/Mips/MipsTargetMachine.h +++ b/lib/Target/Mips/MipsTargetMachine.h @@ -43,7 +43,6 @@ class MipsTargetMachine : public LLVMTargetMachine { std::unique_ptr FrameLoweringSE; std::unique_ptr TLInfoSE; MipsSelectionDAGInfo TSInfo; - const InstrItineraryData &InstrItins; MipsJITInfo JITInfo; public: @@ -67,7 +66,9 @@ public: { return &DL;} const InstrItineraryData *getInstrItineraryData() const override { - return Subtarget.inMips16Mode() ? nullptr : &InstrItins; + return Subtarget.inMips16Mode() + ? nullptr + : &getSubtargetImpl()->getInstrItineraryData(); } MipsJITInfo *getJITInfo() override { return &JITInfo; }