Remove duplicate copy of InstrItineraryData from the TargetMachine,
authorEric Christopher <echristo@gmail.com>
Wed, 11 Jun 2014 00:53:17 +0000 (00:53 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 11 Jun 2014 00:53:17 +0000 (00:53 +0000)
it's already on the subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210619 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCTargetMachine.cpp
lib/Target/PowerPC/PPCTargetMachine.h

index 2323addd21af7d5fd8eaddca1d318d38182519b3..2e55a76515f28e2ce14bf9d45faadc7995abea95 100644 (file)
@@ -72,18 +72,14 @@ static std::string getDataLayoutString(const PPCSubtarget &ST) {
   return Ret;
 }
 
-PPCTargetMachine::PPCTargetMachine(const Target &T, StringRef TT,
-                                   StringRef CPU, StringRef FS,
-                                   const TargetOptions &Options,
+PPCTargetMachine::PPCTargetMachine(const Target &T, StringRef TT, StringRef CPU,
+                                   StringRef FS, const TargetOptions &Options,
                                    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),
-    DL(getDataLayoutString(Subtarget)), InstrInfo(*this),
-    FrameLowering(Subtarget), JITInfo(*this, is64Bit),
-    TLInfo(*this), TSInfo(*this),
-    InstrItins(Subtarget.getInstrItineraryData()) {
+                                   CodeGenOpt::Level OL, bool is64Bit)
+    : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
+      Subtarget(TT, CPU, FS, is64Bit, OL), DL(getDataLayoutString(Subtarget)),
+      InstrInfo(*this), FrameLowering(Subtarget), JITInfo(*this, is64Bit),
+      TLInfo(*this), TSInfo(*this) {
   initAsmInfo();
 }
 
index 9e924945d8fa32d5f83b68395ab30acb17758ad2..7d76ec4dd961f006dfe4eeeb3571877a8777ded6 100644 (file)
@@ -35,7 +35,6 @@ class PPCTargetMachine : public LLVMTargetMachine {
   PPCJITInfo          JITInfo;
   PPCTargetLowering   TLInfo;
   PPCSelectionDAGInfo TSInfo;
-  InstrItineraryData  InstrItins;
 
 public:
   PPCTargetMachine(const Target &T, StringRef TT,
@@ -61,7 +60,7 @@ public:
   const DataLayout    *getDataLayout() const override    { return &DL; }
   const PPCSubtarget  *getSubtargetImpl() const override { return &Subtarget; }
   const InstrItineraryData *getInstrItineraryData() const override {
-    return &InstrItins;
+    return &getSubtargetImpl()->getInstrItineraryData();
   }
 
   // Pass Pipeline Configuration