Skip to content

Commit 042ac91

Browse files
[llvm] Add "override" where appropriate (NFC) (#165168)
Note that "override" makes "virtual" redundant. Identified with modernize-use-override.
1 parent fb27f4f commit 042ac91

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+85
-85
lines changed

llvm/include/llvm/Analysis/DDG.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class RootDDGNode : public DDGNode {
9696
RootDDGNode() : DDGNode(NodeKind::Root) {}
9797
RootDDGNode(const RootDDGNode &N) = delete;
9898
RootDDGNode(RootDDGNode &&N) : DDGNode(std::move(N)) {}
99-
~RootDDGNode() = default;
99+
~RootDDGNode() override = default;
100100

101101
/// Define classof to be able to use isa<>, cast<>, dyn_cast<>, etc.
102102
static bool classof(const DDGNode *N) {
@@ -114,7 +114,7 @@ class LLVM_ABI SimpleDDGNode : public DDGNode {
114114
SimpleDDGNode(Instruction &I);
115115
SimpleDDGNode(const SimpleDDGNode &N);
116116
SimpleDDGNode(SimpleDDGNode &&N);
117-
~SimpleDDGNode();
117+
~SimpleDDGNode() override;
118118

119119
SimpleDDGNode &operator=(const SimpleDDGNode &N) = default;
120120

@@ -176,7 +176,7 @@ class LLVM_ABI PiBlockDDGNode : public DDGNode {
176176
PiBlockDDGNode(const PiNodeList &List);
177177
PiBlockDDGNode(const PiBlockDDGNode &N);
178178
PiBlockDDGNode(PiBlockDDGNode &&N);
179-
~PiBlockDDGNode();
179+
~PiBlockDDGNode() override;
180180

181181
PiBlockDDGNode &operator=(const PiBlockDDGNode &N) = default;
182182

@@ -318,7 +318,7 @@ class LLVM_ABI DataDependenceGraph : public DDGBase, public DDGInfo {
318318
: DDGBase(std::move(G)), DDGInfo(std::move(G)) {}
319319
DataDependenceGraph(Function &F, DependenceInfo &DI);
320320
DataDependenceGraph(Loop &L, LoopInfo &LI, DependenceInfo &DI);
321-
~DataDependenceGraph();
321+
~DataDependenceGraph() override;
322322

323323
/// If node \p N belongs to a pi-block return a pointer to the pi-block,
324324
/// otherwise return null.

llvm/include/llvm/Analysis/InteractiveModelRunner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class LLVM_ABI InteractiveModelRunner : public MLModelRunner {
5151
Log->flush();
5252
}
5353

54-
virtual ~InteractiveModelRunner();
54+
~InteractiveModelRunner() override;
5555

5656
private:
5757
void *evaluateUntyped() override;

llvm/include/llvm/Analysis/MLInlineAdvisor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MLInlineAdvisor : public InlineAdvisor {
3333
GetModelRunner,
3434
std::function<bool(CallBase &)> GetDefaultAdvice);
3535

36-
virtual ~MLInlineAdvisor() = default;
36+
~MLInlineAdvisor() override = default;
3737

3838
void onPassEntry(LazyCallGraph::SCC *SCC) override;
3939
void onPassExit(LazyCallGraph::SCC *SCC) override;
@@ -105,7 +105,7 @@ class MLInlineAdvice : public InlineAdvice {
105105
public:
106106
MLInlineAdvice(MLInlineAdvisor *Advisor, CallBase &CB,
107107
OptimizationRemarkEmitter &ORE, bool Recommendation);
108-
virtual ~MLInlineAdvice() = default;
108+
~MLInlineAdvice() override = default;
109109

110110
void recordInliningImpl() override;
111111
void recordInliningWithCalleeDeletedImpl() override;

llvm/include/llvm/Analysis/ReleaseModeModelRunner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class ReleaseModeModelRunner final : public MLModelRunner {
106106
assert(ResultIndex >= 0 && "Cannot find DecisionName in inlining model");
107107
}
108108

109-
virtual ~ReleaseModeModelRunner() = default;
109+
~ReleaseModeModelRunner() override = default;
110110

111111
static bool classof(const MLModelRunner *R) {
112112
return R->getKind() == MLModelRunner::Kind::Release;

llvm/include/llvm/Analysis/StackSafetyAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class StackSafetyGlobalInfoWrapperPass : public ModulePass {
156156
static char ID;
157157

158158
StackSafetyGlobalInfoWrapperPass();
159-
~StackSafetyGlobalInfoWrapperPass();
159+
~StackSafetyGlobalInfoWrapperPass() override;
160160

161161
const StackSafetyGlobalInfo &getResult() const { return SSGI; }
162162

llvm/include/llvm/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class LLVM_ABI CFIFunctionFrameAnalyzer : public CFIFunctionFrameReceiver {
3232
public:
3333
CFIFunctionFrameAnalyzer(MCContext &Context, const MCInstrInfo &MCII)
3434
: CFIFunctionFrameReceiver(Context), MCII(MCII) {}
35-
~CFIFunctionFrameAnalyzer();
35+
~CFIFunctionFrameAnalyzer() override;
3636

3737
void startFunctionFrame(bool IsEH,
3838
ArrayRef<MCCFIInstruction> Prologue) override;

llvm/include/llvm/DWARFLinker/Classic/DWARFStreamer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class LLVM_ABI DwarfStreamer : public DwarfEmitter {
4848
raw_pwrite_stream &OutFile,
4949
DWARFLinkerBase::MessageHandlerTy Warning)
5050
: OutFile(OutFile), OutFileType(OutFileType), WarningHandler(Warning) {}
51-
virtual ~DwarfStreamer() = default;
51+
~DwarfStreamer() override = default;
5252

5353
static Expected<std::unique_ptr<DwarfStreamer>> createStreamer(
5454
const Triple &TheTriple, DWARFLinkerBase::OutputFileType FileType,

llvm/include/llvm/DWARFLinker/Parallel/DWARFLinker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ using SectionHandlerTy =
120120

121121
class DWARFLinker : public DWARFLinkerBase {
122122
public:
123-
virtual ~DWARFLinker() = default;
123+
~DWARFLinker() override = default;
124124

125125
/// Creates dwarf linker instance.
126126
LLVM_ABI static std::unique_ptr<DWARFLinker>

llvm/include/llvm/Debuginfod/BuildIDFetcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DebuginfodFetcher : public object::BuildIDFetcher {
2424
public:
2525
DebuginfodFetcher(std::vector<std::string> DebugFileDirectories)
2626
: BuildIDFetcher(std::move(DebugFileDirectories)) {}
27-
virtual ~DebuginfodFetcher() = default;
27+
~DebuginfodFetcher() override = default;
2828

2929
/// Fetches the given Build ID using debuginfod and returns a local path to
3030
/// the resulting file.

llvm/include/llvm/IR/DroppedVariableStatsIR.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ class LLVM_ABI DroppedVariableStatsIR : public DroppedVariableStats {
7171
StringRef PassLevel);
7272

7373
/// Override base class method to run on an llvm::Function specifically.
74-
virtual void
75-
visitEveryInstruction(unsigned &DroppedCount,
76-
DenseMap<VarID, DILocation *> &InlinedAtsMap,
77-
VarID Var) override;
74+
void visitEveryInstruction(unsigned &DroppedCount,
75+
DenseMap<VarID, DILocation *> &InlinedAtsMap,
76+
VarID Var) override;
7877

7978
/// Override base class method to run on #dbg_values specifically.
80-
virtual void visitEveryDebugRecord(
79+
void visitEveryDebugRecord(
8180
DenseSet<VarID> &VarIDSet,
8281
DenseMap<StringRef, DenseMap<VarID, DILocation *>> &InlinedAtsMap,
8382
StringRef FuncName, bool Before) override;

0 commit comments

Comments
 (0)