Skip to content

Commit 6ff5aa7

Browse files
committedMar 10, 2014
[C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.
llvm-svn: 203442
1 parent e42bafe commit 6ff5aa7

14 files changed

+62
-67
lines changed
 

‎llvm/include/llvm/Support/Allocator.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class MallocSlabAllocator : public SlabAllocator {
7979
public:
8080
MallocSlabAllocator() : Allocator() { }
8181
virtual ~MallocSlabAllocator();
82-
virtual MemSlab *Allocate(size_t Size) override;
83-
virtual void Deallocate(MemSlab *Slab) override;
82+
MemSlab *Allocate(size_t Size) override;
83+
void Deallocate(MemSlab *Slab) override;
8484
};
8585

8686
/// BumpPtrAllocator - This allocator is useful for containers that need

‎llvm/include/llvm/Support/FormattedStream.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ class formatted_raw_ostream : public raw_ostream {
5757
///
5858
const char *Scanned;
5959

60-
virtual void write_impl(const char *Ptr, size_t Size) override;
60+
void write_impl(const char *Ptr, size_t Size) override;
6161

6262
/// current_pos - Return the current position within the stream,
6363
/// not counting the bytes currently in the buffer.
64-
virtual uint64_t current_pos() const override {
64+
uint64_t current_pos() const override {
6565
// Our current position in the stream is all the contents which have been
6666
// written to the underlying stream (*not* the current position of the
6767
// underlying stream).

‎llvm/include/llvm/Support/PrettyStackTrace.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace llvm {
5050
const char *Str;
5151
public:
5252
PrettyStackTraceString(const char *str) : Str(str) {}
53-
virtual void print(raw_ostream &OS) const override;
53+
void print(raw_ostream &OS) const override;
5454
};
5555

5656
/// PrettyStackTraceProgram - This object prints a specified program arguments
@@ -63,7 +63,7 @@ namespace llvm {
6363
: ArgC(argc), ArgV(argv) {
6464
EnablePrettyStackTrace();
6565
}
66-
virtual void print(raw_ostream &OS) const override;
66+
void print(raw_ostream &OS) const override;
6767
};
6868

6969
} // end namespace llvm

‎llvm/include/llvm/Support/StreamableMemoryObject.h

+13-16
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@ class StreamableMemoryObject : public MemoryObject {
3939
/// getBase - Returns the lowest valid address in the region.
4040
///
4141
/// @result - The lowest valid address.
42-
virtual uint64_t getBase() const override = 0;
42+
uint64_t getBase() const override = 0;
4343

4444
/// getExtent - Returns the size of the region in bytes. (The region is
4545
/// contiguous, so the highest valid address of the region
4646
/// is getBase() + getExtent() - 1).
4747
/// May block until all bytes in the stream have been read
4848
///
4949
/// @result - The size of the region.
50-
virtual uint64_t getExtent() const override = 0;
50+
uint64_t getExtent() const override = 0;
5151

5252
/// readByte - Tries to read a single byte from the region.
5353
/// May block until (address - base) bytes have been read
5454
/// @param address - The address of the byte, in the same space as getBase().
5555
/// @param ptr - A pointer to a byte to be filled in. Must be non-NULL.
5656
/// @result - 0 if successful; -1 if not. Failure may be due to a
5757
/// bounds violation or an implementation-specific error.
58-
virtual int readByte(uint64_t address, uint8_t *ptr) const override = 0;
58+
int readByte(uint64_t address, uint8_t *ptr) const override = 0;
5959

6060
/// readBytes - Tries to read a contiguous range of bytes from the
6161
/// region, up to the end of the region.
@@ -71,9 +71,8 @@ class StreamableMemoryObject : public MemoryObject {
7171
/// and large enough to hold size bytes.
7272
/// @result - 0 if successful; -1 if not. Failure may be due to a
7373
/// bounds violation or an implementation-specific error.
74-
virtual int readBytes(uint64_t address,
75-
uint64_t size,
76-
uint8_t *buf) const override = 0;
74+
int readBytes(uint64_t address, uint64_t size,
75+
uint8_t *buf) const override = 0;
7776

7877
/// getPointer - Ensures that the requested data is in memory, and returns
7978
/// A pointer to it. More efficient than using readBytes if the
@@ -106,23 +105,21 @@ class StreamableMemoryObject : public MemoryObject {
106105
class StreamingMemoryObject : public StreamableMemoryObject {
107106
public:
108107
StreamingMemoryObject(DataStreamer *streamer);
109-
virtual uint64_t getBase() const override { return 0; }
110-
virtual uint64_t getExtent() const override;
111-
virtual int readByte(uint64_t address, uint8_t *ptr) const override;
112-
virtual int readBytes(uint64_t address,
113-
uint64_t size,
114-
uint8_t *buf) const override;
115-
virtual const uint8_t *getPointer(uint64_t address,
116-
uint64_t size) const override {
108+
uint64_t getBase() const override { return 0; }
109+
uint64_t getExtent() const override;
110+
int readByte(uint64_t address, uint8_t *ptr) const override;
111+
int readBytes(uint64_t address, uint64_t size,
112+
uint8_t *buf) const override;
113+
const uint8_t *getPointer(uint64_t address, uint64_t size) const override {
117114
// This could be fixed by ensuring the bytes are fetched and making a copy,
118115
// requiring that the bitcode size be known, or otherwise ensuring that
119116
// the memory doesn't go away/get reallocated, but it's
120117
// not currently necessary. Users that need the pointer don't stream.
121118
assert(0 && "getPointer in streaming memory objects not allowed");
122119
return NULL;
123120
}
124-
virtual bool isValidAddress(uint64_t address) const override;
125-
virtual bool isObjectEnd(uint64_t address) const override;
121+
bool isValidAddress(uint64_t address) const override;
122+
bool isObjectEnd(uint64_t address) const override;
126123

127124
/// Drop s bytes from the front of the stream, pushing the positions of the
128125
/// remaining bytes down by s. This is used to skip past the bitcode header,

‎llvm/include/llvm/Support/YAMLParser.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class KeyValueNode : public Node {
251251
/// @returns The value, or nullptr if failed() == true.
252252
Node *getValue();
253253

254-
virtual void skip() override {
254+
void skip() override {
255255
getKey()->skip();
256256
getValue()->skip();
257257
}
@@ -365,7 +365,7 @@ class MappingNode : public Node {
365365

366366
iterator end() { return iterator(); }
367367

368-
virtual void skip() override {
368+
void skip() override {
369369
yaml::skip(*this);
370370
}
371371

@@ -426,7 +426,7 @@ class SequenceNode : public Node {
426426

427427
iterator end() { return iterator(); }
428428

429-
virtual void skip() override {
429+
void skip() override {
430430
yaml::skip(*this);
431431
}
432432

‎llvm/include/llvm/Support/circular_raw_ostream.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ namespace llvm
8181
Filled = false;
8282
}
8383

84-
virtual void write_impl(const char *Ptr, size_t Size) override;
84+
void write_impl(const char *Ptr, size_t Size) override;
8585

8686
/// current_pos - Return the current position within the stream,
8787
/// not counting the bytes currently in the buffer.
8888
///
89-
virtual uint64_t current_pos() const override {
89+
uint64_t current_pos() const override {
9090
// This has the same effect as calling TheStream.current_pos(),
9191
// but that interface is private.
9292
return TheStream->tell() - TheStream->GetNumBytesInBuffer();

‎llvm/include/llvm/Support/raw_os_ostream.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class raw_os_ostream : public raw_ostream {
2626
std::ostream &OS;
2727

2828
/// write_impl - See raw_ostream::write_impl.
29-
virtual void write_impl(const char *Ptr, size_t Size) override;
29+
void write_impl(const char *Ptr, size_t Size) override;
3030

3131
/// current_pos - Return the current position within the stream, not
3232
/// counting the bytes currently in the buffer.
33-
virtual uint64_t current_pos() const override;
33+
uint64_t current_pos() const override;
3434

3535
public:
3636
raw_os_ostream(std::ostream &O) : OS(O) {}

‎llvm/include/llvm/Support/raw_ostream.h

+15-15
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,14 @@ class raw_fd_ostream : public raw_ostream {
322322
uint64_t pos;
323323

324324
/// write_impl - See raw_ostream::write_impl.
325-
virtual void write_impl(const char *Ptr, size_t Size) override;
325+
void write_impl(const char *Ptr, size_t Size) override;
326326

327327
/// current_pos - Return the current position within the stream, not
328328
/// counting the bytes currently in the buffer.
329-
virtual uint64_t current_pos() const override { return pos; }
329+
uint64_t current_pos() const override { return pos; }
330330

331331
/// preferred_buffer_size - Determine an efficient buffer size.
332-
virtual size_t preferred_buffer_size() const override;
332+
size_t preferred_buffer_size() const override;
333333

334334
/// error_detected - Set the flag indicating that an output error has
335335
/// been encountered.
@@ -373,15 +373,15 @@ class raw_fd_ostream : public raw_ostream {
373373
UseAtomicWrites = Value;
374374
}
375375

376-
virtual raw_ostream &changeColor(enum Colors colors, bool bold=false,
377-
bool bg=false) override;
378-
virtual raw_ostream &resetColor() override;
376+
raw_ostream &changeColor(enum Colors colors, bool bold=false,
377+
bool bg=false) override;
378+
raw_ostream &resetColor() override;
379379

380-
virtual raw_ostream &reverseColor() override;
380+
raw_ostream &reverseColor() override;
381381

382-
virtual bool is_displayed() const override;
382+
bool is_displayed() const override;
383383

384-
virtual bool has_colors() const override;
384+
bool has_colors() const override;
385385

386386
/// has_error - Return the value of the flag in this raw_fd_ostream indicating
387387
/// whether an output error has been encountered.
@@ -427,11 +427,11 @@ class raw_string_ostream : public raw_ostream {
427427
std::string &OS;
428428

429429
/// write_impl - See raw_ostream::write_impl.
430-
virtual void write_impl(const char *Ptr, size_t Size) override;
430+
void write_impl(const char *Ptr, size_t Size) override;
431431

432432
/// current_pos - Return the current position within the stream, not
433433
/// counting the bytes currently in the buffer.
434-
virtual uint64_t current_pos() const override { return OS.size(); }
434+
uint64_t current_pos() const override { return OS.size(); }
435435
public:
436436
explicit raw_string_ostream(std::string &O) : OS(O) {}
437437
~raw_string_ostream();
@@ -451,11 +451,11 @@ class raw_svector_ostream : public raw_ostream {
451451
SmallVectorImpl<char> &OS;
452452

453453
/// write_impl - See raw_ostream::write_impl.
454-
virtual void write_impl(const char *Ptr, size_t Size) override;
454+
void write_impl(const char *Ptr, size_t Size) override;
455455

456456
/// current_pos - Return the current position within the stream, not
457457
/// counting the bytes currently in the buffer.
458-
virtual uint64_t current_pos() const override;
458+
uint64_t current_pos() const override;
459459
public:
460460
/// Construct a new raw_svector_ostream.
461461
///
@@ -477,11 +477,11 @@ class raw_svector_ostream : public raw_ostream {
477477
/// raw_null_ostream - A raw_ostream that discards all output.
478478
class raw_null_ostream : public raw_ostream {
479479
/// write_impl - See raw_ostream::write_impl.
480-
virtual void write_impl(const char *Ptr, size_t size) override;
480+
void write_impl(const char *Ptr, size_t size) override;
481481

482482
/// current_pos - Return the current position within the stream, not
483483
/// counting the bytes currently in the buffer.
484-
virtual uint64_t current_pos() const override;
484+
uint64_t current_pos() const override;
485485

486486
public:
487487
explicit raw_null_ostream() {}

‎llvm/include/llvm/Support/system_error.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ class error_category
652652
class _do_message : public error_category
653653
{
654654
public:
655-
virtual std::string message(int ev) const override;
655+
std::string message(int ev) const override;
656656
};
657657

658658
const error_category& generic_category();

‎llvm/lib/Support/DAGDeltaAlgorithm.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ class DeltaActiveSetHelper : public DeltaAlgorithm {
162162

163163
protected:
164164
/// UpdatedSearchState - Callback used when the search state changes.
165-
virtual void UpdatedSearchState(const changeset_ty &Changes,
165+
void UpdatedSearchState(const changeset_ty &Changes,
166166
const changesetlist_ty &Sets) override {
167167
DDAI.UpdatedSearchState(Changes, Sets, Required);
168168
}
169169

170-
virtual bool ExecuteOneTest(const changeset_ty &S) override {
170+
bool ExecuteOneTest(const changeset_ty &S) override {
171171
return DDAI.GetTestResult(S, Required);
172172
}
173173

‎llvm/lib/Support/DataStream.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class DataFileStreamer : public DataStreamer {
5858
virtual ~DataFileStreamer() {
5959
close(Fd);
6060
}
61-
virtual size_t GetBytes(unsigned char *buf, size_t len) override {
61+
size_t GetBytes(unsigned char *buf, size_t len) override {
6262
NumStreamFetches++;
6363
return read(Fd, buf, len);
6464
}

‎llvm/lib/Support/MemoryBuffer.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ class MemoryBufferMem : public MemoryBuffer {
9191
init(InputData.begin(), InputData.end(), RequiresNullTerminator);
9292
}
9393

94-
virtual const char *getBufferIdentifier() const override {
94+
const char *getBufferIdentifier() const override {
9595
// The name is stored after the class itself.
9696
return reinterpret_cast<const char*>(this + 1);
9797
}
9898

99-
virtual BufferKind getBufferKind() const override {
99+
BufferKind getBufferKind() const override {
100100
return MemoryBuffer_Malloc;
101101
}
102102
};
@@ -217,12 +217,12 @@ class MemoryBufferMMapFile : public MemoryBuffer {
217217
}
218218
}
219219

220-
virtual const char *getBufferIdentifier() const override {
220+
const char *getBufferIdentifier() const override {
221221
// The name is stored after the class itself.
222222
return reinterpret_cast<const char *>(this + 1);
223223
}
224224

225-
virtual BufferKind getBufferKind() const override {
225+
BufferKind getBufferKind() const override {
226226
return MemoryBuffer_MMap;
227227
}
228228
};

‎llvm/lib/Support/StreamableMemoryObject.cpp

+8-10
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,18 @@ class RawMemoryObject : public StreamableMemoryObject {
2525
assert(LastChar >= FirstChar && "Invalid start/end range");
2626
}
2727

28-
virtual uint64_t getBase() const override { return 0; }
29-
virtual uint64_t getExtent() const override {
28+
uint64_t getBase() const override { return 0; }
29+
uint64_t getExtent() const override {
3030
return LastChar - FirstChar;
3131
}
32-
virtual int readByte(uint64_t address, uint8_t* ptr) const override;
33-
virtual int readBytes(uint64_t address,
34-
uint64_t size,
35-
uint8_t *buf) const override;
36-
virtual const uint8_t *getPointer(uint64_t address,
37-
uint64_t size) const override;
38-
virtual bool isValidAddress(uint64_t address) const override {
32+
int readByte(uint64_t address, uint8_t* ptr) const override;
33+
int readBytes(uint64_t address, uint64_t size,
34+
uint8_t *buf) const override;
35+
const uint8_t *getPointer(uint64_t address, uint64_t size) const override;
36+
bool isValidAddress(uint64_t address) const override {
3937
return validAddress(address);
4038
}
41-
virtual bool isObjectEnd(uint64_t address) const override {
39+
bool isObjectEnd(uint64_t address) const override {
4240
return objectEnd(address);
4341
}
4442

‎llvm/lib/Support/system_error.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ _do_message::message(int ev) const {
4848

4949
class _generic_error_category : public _do_message {
5050
public:
51-
virtual const char* name() const override;
52-
virtual std::string message(int ev) const override;
51+
const char* name() const override;
52+
std::string message(int ev) const override;
5353
};
5454

5555
const char*
@@ -74,9 +74,9 @@ generic_category() {
7474

7575
class _system_error_category : public _do_message {
7676
public:
77-
virtual const char* name() const override;
78-
virtual std::string message(int ev) const override;
79-
virtual error_condition default_error_condition(int ev) const override;
77+
const char* name() const override;
78+
std::string message(int ev) const override;
79+
error_condition default_error_condition(int ev) const override;
8080
};
8181

8282
const char*

0 commit comments

Comments
 (0)
Please sign in to comment.