Skip to content

Commit 8485777

Browse files
[Target] Add "override" where appropriate (NFC) (llvm#165083)
Note that "override" makes "virtual" redundant. Identified with modernize-use-override.
1 parent 7379100 commit 8485777

32 files changed

+42
-43
lines changed

llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ struct AArch64FunctionInfo final : public yaml::MachineFunctionInfo {
651651
AArch64FunctionInfo(const llvm::AArch64FunctionInfo &MFI);
652652

653653
void mappingImpl(yaml::IO &YamlIO) override;
654-
~AArch64FunctionInfo() = default;
654+
~AArch64FunctionInfo() override = default;
655655
};
656656

657657
template <> struct MappingTraits<AArch64FunctionInfo> {

llvm/lib/Target/AArch64/AArch64RegisterInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class AArch64RegisterInfo final : public AArch64GenRegisterInfo {
154154

155155
bool shouldAnalyzePhysregInMachineLoopInfo(MCRegister R) const override;
156156

157-
virtual bool isIgnoredCVReg(MCRegister LLVMReg) const override;
157+
bool isIgnoredCVReg(MCRegister LLVMReg) const override;
158158
};
159159

160160
} // end namespace llvm

llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class LLVM_EXTERNAL_VISIBILITY MetadataStreamerMsgPackV4
131131

132132
public:
133133
MetadataStreamerMsgPackV4() = default;
134-
~MetadataStreamerMsgPackV4() = default;
134+
~MetadataStreamerMsgPackV4() override = default;
135135

136136
bool emitTo(AMDGPUTargetStreamer &TargetStreamer) override;
137137

@@ -154,7 +154,7 @@ class MetadataStreamerMsgPackV5 : public MetadataStreamerMsgPackV4 {
154154

155155
public:
156156
MetadataStreamerMsgPackV5() = default;
157-
~MetadataStreamerMsgPackV5() = default;
157+
~MetadataStreamerMsgPackV5() override = default;
158158
};
159159

160160
class MetadataStreamerMsgPackV6 final : public MetadataStreamerMsgPackV5 {
@@ -163,7 +163,7 @@ class MetadataStreamerMsgPackV6 final : public MetadataStreamerMsgPackV5 {
163163

164164
public:
165165
MetadataStreamerMsgPackV6() = default;
166-
~MetadataStreamerMsgPackV6() = default;
166+
~MetadataStreamerMsgPackV6() override = default;
167167

168168
void emitKernelAttrs(const AMDGPUTargetMachine &TM, const MachineFunction &MF,
169169
msgpack::MapDocNode Kern) override;

llvm/lib/Target/AMDGPU/AMDGPUMIRFormatter.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,19 @@ struct PerFunctionMIParsingState;
2626
class AMDGPUMIRFormatter final : public MIRFormatter {
2727
public:
2828
AMDGPUMIRFormatter() = default;
29-
virtual ~AMDGPUMIRFormatter() = default;
29+
~AMDGPUMIRFormatter() override = default;
3030

3131
/// Implement target specific printing for machine operand immediate value, so
3232
/// that we can have more meaningful mnemonic than a 64-bit integer. Passing
3333
/// None to OpIdx means the index is unknown.
34-
virtual void printImm(raw_ostream &OS, const MachineInstr &MI,
35-
std::optional<unsigned> OpIdx,
36-
int64_t Imm) const override;
34+
void printImm(raw_ostream &OS, const MachineInstr &MI,
35+
std::optional<unsigned> OpIdx, int64_t Imm) const override;
3736

3837
/// Implement target specific parsing of immediate mnemonics. The mnemonic is
3938
/// a string with a leading dot.
40-
virtual bool parseImmMnemonic(const unsigned OpCode, const unsigned OpIdx,
41-
StringRef Src, int64_t &Imm,
42-
ErrorCallbackType ErrorCallback) const override;
39+
bool parseImmMnemonic(const unsigned OpCode, const unsigned OpIdx,
40+
StringRef Src, int64_t &Imm,
41+
ErrorCallbackType ErrorCallback) const override;
4342

4443
/// Implement target specific parsing of target custom pseudo source value.
4544
bool

llvm/lib/Target/AMDGPU/MCA/AMDGPUCustomBehaviour.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AMDGPUInstrPostProcess : public InstrPostProcess {
3232
AMDGPUInstrPostProcess(const MCSubtargetInfo &STI, const MCInstrInfo &MCII)
3333
: InstrPostProcess(STI, MCII) {}
3434

35-
~AMDGPUInstrPostProcess() = default;
35+
~AMDGPUInstrPostProcess() override = default;
3636

3737
void postProcessInstruction(Instruction &Inst, const MCInst &MCI) override;
3838
};
@@ -88,7 +88,7 @@ class AMDGPUCustomBehaviour : public CustomBehaviour {
8888
AMDGPUCustomBehaviour(const MCSubtargetInfo &STI,
8989
const mca::SourceMgr &SrcMgr, const MCInstrInfo &MCII);
9090

91-
~AMDGPUCustomBehaviour() = default;
91+
~AMDGPUCustomBehaviour() override = default;
9292
/// This method is used to determine if an instruction
9393
/// should be allowed to be dispatched. The return value is
9494
/// how many cycles until the instruction can be dispatched.

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCExpr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class AMDGPUMCExpr : public MCTargetExpr {
6464
ArrayRef<const MCExpr *> Args;
6565

6666
AMDGPUMCExpr(VariantKind Kind, ArrayRef<const MCExpr *> Args, MCContext &Ctx);
67-
~AMDGPUMCExpr();
67+
~AMDGPUMCExpr() override;
6868

6969
bool evaluateExtraSGPRs(MCValue &Res, const MCAssembler *Asm) const;
7070
bool evaluateTotalNumVGPR(MCValue &Res, const MCAssembler *Asm) const;

llvm/lib/Target/AMDGPU/SIInstrInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ class SIInstrInfo final : public AMDGPUGenInstrInfo {
16401640
unsigned *PredCost = nullptr) const override;
16411641

16421642
InstructionUniformity
1643-
getInstructionUniformity(const MachineInstr &MI) const override final;
1643+
getInstructionUniformity(const MachineInstr &MI) const final;
16441644

16451645
InstructionUniformity
16461646
getGenericInstructionUniformity(const MachineInstr &MI) const;

llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ struct SIMachineFunctionInfo final : public yaml::MachineFunctionInfo {
311311
const llvm::MachineFunction &MF);
312312

313313
void mappingImpl(yaml::IO &YamlIO) override;
314-
~SIMachineFunctionInfo() = default;
314+
~SIMachineFunctionInfo() override = default;
315315
};
316316

317317
template <> struct MappingTraits<SIMachineFunctionInfo> {

llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ class SIGfx12CacheControl : public SIGfx11CacheControl {
640640

641641
bool finalizeStore(MachineInstr &MI, bool Atomic) const override;
642642

643-
virtual bool handleCooperativeAtomic(MachineInstr &MI) const override;
643+
bool handleCooperativeAtomic(MachineInstr &MI) const override;
644644

645645
bool insertRelease(MachineBasicBlock::iterator &MI, SIAtomicScope Scope,
646646
SIAtomicAddrSpace AddrSpace, bool IsCrossAddrSpaceOrdering,

llvm/lib/Target/ARM/ARMMachineFunctionInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ struct ARMFunctionInfo final : public yaml::MachineFunctionInfo {
312312
ARMFunctionInfo(const llvm::ARMFunctionInfo &MFI);
313313

314314
void mappingImpl(yaml::IO &YamlIO) override;
315-
~ARMFunctionInfo() = default;
315+
~ARMFunctionInfo() override = default;
316316
};
317317

318318
template <> struct MappingTraits<ARMFunctionInfo> {

0 commit comments

Comments
 (0)