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

Eric Christopher echristo at gmail.com
Tue Aug 5 17:44:06 PDT 2014


Ah, thanks.

-eric

On Tue, Aug 5, 2014 at 3:10 PM, Rafael Espindola
<rafael.espindola at gmail.com> wrote:
> 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;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list