[llvm] r307999 - Add a set of comments explaining why getSubtargetImpl() is deleted on these targets.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 22:56:23 PDT 2017


On Thu, Jul 13, 2017 at 9:34 PM Eric Christopher via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: echristo
> Date: Thu Jul 13 21:33:43 2017
> New Revision: 307999
>
> URL: http://llvm.org/viewvc/llvm-project?rev=307999&view=rev
> Log:
> Add a set of comments explaining why getSubtargetImpl() is deleted on
> these targets.
>
> Modified:
>     llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h
>     llvm/trunk/lib/Target/ARM/ARMTargetMachine.h
>     llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h
>     llvm/trunk/lib/Target/X86/X86TargetMachine.h
>
> Modified: llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h?rev=307999&r1=307998&r2=307999&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h (original)
> +++ llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h Thu Jul 13
> 21:33:43 2017
> @@ -36,6 +36,8 @@ public:
>
>    ~AArch64TargetMachine() override;
>    const AArch64Subtarget *getSubtargetImpl(const Function &F) const
> override;
> +  // The no argument getSubtargetImpl, while it exists on some, targets is
>

comma in the wrong spot here ^ ? ("on some targets, is ...")

Other than that, is there any documentation that could be pointed to.

Possible edit: "is deprecated and should not be used in those targets, nor
reimplemented in this/any other" (the sentence sort of reads like it's
talking about other targets getSubtargetImpl, but not really talking about
this one? (how could a function that doesn't exist be deprecated? so it
must be talking about the other ones, not this one)) *shrug*

Alternatively: // DO NOT IMPLEMENT: There is no such thing as a valid
default subtarget, subtargets are per-function entities based on the
target-specific attributes of each function.


> +  // deprecated and should not be used.
>    const AArch64Subtarget *getSubtargetImpl() const = delete;
>
>    // Pass Pipeline Configuration
>
> Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.h?rev=307999&r1=307998&r2=307999&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.h (original)
> +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.h Thu Jul 13 21:33:43 2017
> @@ -47,6 +47,8 @@ public:
>    ~ARMBaseTargetMachine() override;
>
>    const ARMSubtarget *getSubtargetImpl(const Function &F) const override;
> +  // The no argument getSubtargetImpl, while it exists on some targets, is
> +  // deprecated and should not be used.
>    const ARMSubtarget *getSubtargetImpl() const = delete;
>    bool isLittleEndian() const { return isLittle; }
>
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h?rev=307999&r1=307998&r2=307999&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h Thu Jul 13 21:33:43
> 2017
> @@ -41,6 +41,8 @@ public:
>    ~PPCTargetMachine() override;
>
>    const PPCSubtarget *getSubtargetImpl(const Function &F) const override;
> +  // The no argument getSubtargetImpl, while it exists on some targets, is
> +  // deprecated and should not be used.
>    const PPCSubtarget *getSubtargetImpl() const = delete;
>
>    // Pass Pipeline Configuration
>
> Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.h?rev=307999&r1=307998&r2=307999&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86TargetMachine.h (original)
> +++ llvm/trunk/lib/Target/X86/X86TargetMachine.h Thu Jul 13 21:33:43 2017
> @@ -40,6 +40,8 @@ public:
>    ~X86TargetMachine() override;
>
>    const X86Subtarget *getSubtargetImpl(const Function &F) const override;
> +  // The no argument getSubtargetImpl, while it exists on some targets, is
> +  // deprecated and should not be used.
>    const X86Subtarget *getSubtargetImpl() const = delete;
>
>    TargetIRAnalysis getTargetIRAnalysis() override;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170714/5caffcfa/attachment.html>


More information about the llvm-commits mailing list