Skip to content

Commit c2fc210

Browse files
authored
Merge pull request swiftlang#33448 from davezarzycki/pr33448
[NFC] Fix -Wsuggest-override warnings
2 parents f4082b9 + 1e940c2 commit c2fc210

36 files changed

+167
-169
lines changed

include/swift/AST/ASTPrinter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ class ExtraIndentStreamPrinter : public StreamPrinter {
325325
ExtraIndentStreamPrinter(raw_ostream &out, StringRef extraIndent)
326326
: StreamPrinter(out), ExtraIndent(extraIndent) { }
327327

328-
virtual void printIndent() {
328+
virtual void printIndent() override {
329329
printText(ExtraIndent);
330330
StreamPrinter::printIndent();
331331
}

include/swift/AST/ClangModuleLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class StableSerializationPath {
109109

110110
class ClangModuleLoader : public ModuleLoader {
111111
private:
112-
virtual void anchor();
112+
virtual void anchor() override;
113113

114114
protected:
115115
using ModuleLoader::ModuleLoader;

include/swift/AST/Evaluator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class PrettyStackTraceRequest : public llvm::PrettyStackTraceEntry {
6565
public:
6666
PrettyStackTraceRequest(const Request &request) : request(request) { }
6767

68-
void print(llvm::raw_ostream &out) const {
68+
void print(llvm::raw_ostream &out) const override {
6969
out << "While evaluating request ";
7070
simple_display(out, request);
7171
out << "\n";
@@ -85,9 +85,9 @@ struct CyclicalRequestError :
8585
CyclicalRequestError(const Request &request, const Evaluator &evaluator)
8686
: request(request), evaluator(evaluator) {}
8787

88-
virtual void log(llvm::raw_ostream &out) const;
88+
virtual void log(llvm::raw_ostream &out) const override;
8989

90-
virtual std::error_code convertToErrorCode() const {
90+
virtual std::error_code convertToErrorCode() const override {
9191
// This is essentially unused, but is a temporary requirement for
9292
// llvm::ErrorInfo subclasses.
9393
llvm_unreachable("shouldn't get std::error_code from CyclicalRequestError");

include/swift/AST/NameLookup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class LambdaDeclConsumer : public VisibleDeclConsumer {
375375
public:
376376
LambdaDeclConsumer(Fn &&callback) : Callback(std::move(callback)) {}
377377

378-
void foundDecl(ValueDecl *VD, DeclVisibilityKind reason, DynamicLookupInfo) {
378+
void foundDecl(ValueDecl *VD, DeclVisibilityKind reason, DynamicLookupInfo) override {
379379
Callback(VD, reason);
380380
}
381381
};

include/swift/AST/PrettyStackTrace.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class PrettyStackTraceLocation : public llvm::PrettyStackTraceEntry {
5151
PrettyStackTraceLocation(const ASTContext &C, const char *action,
5252
SourceLoc loc)
5353
: Context(C), Loc(loc), Action(action) {}
54-
virtual void print(llvm::raw_ostream &OS) const;
54+
virtual void print(llvm::raw_ostream &OS) const override;
5555
};
5656

5757
void printDeclDescription(llvm::raw_ostream &out, const Decl *D,
@@ -65,7 +65,7 @@ class PrettyStackTraceDecl : public llvm::PrettyStackTraceEntry {
6565
public:
6666
PrettyStackTraceDecl(const char *action, const Decl *D)
6767
: TheDecl(D), Action(action) {}
68-
virtual void print(llvm::raw_ostream &OS) const;
68+
virtual void print(llvm::raw_ostream &OS) const override;
6969
};
7070

7171
/// PrettyStackTraceAnyFunctionRef - Observe that we are processing a specific
@@ -76,7 +76,7 @@ class PrettyStackTraceAnyFunctionRef : public llvm::PrettyStackTraceEntry {
7676
public:
7777
PrettyStackTraceAnyFunctionRef(const char *action, AnyFunctionRef ref)
7878
: TheRef(ref), Action(action) {}
79-
virtual void print(llvm::raw_ostream &OS) const;
79+
virtual void print(llvm::raw_ostream &OS) const override;
8080
};
8181

8282
void printExprDescription(llvm::raw_ostream &out, Expr *E,
@@ -91,7 +91,7 @@ class PrettyStackTraceExpr : public llvm::PrettyStackTraceEntry {
9191
public:
9292
PrettyStackTraceExpr(const ASTContext &C, const char *action, Expr *E)
9393
: Context(C), TheExpr(E), Action(action) {}
94-
virtual void print(llvm::raw_ostream &OS) const;
94+
virtual void print(llvm::raw_ostream &OS) const override;
9595
};
9696

9797
void printStmtDescription(llvm::raw_ostream &out, Stmt *S,
@@ -106,7 +106,7 @@ class PrettyStackTraceStmt : public llvm::PrettyStackTraceEntry {
106106
public:
107107
PrettyStackTraceStmt(const ASTContext &C, const char *action, Stmt *S)
108108
: Context(C), TheStmt(S), Action(action) {}
109-
virtual void print(llvm::raw_ostream &OS) const;
109+
virtual void print(llvm::raw_ostream &OS) const override;
110110
};
111111

112112
void printPatternDescription(llvm::raw_ostream &out, Pattern *P,
@@ -121,7 +121,7 @@ class PrettyStackTracePattern : public llvm::PrettyStackTraceEntry {
121121
public:
122122
PrettyStackTracePattern(const ASTContext &C, const char *action, Pattern *P)
123123
: Context(C), ThePattern(P), Action(action) {}
124-
virtual void print(llvm::raw_ostream &OS) const;
124+
virtual void print(llvm::raw_ostream &OS) const override;
125125
};
126126

127127
void printTypeDescription(llvm::raw_ostream &out, Type T,
@@ -135,7 +135,7 @@ class PrettyStackTraceType : public llvm::PrettyStackTraceEntry {
135135
public:
136136
PrettyStackTraceType(const ASTContext &C, const char *action, Type type)
137137
: Context(C), TheType(type), Action(action) {}
138-
virtual void print(llvm::raw_ostream &OS) const;
138+
virtual void print(llvm::raw_ostream &OS) const override;
139139
};
140140

141141
/// PrettyStackTraceClangType - Observe that we are processing a
@@ -146,7 +146,7 @@ class PrettyStackTraceClangType : public llvm::PrettyStackTraceEntry {
146146
public:
147147
PrettyStackTraceClangType(const char *action, const clang::Type *type)
148148
: TheType(type), Action(action) {}
149-
virtual void print(llvm::raw_ostream &OS) const;
149+
virtual void print(llvm::raw_ostream &OS) const override;
150150
};
151151

152152
/// Observe that we are processing a specific type representation.
@@ -158,7 +158,7 @@ class PrettyStackTraceTypeRepr : public llvm::PrettyStackTraceEntry {
158158
PrettyStackTraceTypeRepr(const ASTContext &C, const char *action,
159159
TypeRepr *type)
160160
: Context(C), TheType(type), Action(action) {}
161-
virtual void print(llvm::raw_ostream &OS) const;
161+
virtual void print(llvm::raw_ostream &OS) const override;
162162
};
163163

164164
/// PrettyStackTraceConformance - Observe that we are processing a
@@ -171,7 +171,7 @@ class PrettyStackTraceConformance : public llvm::PrettyStackTraceEntry {
171171
PrettyStackTraceConformance(const ASTContext &C, const char *action,
172172
const ProtocolConformance *conformance)
173173
: Context(C), Conformance(conformance), Action(action) {}
174-
virtual void print(llvm::raw_ostream &OS) const;
174+
virtual void print(llvm::raw_ostream &OS) const override;
175175
};
176176

177177
void printConformanceDescription(llvm::raw_ostream &out,
@@ -217,7 +217,7 @@ class PrettyStackTraceDifferentiabilityWitness
217217
PrettyStackTraceDifferentiabilityWitness(
218218
const char *action, const SILDifferentiabilityWitnessKey key)
219219
: Key(key), Action(action) {}
220-
virtual void print(llvm::raw_ostream &OS) const;
220+
virtual void print(llvm::raw_ostream &OS) const override;
221221
};
222222

223223
void printDifferentiabilityWitnessDescription(
@@ -232,7 +232,7 @@ class PrettyStackTraceDeclContext : public llvm::PrettyStackTraceEntry {
232232
public:
233233
PrettyStackTraceDeclContext(const char *action, const DeclContext *DC)
234234
: DC(DC), Action(action) {}
235-
virtual void print(llvm::raw_ostream &OS) const;
235+
virtual void print(llvm::raw_ostream &OS) const override;
236236
};
237237

238238
} // end namespace swift

include/swift/Driver/Action.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class CompileJobAction : public JobAction {
148148
};
149149

150150
private:
151-
virtual void anchor();
151+
virtual void anchor() override;
152152
InputInfo inputInfo;
153153

154154
public:
@@ -191,7 +191,7 @@ class CompileJobAction : public JobAction {
191191

192192
class InterpretJobAction : public JobAction {
193193
private:
194-
virtual void anchor();
194+
virtual void anchor() override;
195195

196196
public:
197197
explicit InterpretJobAction()
@@ -205,7 +205,7 @@ class InterpretJobAction : public JobAction {
205205

206206
class BackendJobAction : public JobAction {
207207
private:
208-
virtual void anchor();
208+
virtual void anchor() override;
209209

210210
// In case of multi-threaded compilation, the compile-action produces multiple
211211
// output bitcode-files. For each bitcode-file a BackendJobAction is created.
@@ -220,7 +220,7 @@ class BackendJobAction : public JobAction {
220220
return A->getKind() == Action::Kind::BackendJob;
221221
}
222222

223-
virtual size_t getInputIndex() const { return InputIndex; }
223+
virtual size_t getInputIndex() const override { return InputIndex; }
224224
};
225225

226226
class REPLJobAction : public JobAction {
@@ -231,7 +231,7 @@ class REPLJobAction : public JobAction {
231231
RequireLLDB
232232
};
233233
private:
234-
virtual void anchor();
234+
virtual void anchor() override;
235235
Mode RequestedMode;
236236
public:
237237
REPLJobAction(Mode mode)
@@ -247,7 +247,7 @@ class REPLJobAction : public JobAction {
247247
};
248248

249249
class MergeModuleJobAction : public JobAction {
250-
virtual void anchor();
250+
virtual void anchor() override;
251251
public:
252252
MergeModuleJobAction(ArrayRef<const Action *> Inputs)
253253
: JobAction(Action::Kind::MergeModuleJob, Inputs,
@@ -259,7 +259,7 @@ class MergeModuleJobAction : public JobAction {
259259
};
260260

261261
class ModuleWrapJobAction : public JobAction {
262-
virtual void anchor();
262+
virtual void anchor() override;
263263
public:
264264
ModuleWrapJobAction(ArrayRef<const Action *> Inputs)
265265
: JobAction(Action::Kind::ModuleWrapJob, Inputs,
@@ -271,7 +271,7 @@ class ModuleWrapJobAction : public JobAction {
271271
};
272272

273273
class AutolinkExtractJobAction : public JobAction {
274-
virtual void anchor();
274+
virtual void anchor() override;
275275
public:
276276
AutolinkExtractJobAction(ArrayRef<const Action *> Inputs)
277277
: JobAction(Action::Kind::AutolinkExtractJob, Inputs,
@@ -283,7 +283,7 @@ class AutolinkExtractJobAction : public JobAction {
283283
};
284284

285285
class GenerateDSYMJobAction : public JobAction {
286-
virtual void anchor();
286+
virtual void anchor() override;
287287
public:
288288
explicit GenerateDSYMJobAction(const Action *Input)
289289
: JobAction(Action::Kind::GenerateDSYMJob, Input,
@@ -295,7 +295,7 @@ class GenerateDSYMJobAction : public JobAction {
295295
};
296296

297297
class VerifyDebugInfoJobAction : public JobAction {
298-
virtual void anchor();
298+
virtual void anchor() override;
299299
public:
300300
explicit VerifyDebugInfoJobAction(const Action *Input)
301301
: JobAction(Action::Kind::VerifyDebugInfoJob, Input,
@@ -309,7 +309,7 @@ class VerifyDebugInfoJobAction : public JobAction {
309309
class GeneratePCHJobAction : public JobAction {
310310
std::string PersistentPCHDir;
311311

312-
virtual void anchor();
312+
virtual void anchor() override;
313313
public:
314314
GeneratePCHJobAction(const Action *Input, StringRef persistentPCHDir)
315315
: JobAction(Action::Kind::GeneratePCHJob, Input,
@@ -326,7 +326,7 @@ class GeneratePCHJobAction : public JobAction {
326326
};
327327

328328
class DynamicLinkJobAction : public JobAction {
329-
virtual void anchor();
329+
virtual void anchor() override;
330330
LinkKind Kind;
331331

332332
public:
@@ -344,7 +344,7 @@ class DynamicLinkJobAction : public JobAction {
344344
};
345345

346346
class StaticLinkJobAction : public JobAction {
347-
virtual void anchor();
347+
virtual void anchor() override;
348348

349349
public:
350350
StaticLinkJobAction(ArrayRef<const Action *> Inputs, LinkKind K)

include/swift/Reflection/TypeLowering.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class BuiltinTypeInfo : public TypeInfo {
181181

182182
bool readExtraInhabitantIndex(remote::MemoryReader &reader,
183183
remote::RemoteAddress address,
184-
int *extraInhabitantIndex) const;
184+
int *extraInhabitantIndex) const override;
185185

186186
static bool classof(const TypeInfo *TI) {
187187
return TI->getKind() == TypeInfoKind::Builtin;
@@ -208,7 +208,7 @@ class RecordTypeInfo : public TypeInfo {
208208

209209
bool readExtraInhabitantIndex(remote::MemoryReader &reader,
210210
remote::RemoteAddress address,
211-
int *index) const;
211+
int *index) const override;
212212

213213
static bool classof(const TypeInfo *TI) {
214214
return TI->getKind() == TypeInfoKind::Record;
@@ -299,7 +299,7 @@ class ReferenceTypeInfo : public TypeInfo {
299299

300300
bool readExtraInhabitantIndex(remote::MemoryReader &reader,
301301
remote::RemoteAddress address,
302-
int *extraInhabitantIndex) const {
302+
int *extraInhabitantIndex) const override {
303303
if (getNumExtraInhabitants() == 0) {
304304
*extraInhabitantIndex = -1;
305305
return true;

include/swift/SIL/OptimizationRemark.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ struct ArgumentKeyKind {
5757
InnerTy innerValue;
5858

5959
ArgumentKeyKind(InnerTy value) : innerValue(value) {}
60-
ArgumentKeyKind(const ArgumentKeyKind &kind) : innerValue(kind.innerValue) {}
6160

6261
operator InnerTy() const { return innerValue; }
6362

include/swift/SIL/PrettyStackTrace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class PrettyStackTraceSILLocation : public llvm::PrettyStackTraceEntry {
3939
PrettyStackTraceSILLocation(const char *action, SILLocation loc,
4040
ASTContext &C)
4141
: Loc(loc), Action(action), Context(C) {}
42-
virtual void print(llvm::raw_ostream &OS) const;
42+
virtual void print(llvm::raw_ostream &OS) const override;
4343
};
4444

4545

@@ -62,7 +62,7 @@ class PrettyStackTraceSILFunction : public llvm::PrettyStackTraceEntry {
6262
PrettyStackTraceSILFunction(llvm::Twine &&twine, const SILFunction *func)
6363
: func(func), data(), action(twine.toNullTerminatedStringRef(data)) {}
6464

65-
virtual void print(llvm::raw_ostream &os) const;
65+
virtual void print(llvm::raw_ostream &os) const override;
6666

6767
protected:
6868
void printFunctionInfo(llvm::raw_ostream &out) const;
@@ -77,7 +77,7 @@ class PrettyStackTraceSILNode : public llvm::PrettyStackTraceEntry {
7777
PrettyStackTraceSILNode(const char *action, const SILNode *node)
7878
: Node(node), Action(action) {}
7979

80-
virtual void print(llvm::raw_ostream &OS) const;
80+
virtual void print(llvm::raw_ostream &OS) const override;
8181
};
8282

8383
} // end namespace swift

include/swift/SIL/SILConstants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class SymbolicValueBumpAllocator : public SymbolicValueAllocator {
7373
SymbolicValueBumpAllocator() {}
7474
~SymbolicValueBumpAllocator() {}
7575

76-
void *allocate(unsigned long byteSize, unsigned alignment) {
76+
void *allocate(unsigned long byteSize, unsigned alignment) override {
7777
return bumpAllocator.Allocate(byteSize, alignment);
7878
}
7979
};

0 commit comments

Comments
 (0)