diff options
| author | Juergen Ributzka <juergen@apple.com> | 2014-01-24 18:22:59 +0000 |
|---|---|---|
| committer | Juergen Ributzka <juergen@apple.com> | 2014-01-24 18:22:59 +0000 |
| commit | 3e752e7af9ec3455731feca727fabe56df61a994 (patch) | |
| tree | 49bd05e1caf47129ff3aa3e5fc9676e47f934eb5 /llvm/lib/Target | |
| parent | 63e5c1fde580dd60be913359b3238940cc498597 (diff) | |
| download | bcm5719-llvm-3e752e7af9ec3455731feca727fabe56df61a994.tar.gz bcm5719-llvm-3e752e7af9ec3455731feca727fabe56df61a994.zip | |
Add final and owerride keywords to TargetTransformInfo's subclasses.
llvm-svn: 200021
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | 16 | ||||
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp | 32 | ||||
| -rw-r--r-- | llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 38 | ||||
| -rw-r--r-- | llvm/lib/Target/XCore/XCoreTargetTransformInfo.cpp | 10 |
5 files changed, 56 insertions, 50 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp index 5d0b73a191e..75247dfe352 100644 --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -32,7 +32,7 @@ void initializeARMTTIPass(PassRegistry &); namespace { -class ARMTTI : public ImmutablePass, public TargetTransformInfo { +class ARMTTI LLVM_FINAL : public ImmutablePass, public TargetTransformInfo { const ARMBaseTargetMachine *TM; const ARMSubtarget *ST; const ARMTargetLowering *TLI; @@ -52,7 +52,7 @@ public: initializeARMTTIPass(*PassRegistry::getPassRegistry()); } - virtual void initializePass() { + virtual void initializePass() LLVM_OVERRIDE { pushTTIStack(this); } @@ -60,7 +60,7 @@ public: popTTIStack(); } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { + virtual void getAnalysisUsage(AnalysisUsage &AU) const LLVM_OVERRIDE { TargetTransformInfo::getAnalysisUsage(AU); } @@ -68,7 +68,7 @@ public: static char ID; /// Provide necessary pointer adjustments for the two base classes. - virtual void *getAdjustedAnalysisPointer(const void *ID) { + virtual void *getAdjustedAnalysisPointer(const void *ID) LLVM_OVERRIDE { if (ID == &TargetTransformInfo::ID) return (TargetTransformInfo*)this; return this; @@ -77,7 +77,8 @@ public: /// \name Scalar TTI Implementations /// @{ - virtual unsigned getIntImmCost(const APInt &Imm, Type *Ty) const; + virtual unsigned + getIntImmCost(const APInt &Imm, Type *Ty) const LLVM_OVERRIDE; /// @} @@ -180,7 +181,7 @@ unsigned ARMTTI::getIntImmCost(const APInt &Imm, Type *Ty) const { } unsigned ARMTTI::getCastInstrCost(unsigned Opcode, Type *Dst, - Type *Src) const { + Type *Src) const { int ISD = TLI->InstructionOpcodeToISD(Opcode); assert(ISD && "Invalid opcode"); @@ -469,7 +470,8 @@ unsigned ARMTTI::getShuffleCost(ShuffleKind Kind, Type *Tp, int Index, return LT.first * NEONShuffleTbl[Idx].Cost; } -unsigned ARMTTI::getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind Op1Info, +unsigned ARMTTI::getArithmeticInstrCost(unsigned Opcode, Type *Ty, + OperandValueKind Op1Info, OperandValueKind Op2Info) const { int ISDOpcode = TLI->InstructionOpcodeToISD(Opcode); diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp index 6d9c4bb45e3..51b76de07e8 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp @@ -32,7 +32,7 @@ void initializePPCTTIPass(PassRegistry &); namespace { -class PPCTTI : public ImmutablePass, public TargetTransformInfo { +class PPCTTI LLVM_FINAL : public ImmutablePass, public TargetTransformInfo { const PPCTargetMachine *TM; const PPCSubtarget *ST; const PPCTargetLowering *TLI; @@ -52,7 +52,7 @@ public: initializePPCTTIPass(*PassRegistry::getPassRegistry()); } - virtual void initializePass() { + virtual void initializePass() LLVM_OVERRIDE { pushTTIStack(this); } @@ -60,7 +60,7 @@ public: popTTIStack(); } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { + virtual void getAnalysisUsage(AnalysisUsage &AU) const LLVM_OVERRIDE { TargetTransformInfo::getAnalysisUsage(AU); } @@ -68,7 +68,7 @@ public: static char ID; /// Provide necessary pointer adjustments for the two base classes. - virtual void *getAdjustedAnalysisPointer(const void *ID) { + virtual void *getAdjustedAnalysisPointer(const void *ID) LLVM_OVERRIDE { if (ID == &TargetTransformInfo::ID) return (TargetTransformInfo*)this; return this; @@ -76,31 +76,33 @@ public: /// \name Scalar TTI Implementations /// @{ - virtual PopcntSupportKind getPopcntSupport(unsigned TyWidth) const; - virtual void getUnrollingPreferences(Loop *L, UnrollingPreferences &UP) const; + virtual PopcntSupportKind + getPopcntSupport(unsigned TyWidth) const LLVM_OVERRIDE; + virtual void getUnrollingPreferences( + Loop *L, UnrollingPreferences &UP) const LLVM_OVERRIDE; /// @} /// \name Vector TTI Implementations /// @{ - virtual unsigned getNumberOfRegisters(bool Vector) const; - virtual unsigned getRegisterBitWidth(bool Vector) const; - virtual unsigned getMaximumUnrollFactor() const; + virtual unsigned getNumberOfRegisters(bool Vector) const LLVM_OVERRIDE; + virtual unsigned getRegisterBitWidth(bool Vector) const LLVM_OVERRIDE; + virtual unsigned getMaximumUnrollFactor() const LLVM_OVERRIDE; virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind, - OperandValueKind) const; + OperandValueKind) const LLVM_OVERRIDE; virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp, - int Index, Type *SubTp) const; + int Index, Type *SubTp) const LLVM_OVERRIDE; virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst, - Type *Src) const; + Type *Src) const LLVM_OVERRIDE; virtual unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, - Type *CondTy) const; + Type *CondTy) const LLVM_OVERRIDE; virtual unsigned getVectorInstrCost(unsigned Opcode, Type *Val, - unsigned Index) const; + unsigned Index) const LLVM_OVERRIDE; virtual unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, - unsigned AddressSpace) const; + unsigned AddressSpace) const LLVM_OVERRIDE; /// @} }; diff --git a/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp index a4feec71312..7f37658371d 100644 --- a/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp +++ b/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp @@ -35,7 +35,7 @@ void initializeAMDGPUTTIPass(PassRegistry &); namespace { -class AMDGPUTTI : public ImmutablePass, public TargetTransformInfo { +class AMDGPUTTI LLVM_FINAL : public ImmutablePass, public TargetTransformInfo { const AMDGPUTargetMachine *TM; const AMDGPUSubtarget *ST; const AMDGPUTargetLowering *TLI; @@ -55,11 +55,11 @@ public: initializeAMDGPUTTIPass(*PassRegistry::getPassRegistry()); } - virtual void initializePass() { pushTTIStack(this); } + virtual void initializePass() LLVM_OVERRIDE { pushTTIStack(this); } virtual void finalizePass() { popTTIStack(); } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { + virtual void getAnalysisUsage(AnalysisUsage &AU) const LLVM_OVERRIDE { TargetTransformInfo::getAnalysisUsage(AU); } @@ -67,13 +67,13 @@ public: static char ID; /// Provide necessary pointer adjustments for the two base classes. - virtual void *getAdjustedAnalysisPointer(const void *ID) { + virtual void *getAdjustedAnalysisPointer(const void *ID) LLVM_OVERRIDE { if (ID == &TargetTransformInfo::ID) return (TargetTransformInfo *)this; return this; } - virtual bool hasBranchDivergence() const; + virtual bool hasBranchDivergence() const LLVM_OVERRIDE; virtual void getUnrollingPreferences(Loop *L, UnrollingPreferences &UP) const; diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index a1192692909..da2b021da93 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -32,7 +32,7 @@ void initializeX86TTIPass(PassRegistry &); namespace { -class X86TTI : public ImmutablePass, public TargetTransformInfo { +class X86TTI LLVM_FINAL : public ImmutablePass, public TargetTransformInfo { const X86Subtarget *ST; const X86TargetLowering *TLI; @@ -46,12 +46,12 @@ public: } X86TTI(const X86TargetMachine *TM) - : ImmutablePass(ID), ST(TM->getSubtargetImpl()), - TLI(TM->getTargetLowering()) { + : ImmutablePass(ID), ST(TM->getSubtargetImpl()), + TLI(TM->getTargetLowering()) { initializeX86TTIPass(*PassRegistry::getPassRegistry()); } - virtual void initializePass() { + virtual void initializePass() LLVM_OVERRIDE { pushTTIStack(this); } @@ -59,7 +59,7 @@ public: popTTIStack(); } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { + virtual void getAnalysisUsage(AnalysisUsage &AU) const LLVM_OVERRIDE { TargetTransformInfo::getAnalysisUsage(AU); } @@ -67,7 +67,7 @@ public: static char ID; /// Provide necessary pointer adjustments for the two base classes. - virtual void *getAdjustedAnalysisPointer(const void *ID) { + virtual void *getAdjustedAnalysisPointer(const void *ID) LLVM_OVERRIDE { if (ID == &TargetTransformInfo::ID) return (TargetTransformInfo*)this; return this; @@ -75,35 +75,37 @@ public: /// \name Scalar TTI Implementations /// @{ - virtual PopcntSupportKind getPopcntSupport(unsigned TyWidth) const; + virtual PopcntSupportKind + getPopcntSupport(unsigned TyWidth) const LLVM_OVERRIDE; /// @} /// \name Vector TTI Implementations /// @{ - virtual unsigned getNumberOfRegisters(bool Vector) const; - virtual unsigned getRegisterBitWidth(bool Vector) const; - virtual unsigned getMaximumUnrollFactor() const; + virtual unsigned getNumberOfRegisters(bool Vector) const LLVM_OVERRIDE; + virtual unsigned getRegisterBitWidth(bool Vector) const LLVM_OVERRIDE; + virtual unsigned getMaximumUnrollFactor() const LLVM_OVERRIDE; virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind, - OperandValueKind) const; + OperandValueKind) const LLVM_OVERRIDE; virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp, - int Index, Type *SubTp) const; + int Index, Type *SubTp) const LLVM_OVERRIDE; virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst, - Type *Src) const; + Type *Src) const LLVM_OVERRIDE; virtual unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, - Type *CondTy) const; + Type *CondTy) const LLVM_OVERRIDE; virtual unsigned getVectorInstrCost(unsigned Opcode, Type *Val, - unsigned Index) const; + unsigned Index) const LLVM_OVERRIDE; virtual unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, - unsigned AddressSpace) const; + unsigned AddressSpace) const LLVM_OVERRIDE; - virtual unsigned getAddressComputationCost(Type *PtrTy, bool IsComplex) const; + virtual unsigned + getAddressComputationCost(Type *PtrTy, bool IsComplex) const LLVM_OVERRIDE; virtual unsigned getReductionCost(unsigned Opcode, Type *Ty, - bool IsPairwiseForm) const; + bool IsPairwiseForm) const LLVM_OVERRIDE; /// @} }; diff --git a/llvm/lib/Target/XCore/XCoreTargetTransformInfo.cpp b/llvm/lib/Target/XCore/XCoreTargetTransformInfo.cpp index 96b012d109b..5caaf47d5f5 100644 --- a/llvm/lib/Target/XCore/XCoreTargetTransformInfo.cpp +++ b/llvm/lib/Target/XCore/XCoreTargetTransformInfo.cpp @@ -31,7 +31,7 @@ void initializeXCoreTTIPass(PassRegistry &); namespace { -class XCoreTTI : public ImmutablePass, public TargetTransformInfo { +class XCoreTTI LLVM_FINAL : public ImmutablePass, public TargetTransformInfo { public: XCoreTTI() : ImmutablePass(ID) { llvm_unreachable("This pass cannot be directly constructed"); @@ -42,7 +42,7 @@ public: initializeXCoreTTIPass(*PassRegistry::getPassRegistry()); } - virtual void initializePass() { + virtual void initializePass() LLVM_OVERRIDE { pushTTIStack(this); } @@ -50,19 +50,19 @@ public: popTTIStack(); } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { + virtual void getAnalysisUsage(AnalysisUsage &AU) const LLVM_OVERRIDE { TargetTransformInfo::getAnalysisUsage(AU); } static char ID; - virtual void *getAdjustedAnalysisPointer(const void *ID) { + virtual void *getAdjustedAnalysisPointer(const void *ID) LLVM_OVERRIDE { if (ID == &TargetTransformInfo::ID) return (TargetTransformInfo*)this; return this; } - unsigned getNumberOfRegisters(bool Vector) const { + unsigned getNumberOfRegisters(bool Vector) const LLVM_OVERRIDE { if (Vector) { return 0; } |

