[llvm] r214929 - Remove a virtual function from TargetMachine. NFC.

Rafael Espindola rafael.espindola at gmail.com
Tue Aug 5 15:10:22 PDT 2014


Author: rafael
Date: Tue Aug  5 17:10:21 2014
New Revision: 214929

URL: http://llvm.org/viewvc/llvm-project?rev=214929&view=rev
Log:
Remove a virtual function from TargetMachine. NFC.

Modified:
    llvm/trunk/include/llvm/Target/TargetMachine.h
    llvm/trunk/lib/Target/ARM/ARMTargetMachine.h
    llvm/trunk/lib/Target/Mips/MipsTargetMachine.h
    llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h
    llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h
    llvm/trunk/lib/Target/X86/X86TargetMachine.h

Modified: llvm/trunk/include/llvm/Target/TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=214929&r1=214928&r2=214929&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetMachine.h (original)
+++ llvm/trunk/include/llvm/Target/TargetMachine.h Tue Aug  5 17:10:21 2014
@@ -101,7 +101,7 @@ public:
   virtual const TargetSubtargetInfo *getSubtargetImpl() const {
     return nullptr;
   }
-  virtual TargetSubtargetInfo *getSubtargetImpl() {
+  TargetSubtargetInfo *getSubtargetImpl() {
     const TargetMachine *TM = this;
     return const_cast<TargetSubtargetInfo *>(TM->getSubtargetImpl());
   }

Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.h?rev=214929&r1=214928&r2=214929&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.h Tue Aug  5 17:10:21 2014
@@ -33,7 +33,6 @@ public:
                        bool isLittle);
 
   const ARMSubtarget *getSubtargetImpl() const override { return &Subtarget; }
-  ARMSubtarget *getSubtargetImpl() override { return &Subtarget; }
 
   /// \brief Register ARM analysis passes with a pass manager.
   void addAnalysisPasses(PassManagerBase &PM) override;

Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.h?rev=214929&r1=214928&r2=214929&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetMachine.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.h Tue Aug  5 17:10:21 2014
@@ -44,10 +44,8 @@ public:
       return Subtarget;
     return &DefaultSubtarget;
   }
-  MipsSubtarget *getSubtargetImpl() override {
-    if (Subtarget)
-      return Subtarget;
-    return &DefaultSubtarget;
+  MipsSubtarget *getSubtargetImpl() {
+    return static_cast<MipsSubtarget *>(TargetMachine::getSubtargetImpl());
   }
 
   /// \brief Reset the subtarget for the Mips target.

Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h?rev=214929&r1=214928&r2=214929&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h Tue Aug  5 17:10:21 2014
@@ -33,7 +33,6 @@ public:
                    CodeGenOpt::Level OL, bool is64Bit);
 
   const PPCSubtarget *getSubtargetImpl() const override { return &Subtarget; }
-  PPCSubtarget *getSubtargetImpl() override { return &Subtarget; }
 
   // Pass Pipeline Configuration
   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;

Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h?rev=214929&r1=214928&r2=214929&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h (original)
+++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h Tue Aug  5 17:10:21 2014
@@ -29,7 +29,10 @@ public:
                      CodeGenOpt::Level OL, bool is64bit);
 
   const SparcSubtarget *getSubtargetImpl() const override { return &Subtarget; }
-  SparcSubtarget *getSubtargetImpl() override { return &Subtarget; }
+
+  SparcSubtarget *getSubtargetImpl() {
+    return static_cast<SparcSubtarget *>(TargetMachine::getSubtargetImpl());
+  }
 
   // Pass Pipeline Configuration
   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;

Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.h?rev=214929&r1=214928&r2=214929&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.h (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.h Tue Aug  5 17:10:21 2014
@@ -32,7 +32,10 @@ public:
                    Reloc::Model RM, CodeModel::Model CM,
                    CodeGenOpt::Level OL);
   const X86Subtarget *getSubtargetImpl() const override { return &Subtarget; }
-  X86Subtarget *getSubtargetImpl() override { return &Subtarget; }
+
+  X86Subtarget *getSubtargetImpl() {
+    return static_cast<X86Subtarget *>(TargetMachine::getSubtargetImpl());
+  }
 
   /// \brief Register X86 analysis passes with a pass manager.
   void addAnalysisPasses(PassManagerBase &PM) override;





More information about the llvm-commits mailing list