Skip to content

Commit dcafa45

Browse files
kazutakahirataaokblast
authored andcommitted
[Support] Add "override" where appropriate (NFC) (llvm#164190)
Note that "override" makes "virtual" redundant. Identified with modernize-use-override.
1 parent 588123b commit dcafa45

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

llvm/include/llvm/Support/DebugLog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class RAIINewLineStream final : public raw_ostream {
293293

294294
public:
295295
RAIINewLineStream(raw_ostream &Os) : Os(Os) { SetUnbuffered(); }
296-
~RAIINewLineStream() { Os << '\n'; }
296+
~RAIINewLineStream() override { Os << '\n'; }
297297
void write_impl(const char *Ptr, size_t Size) final { Os.write(Ptr, Size); }
298298
uint64_t current_pos() const final { return Os.tell(); }
299299
RAIINewLineStream &asLvalue() { return *this; }

llvm/include/llvm/Support/ELFAttrParserCompact.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class LLVM_ABI ELFCompactAttrParser : public ELFAttributeParser {
4949
}
5050

5151
public:
52-
virtual ~ELFCompactAttrParser() { static_cast<void>(!cursor.takeError()); }
52+
~ELFCompactAttrParser() override { static_cast<void>(!cursor.takeError()); }
5353
Error integerAttribute(unsigned tag);
5454
Error stringAttribute(unsigned tag);
5555

llvm/include/llvm/Support/ELFAttrParserExtended.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class LLVM_ABI ELFExtendedAttrParser : public ELFAttributeParser {
3636
const unsigned Tag);
3737

3838
public:
39-
virtual ~ELFExtendedAttrParser() { static_cast<void>(!Cursor.takeError()); }
39+
~ELFExtendedAttrParser() override { static_cast<void>(!Cursor.takeError()); }
4040
Error parse(ArrayRef<uint8_t> Section, llvm::endianness Endian) override;
4141

4242
std::optional<unsigned> getAttributeValue(unsigned Tag) const override;

llvm/include/llvm/Support/FormatAdapters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ErrorAdapter : public FormatAdapter<Error> {
7777
public:
7878
ErrorAdapter(Error &&Item) : FormatAdapter(std::move(Item)) {}
7979
ErrorAdapter(ErrorAdapter &&) = default;
80-
~ErrorAdapter() { consumeError(std::move(Item)); }
80+
~ErrorAdapter() override { consumeError(std::move(Item)); }
8181
void format(llvm::raw_ostream &Stream, StringRef Style) override {
8282
Stream << Item;
8383
}

llvm/include/llvm/Support/ScopedPrinter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ struct DictScope : DelimitedScope {
870870
W.objectBegin();
871871
}
872872

873-
~DictScope() {
873+
~DictScope() override {
874874
if (W)
875875
W->objectEnd();
876876
}
@@ -889,7 +889,7 @@ struct ListScope : DelimitedScope {
889889
W.arrayBegin();
890890
}
891891

892-
~ListScope() {
892+
~ListScope() override {
893893
if (W)
894894
W->arrayEnd();
895895
}

llvm/include/llvm/Support/SuffixTreeNode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ struct LLVM_ABI SuffixTreeInternalNode : SuffixTreeNode {
155155
: SuffixTreeNode(NodeKind::ST_Internal, StartIdx), EndIdx(EndIdx),
156156
Link(Link) {}
157157

158-
virtual ~SuffixTreeInternalNode() = default;
158+
~SuffixTreeInternalNode() override = default;
159159
};
160160

161161
// A node representing a suffix.
@@ -189,7 +189,7 @@ struct LLVM_ABI SuffixTreeLeafNode : SuffixTreeNode {
189189
SuffixTreeLeafNode(unsigned StartIdx, unsigned *EndIdx)
190190
: SuffixTreeNode(NodeKind::ST_Leaf, StartIdx), EndIdx(EndIdx) {}
191191

192-
virtual ~SuffixTreeLeafNode() = default;
192+
~SuffixTreeLeafNode() override = default;
193193
};
194194
} // namespace llvm
195195
#endif // LLVM_SUPPORT_SUFFIXTREE_NODE_H

llvm/include/llvm/Support/VirtualFileSystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class LLVM_ABI FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem>,
268268
public RTTIExtends<FileSystem, RTTIRoot> {
269269
public:
270270
static const char ID;
271-
virtual ~FileSystem();
271+
~FileSystem() override;
272272

273273
/// Get the status of the entry at \p Path, if one exists.
274274
virtual llvm::ErrorOr<Status> status(const Twine &Path) = 0;
@@ -495,7 +495,7 @@ class LLVM_ABI ProxyFileSystem
495495
private:
496496
IntrusiveRefCntPtr<FileSystem> FS;
497497

498-
virtual void anchor() override;
498+
void anchor() override;
499499
};
500500

501501
namespace detail {

llvm/include/llvm/Support/VirtualOutputFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class OutputFileImpl : public RTTIExtends<OutputFileImpl, RTTIRoot> {
3131

3232
public:
3333
static char ID;
34-
virtual ~OutputFileImpl() = default;
34+
~OutputFileImpl() override = default;
3535

3636
virtual Error keep() = 0;
3737
virtual Error discard() = 0;

llvm/include/llvm/Support/raw_socket_stream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class LLVM_ABI raw_socket_stream : public raw_fd_stream {
126126

127127
public:
128128
raw_socket_stream(int SocketFD);
129-
~raw_socket_stream();
129+
~raw_socket_stream() override;
130130

131131
/// Create a \p raw_socket_stream connected to the UNIX domain socket at \p
132132
/// SocketPath.

0 commit comments

Comments
 (0)