Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3f3930a

Browse files
committedJul 26, 2022
Remove redundaunt virtual specifiers (NFC)
Identified with tidy-modernize-use-override.
1 parent ae002f8 commit 3f3930a

File tree

27 files changed

+74
-84
lines changed

27 files changed

+74
-84
lines changed
 

‎clang-tools-extra/clang-tidy/bugprone/SharedPtrArrayMismatchCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SharedPtrArrayMismatchCheck : public SmartPtrArrayMismatchCheck {
2828
SharedPtrArrayMismatchCheck(StringRef Name, ClangTidyContext *Context);
2929

3030
protected:
31-
virtual SmartPtrClassMatcher getSmartPointerClassMatcher() const override;
31+
SmartPtrClassMatcher getSmartPointerClassMatcher() const override;
3232
};
3333

3434
} // namespace bugprone

‎clang-tools-extra/clangd/AST.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ std::string printType(const QualType QT, const DeclContext &CurContext,
368368
public:
369369
PrintCB(const DeclContext *CurContext) : CurContext(CurContext) {}
370370
virtual ~PrintCB() {}
371-
virtual bool isScopeVisible(const DeclContext *DC) const override {
371+
bool isScopeVisible(const DeclContext *DC) const override {
372372
return DC->Encloses(CurContext);
373373
}
374374

‎clang-tools-extra/clangd/support/ThreadsafeFS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class VolatileFileSystem : public llvm::vfs::ProxyFileSystem {
5353
assert(this->Wrapped);
5454
}
5555

56-
virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
56+
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
5757
getBuffer(const llvm::Twine &Name, int64_t FileSize,
5858
bool RequiresNullTerminator, bool /*IsVolatile*/) override {
5959
return Wrapped->getBuffer(Name, FileSize, RequiresNullTerminator,

‎clang/lib/Basic/Targets/X86.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public TargetInfo {
229229
bool validateInputSize(const llvm::StringMap<bool> &FeatureMap,
230230
StringRef Constraint, unsigned Size) const override;
231231

232-
virtual bool
232+
bool
233233
checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const override {
234234
return true;
235235
};
236236

237-
virtual bool
237+
bool
238238
checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const override {
239239
return true;
240240
};

‎clang/lib/CodeGen/CGOpenMPRuntimeGPU.h

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,16 @@ class CGOpenMPRuntimeGPU : public CGOpenMPRuntime {
186186

187187
/// Emit call to void __kmpc_push_proc_bind(ident_t *loc, kmp_int32
188188
/// global_tid, int proc_bind) to generate code for 'proc_bind' clause.
189-
virtual void emitProcBindClause(CodeGenFunction &CGF,
190-
llvm::omp::ProcBindKind ProcBind,
191-
SourceLocation Loc) override;
189+
void emitProcBindClause(CodeGenFunction &CGF,
190+
llvm::omp::ProcBindKind ProcBind,
191+
SourceLocation Loc) override;
192192

193193
/// Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32
194194
/// global_tid, kmp_int32 num_threads) to generate code for 'num_threads'
195195
/// clause.
196196
/// \param NumThreads An integer value of threads.
197-
virtual void emitNumThreadsClause(CodeGenFunction &CGF,
198-
llvm::Value *NumThreads,
199-
SourceLocation Loc) override;
197+
void emitNumThreadsClause(CodeGenFunction &CGF, llvm::Value *NumThreads,
198+
SourceLocation Loc) override;
200199

201200
/// This function ought to emit, in the general case, a call to
202201
// the openmp runtime kmpc_push_num_teams. In NVPTX backend it is not needed
@@ -300,12 +299,12 @@ class CGOpenMPRuntimeGPU : public CGOpenMPRuntime {
300299
/// SimpleReduction Emit reduction operation only. Used for omp simd
301300
/// directive on the host.
302301
/// ReductionKind The kind of reduction to perform.
303-
virtual void emitReduction(CodeGenFunction &CGF, SourceLocation Loc,
304-
ArrayRef<const Expr *> Privates,
305-
ArrayRef<const Expr *> LHSExprs,
306-
ArrayRef<const Expr *> RHSExprs,
307-
ArrayRef<const Expr *> ReductionOps,
308-
ReductionOptionsTy Options) override;
302+
void emitReduction(CodeGenFunction &CGF, SourceLocation Loc,
303+
ArrayRef<const Expr *> Privates,
304+
ArrayRef<const Expr *> LHSExprs,
305+
ArrayRef<const Expr *> RHSExprs,
306+
ArrayRef<const Expr *> ReductionOps,
307+
ReductionOptionsTy Options) override;
309308

310309
/// Returns specified OpenMP runtime function for the current OpenMP
311310
/// implementation. Specialized for the NVPTX device.

‎clang/lib/CodeGen/MicrosoftCXXABI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ class MicrosoftCXXABI : public CGCXXABI {
782782
LoadVTablePtr(CodeGenFunction &CGF, Address This,
783783
const CXXRecordDecl *RD) override;
784784

785-
virtual bool
785+
bool
786786
isPermittedToBeHomogeneousAggregate(const CXXRecordDecl *RD) const override;
787787

788788
private:

‎clang/lib/Sema/Sema.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ class SemaPPCallbacks : public PPCallbacks {
137137

138138
void reset() { S = nullptr; }
139139

140-
virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason,
141-
SrcMgr::CharacteristicKind FileType,
142-
FileID PrevFID) override {
140+
void FileChanged(SourceLocation Loc, FileChangeReason Reason,
141+
SrcMgr::CharacteristicKind FileType,
142+
FileID PrevFID) override {
143143
if (!S)
144144
return;
145145
switch (Reason) {

‎clang/lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ class InnerPointerChecker
5555
ID.AddPointer(getTag());
5656
}
5757

58-
virtual PathDiagnosticPieceRef
59-
VisitNode(const ExplodedNode *N, BugReporterContext &BRC,
60-
PathSensitiveBugReport &BR) override;
58+
PathDiagnosticPieceRef VisitNode(const ExplodedNode *N,
59+
BugReporterContext &BRC,
60+
PathSensitiveBugReport &BR) override;
6161

6262
// FIXME: Scan the map once in the visitor's constructor and do a direct
6363
// lookup by region.

‎clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -852,9 +852,8 @@ class NoOwnershipChangeVisitor final : public NoStateChangeFuncVisitor {
852852
return false;
853853
}
854854

855-
virtual bool
856-
wasModifiedInFunction(const ExplodedNode *CallEnterN,
857-
const ExplodedNode *CallExitEndN) override {
855+
bool wasModifiedInFunction(const ExplodedNode *CallEnterN,
856+
const ExplodedNode *CallExitEndN) override {
858857
if (!doesFnIntendToHandleOwnership(
859858
CallExitEndN->getFirstPred()->getLocationContext()->getDecl(),
860859
CallExitEndN->getState()->getAnalysisManager().getASTContext()))
@@ -885,23 +884,23 @@ class NoOwnershipChangeVisitor final : public NoStateChangeFuncVisitor {
885884
"later deallocation");
886885
}
887886

888-
virtual PathDiagnosticPieceRef
887+
PathDiagnosticPieceRef
889888
maybeEmitNoteForObjCSelf(PathSensitiveBugReport &R,
890889
const ObjCMethodCall &Call,
891890
const ExplodedNode *N) override {
892891
// TODO: Implement.
893892
return nullptr;
894893
}
895894

896-
virtual PathDiagnosticPieceRef
895+
PathDiagnosticPieceRef
897896
maybeEmitNoteForCXXThis(PathSensitiveBugReport &R,
898897
const CXXConstructorCall &Call,
899898
const ExplodedNode *N) override {
900899
// TODO: Implement.
901900
return nullptr;
902901
}
903902

904-
virtual PathDiagnosticPieceRef
903+
PathDiagnosticPieceRef
905904
maybeEmitNoteForParameters(PathSensitiveBugReport &R, const CallEvent &Call,
906905
const ExplodedNode *N) override {
907906
// TODO: Factor the logic of "what constitutes as an entity being passed

‎clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,8 @@ class NoStoreFuncVisitor final : public NoStateChangeFuncVisitor {
530530
private:
531531
/// \return Whether \c RegionOfInterest was modified at \p CurrN compared to
532532
/// the value it holds in \p CallExitBeginN.
533-
virtual bool
534-
wasModifiedBeforeCallExit(const ExplodedNode *CurrN,
535-
const ExplodedNode *CallExitBeginN) override;
533+
bool wasModifiedBeforeCallExit(const ExplodedNode *CurrN,
534+
const ExplodedNode *CallExitBeginN) override;
536535

537536
/// Attempts to find the region of interest in a given record decl,
538537
/// by either following the base classes or fields.

‎llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class SelectionDAGBuilder {
198198
SDAGSwitchLowering(SelectionDAGBuilder *sdb, FunctionLoweringInfo &funcinfo)
199199
: SwitchCG::SwitchLowering(funcinfo), SDB(sdb) {}
200200

201-
virtual void addSuccessorWithProb(
201+
void addSuccessorWithProb(
202202
MachineBasicBlock *Src, MachineBasicBlock *Dst,
203203
BranchProbability Prob = BranchProbability::getUnknown()) override {
204204
SDB->addSuccessorWithProb(Src, Dst, Prob);

‎llvm/lib/MC/ELFObjectWriter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,8 @@ class ELFDwoObjectWriter : public ELFObjectWriter {
293293
: ELFObjectWriter(std::move(MOTW)), OS(OS), DwoOS(DwoOS),
294294
IsLittleEndian(IsLittleEndian) {}
295295

296-
virtual bool checkRelocation(MCContext &Ctx, SMLoc Loc,
297-
const MCSectionELF *From,
298-
const MCSectionELF *To) override {
296+
bool checkRelocation(MCContext &Ctx, SMLoc Loc, const MCSectionELF *From,
297+
const MCSectionELF *To) override {
299298
if (isDwoSection(*From)) {
300299
Ctx.reportError(Loc, "A dwo section may not contain relocations");
301300
return false;

‎llvm/lib/Target/Mips/MipsPreLegalizerCombiner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class MipsPreLegalizerCombinerInfo : public CombinerInfo {
3131
: CombinerInfo(/*AllowIllegalOps*/ true, /*ShouldLegalizeIllegal*/ false,
3232
/*LegalizerInfo*/ nullptr, /*EnableOpt*/ false,
3333
/*EnableOptSize*/ false, /*EnableMinSize*/ false) {}
34-
virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
35-
MachineIRBuilder &B) const override;
34+
bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
35+
MachineIRBuilder &B) const override;
3636
};
3737

3838
bool MipsPreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,

‎llvm/lib/Target/RISCV/RISCVInstrInfo.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,15 @@ class RISCVInstrInfo : public RISCVGenInstrInfo {
149149
std::vector<outliner::Candidate> &RepeatedSequenceLocs) const override;
150150

151151
// Return if/how a given MachineInstr should be outlined.
152-
virtual outliner::InstrType
153-
getOutliningType(MachineBasicBlock::iterator &MBBI,
154-
unsigned Flags) const override;
152+
outliner::InstrType getOutliningType(MachineBasicBlock::iterator &MBBI,
153+
unsigned Flags) const override;
155154

156155
// Insert a custom frame for outlined functions.
157-
virtual void
158-
buildOutlinedFrame(MachineBasicBlock &MBB, MachineFunction &MF,
159-
const outliner::OutlinedFunction &OF) const override;
156+
void buildOutlinedFrame(MachineBasicBlock &MBB, MachineFunction &MF,
157+
const outliner::OutlinedFunction &OF) const override;
160158

161159
// Insert a call to an outlined function into a given basic block.
162-
virtual MachineBasicBlock::iterator
160+
MachineBasicBlock::iterator
163161
insertOutlinedCall(Module &M, MachineBasicBlock &MBB,
164162
MachineBasicBlock::iterator &It, MachineFunction &MF,
165163
outliner::Candidate &C) const override;

‎llvm/lib/Target/X86/X86InstrInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ class X86InstrInfo final : public X86GenInstrInfo {
544544
ArrayRef<std::pair<unsigned, const char *>>
545545
getSerializableDirectMachineOperandTargetFlags() const override;
546546

547-
virtual outliner::OutlinedFunction getOutliningCandidateInfo(
547+
outliner::OutlinedFunction getOutliningCandidateInfo(
548548
std::vector<outliner::Candidate> &RepeatedSequenceLocs) const override;
549549

550550
bool isFunctionSafeToOutlineFrom(MachineFunction &MF,

‎llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4500,9 +4500,8 @@ struct AAAlignImpl : AAAlign {
45004500
// to avoid making the alignment explicit if it did not improve.
45014501

45024502
/// See AbstractAttribute::getDeducedAttributes
4503-
virtual void
4504-
getDeducedAttributes(LLVMContext &Ctx,
4505-
SmallVectorImpl<Attribute> &Attrs) const override {
4503+
void getDeducedAttributes(LLVMContext &Ctx,
4504+
SmallVectorImpl<Attribute> &Attrs) const override {
45064505
if (getAssumedAlign() > 1)
45074506
Attrs.emplace_back(
45084507
Attribute::getWithAlignment(Ctx, Align(getAssumedAlign())));
@@ -4972,9 +4971,8 @@ struct AANoCaptureImpl : public AANoCapture {
49724971
ChangeStatus updateImpl(Attributor &A) override;
49734972

49744973
/// see AbstractAttribute::isAssumedNoCaptureMaybeReturned(...).
4975-
virtual void
4976-
getDeducedAttributes(LLVMContext &Ctx,
4977-
SmallVectorImpl<Attribute> &Attrs) const override {
4974+
void getDeducedAttributes(LLVMContext &Ctx,
4975+
SmallVectorImpl<Attribute> &Attrs) const override {
49784976
if (!isAssumedNoCaptureMaybeReturned())
49794977
return;
49804978

‎llvm/lib/Transforms/InstCombine/InstCombineInternal.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,9 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final
597597
/// demanded bits.
598598
bool SimplifyDemandedInstructionBits(Instruction &Inst);
599599

600-
virtual Value *
601-
SimplifyDemandedVectorElts(Value *V, APInt DemandedElts, APInt &UndefElts,
602-
unsigned Depth = 0,
603-
bool AllowMultipleUsers = false) override;
600+
Value *SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
601+
APInt &UndefElts, unsigned Depth = 0,
602+
bool AllowMultipleUsers = false) override;
604603

605604
/// Canonicalize the position of binops relative to shufflevector.
606605
Instruction *foldVectorBinop(BinaryOperator &Inst);

‎polly/include/polly/CodeGen/BlockGenerators.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ class RegionGenerator final : BlockGenerator {
974974
/// @param BBMap A mapping from old values to their new values in this block.
975975
/// @param LTS A mapping from loops virtual canonical induction variable to
976976
/// their new values.
977-
virtual void
977+
void
978978
generateScalarStores(ScopStmt &Stmt, LoopToScevMapT &LTS, ValueMapT &BBMAp,
979979
__isl_keep isl_id_to_ast_expr *NewAccesses) override;
980980

@@ -988,9 +988,8 @@ class RegionGenerator final : BlockGenerator {
988988
/// @param BBMap A mapping from old values to their new values
989989
/// (for values recalculated within this basic block).
990990
/// @param LTS A map from old loops to new induction variables as SCEVs.
991-
virtual void copyPHIInstruction(ScopStmt &Stmt, PHINode *Inst,
992-
ValueMapT &BBMap,
993-
LoopToScevMapT &LTS) override;
991+
void copyPHIInstruction(ScopStmt &Stmt, PHINode *Inst, ValueMapT &BBMap,
992+
LoopToScevMapT &LTS) override;
994993
};
995994
} // namespace polly
996995
#endif

‎polly/include/polly/CodeGen/LoopGeneratorsGOMP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ParallelLoopGeneratorGOMP final : public ParallelLoopGenerator {
4747
void deployParallelExecution(Function *SubFn, Value *SubFnParam, Value *LB,
4848
Value *UB, Value *Stride) override;
4949

50-
virtual Function *prepareSubFnDefinition(Function *F) const override;
50+
Function *prepareSubFnDefinition(Function *F) const override;
5151

5252
std::tuple<Value *, Function *> createSubFn(Value *Stride, AllocaInst *Struct,
5353
SetVector<Value *> UsedValues,

‎polly/include/polly/CodeGen/LoopGeneratorsKMP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ParallelLoopGeneratorKMP final : public ParallelLoopGenerator {
7373
void deployParallelExecution(Function *SubFn, Value *SubFnParam, Value *LB,
7474
Value *UB, Value *Stride) override;
7575

76-
virtual Function *prepareSubFnDefinition(Function *F) const override;
76+
Function *prepareSubFnDefinition(Function *F) const override;
7777

7878
std::tuple<Value *, Function *> createSubFn(Value *Stride, AllocaInst *Struct,
7979
SetVector<Value *> UsedValues,

‎polly/include/polly/ScopPass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class ScopPass : public RegionPass {
175175
/// getAnalysisUsage - Subclasses that override getAnalysisUsage
176176
/// must call this.
177177
///
178-
virtual void getAnalysisUsage(AnalysisUsage &AU) const override;
178+
void getAnalysisUsage(AnalysisUsage &AU) const override;
179179

180180
private:
181181
bool runOnRegion(Region *R, RGPassManager &RGM) override;

‎polly/lib/CodeGen/CodegenCleanup.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ class CodegenCleanup final : public FunctionPass {
4040

4141
/// @name FunctionPass interface
4242
//@{
43-
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {}
43+
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {}
4444

45-
virtual bool doInitialization(Module &M) override {
45+
bool doInitialization(Module &M) override {
4646
assert(!FPM);
4747

4848
FPM = new llvm::legacy::FunctionPassManager(&M);
@@ -106,7 +106,7 @@ class CodegenCleanup final : public FunctionPass {
106106
return FPM->doInitialization();
107107
}
108108

109-
virtual bool doFinalization(Module &M) override {
109+
bool doFinalization(Module &M) override {
110110
bool Result = FPM->doFinalization();
111111

112112
delete FPM;
@@ -115,7 +115,7 @@ class CodegenCleanup final : public FunctionPass {
115115
return Result;
116116
}
117117

118-
virtual bool runOnFunction(llvm::Function &F) override {
118+
bool runOnFunction(llvm::Function &F) override {
119119
if (!F.hasFnAttribute("polly-optimized")) {
120120
LLVM_DEBUG(
121121
dbgs() << F.getName()

‎polly/lib/Support/DumpFunctionPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ class DumpFunctionWrapperPass final : public FunctionPass {
100100

101101
/// @name FunctionPass interface
102102
//@{
103-
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
103+
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
104104
AU.setPreservesAll();
105105
}
106106

107-
virtual bool runOnFunction(llvm::Function &F) override {
107+
bool runOnFunction(llvm::Function &F) override {
108108
runDumpFunction(F, Suffix);
109109
return false;
110110
}

‎polly/lib/Support/DumpModulePass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ class DumpModuleWrapperPass final : public ModulePass {
7171

7272
/// @name ModulePass interface
7373
//@{
74-
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
74+
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
7575
AU.setPreservesAll();
7676
}
7777

78-
virtual bool runOnModule(llvm::Module &M) override {
78+
bool runOnModule(llvm::Module &M) override {
7979
runDumpModule(M, Filename, IsSuffix);
8080
return false;
8181
}

0 commit comments

Comments
 (0)
Please sign in to comment.