[C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.
authorCraig Topper <craig.topper@gmail.com>
Mon, 10 Mar 2014 03:53:12 +0000 (03:53 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 10 Mar 2014 03:53:12 +0000 (03:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203442 91177308-0d34-0410-b5e6-96231b3b80d8

14 files changed:
include/llvm/Support/Allocator.h
include/llvm/Support/FormattedStream.h
include/llvm/Support/PrettyStackTrace.h
include/llvm/Support/StreamableMemoryObject.h
include/llvm/Support/YAMLParser.h
include/llvm/Support/circular_raw_ostream.h
include/llvm/Support/raw_os_ostream.h
include/llvm/Support/raw_ostream.h
include/llvm/Support/system_error.h
lib/Support/DAGDeltaAlgorithm.cpp
lib/Support/DataStream.cpp
lib/Support/MemoryBuffer.cpp
lib/Support/StreamableMemoryObject.cpp
lib/Support/system_error.cpp

index 371d2d9561f3b5724462ac1fc85ac8048b3836c1..737ae0b9595f521f909cf2db8b5cd3fc5214df7a 100644 (file)
@@ -79,8 +79,8 @@ class MallocSlabAllocator : public SlabAllocator {
 public:
   MallocSlabAllocator() : Allocator() { }
   virtual ~MallocSlabAllocator();
-  virtual MemSlab *Allocate(size_t Size) override;
-  virtual void Deallocate(MemSlab *Slab) override;
+  MemSlab *Allocate(size_t Size) override;
+  void Deallocate(MemSlab *Slab) override;
 };
 
 /// BumpPtrAllocator - This allocator is useful for containers that need
index d8eb068838ed0ec3b2636ee03800fc2aa6d4ea2a..78c4809e1200ebd80878ba2a53d418d8fa8399c3 100644 (file)
@@ -57,11 +57,11 @@ private:
   ///
   const char *Scanned;
 
-  virtual void write_impl(const char *Ptr, size_t Size) override;
+  void write_impl(const char *Ptr, size_t Size) override;
 
   /// current_pos - Return the current position within the stream,
   /// not counting the bytes currently in the buffer.
-  virtual uint64_t current_pos() const override {
+  uint64_t current_pos() const override {
     // Our current position in the stream is all the contents which have been
     // written to the underlying stream (*not* the current position of the
     // underlying stream).
index 87ad155a0b4cd4d3f4aaac2d2caa5a52be05abc5..914141ad3c4b8ee77097dc4e648d4a22a5ec66c8 100644 (file)
@@ -50,7 +50,7 @@ namespace llvm {
     const char *Str;
   public:
     PrettyStackTraceString(const char *str) : Str(str) {}
-    virtual void print(raw_ostream &OS) const override;
+    void print(raw_ostream &OS) const override;
   };
 
   /// PrettyStackTraceProgram - This object prints a specified program arguments
@@ -63,7 +63,7 @@ namespace llvm {
       : ArgC(argc), ArgV(argv) {
       EnablePrettyStackTrace();
     }
-    virtual void print(raw_ostream &OS) const override;
+    void print(raw_ostream &OS) const override;
   };
 
 } // end namespace llvm
index e2908756c360d864eed89fe7dd378e76da99c7a9..0259630c8a2028d9ffc7ec540d9623dca1153a4f 100644 (file)
@@ -39,7 +39,7 @@ class StreamableMemoryObject : public MemoryObject {
   /// getBase         - Returns the lowest valid address in the region.
   ///
   /// @result         - The lowest valid address.
-  virtual uint64_t getBase() const override = 0;
+  uint64_t getBase() const override = 0;
 
   /// getExtent       - Returns the size of the region in bytes.  (The region is
   ///                   contiguous, so the highest valid address of the region
@@ -47,7 +47,7 @@ class StreamableMemoryObject : public MemoryObject {
   ///                   May block until all bytes in the stream have been read
   ///
   /// @result         - The size of the region.
-  virtual uint64_t getExtent() const override = 0;
+  uint64_t getExtent() const override = 0;
 
   /// readByte        - Tries to read a single byte from the region.
   ///                   May block until (address - base) bytes have been read
@@ -55,7 +55,7 @@ class StreamableMemoryObject : public MemoryObject {
   /// @param ptr      - A pointer to a byte to be filled in.  Must be non-NULL.
   /// @result         - 0 if successful; -1 if not.  Failure may be due to a
   ///                   bounds violation or an implementation-specific error.
-  virtual int readByte(uint64_t address, uint8_t *ptr) const override = 0;
+  int readByte(uint64_t address, uint8_t *ptr) const override = 0;
 
   /// readBytes       - Tries to read a contiguous range of bytes from the
   ///                   region, up to the end of the region.
@@ -71,9 +71,8 @@ class StreamableMemoryObject : public MemoryObject {
   ///                   and large enough to hold size bytes.
   /// @result         - 0 if successful; -1 if not.  Failure may be due to a
   ///                   bounds violation or an implementation-specific error.
-  virtual int readBytes(uint64_t address,
-                        uint64_t size,
-                        uint8_t *buf) const override = 0;
+  int readBytes(uint64_t address, uint64_t size,
+                uint8_t *buf) const override = 0;
 
   /// getPointer  - Ensures that the requested data is in memory, and returns
   ///               A pointer to it. More efficient than using readBytes if the
@@ -106,14 +105,12 @@ class StreamableMemoryObject : public MemoryObject {
 class StreamingMemoryObject : public StreamableMemoryObject {
 public:
   StreamingMemoryObject(DataStreamer *streamer);
-  virtual uint64_t getBase() const override { return 0; }
-  virtual uint64_t getExtent() const override;
-  virtual int readByte(uint64_t address, uint8_t *ptr) const override;
-  virtual int readBytes(uint64_t address,
-                        uint64_t size,
-                        uint8_t *buf) const override;
-  virtual const uint8_t *getPointer(uint64_t address,
-                                    uint64_t size) const override {
+  uint64_t getBase() const override { return 0; }
+  uint64_t getExtent() const override;
+  int readByte(uint64_t address, uint8_t *ptr) const override;
+  int readBytes(uint64_t address, uint64_t size,
+                uint8_t *buf) const override;
+  const uint8_t *getPointer(uint64_t address, uint64_t size) const override {
     // This could be fixed by ensuring the bytes are fetched and making a copy,
     // requiring that the bitcode size be known, or otherwise ensuring that
     // the memory doesn't go away/get reallocated, but it's
@@ -121,8 +118,8 @@ public:
     assert(0 && "getPointer in streaming memory objects not allowed");
     return NULL;
   }
-  virtual bool isValidAddress(uint64_t address) const override;
-  virtual bool isObjectEnd(uint64_t address) const override;
+  bool isValidAddress(uint64_t address) const override;
+  bool isObjectEnd(uint64_t address) const override;
 
   /// Drop s bytes from the front of the stream, pushing the positions of the
   /// remaining bytes down by s. This is used to skip past the bitcode header,
index c11aa25094943876719a1126976b7bf84b3c0fc3..5194b52c3e6412705c651d8480264b1120bdb829 100644 (file)
@@ -251,7 +251,7 @@ public:
   /// @returns The value, or nullptr if failed() == true.
   Node *getValue();
 
-  virtual void skip() override {
+  void skip() override {
     getKey()->skip();
     getValue()->skip();
   }
@@ -365,7 +365,7 @@ public:
 
   iterator end() { return iterator(); }
 
-  virtual void skip() override {
+  void skip() override {
     yaml::skip(*this);
   }
 
@@ -426,7 +426,7 @@ public:
 
   iterator end() { return iterator(); }
 
-  virtual void skip() override {
+  void skip() override {
     yaml::skip(*this);
   }
 
index d7f5395dd8562eaa5dbf5c0f07a7be8d15570da3..31141990b55efd17e20f027a33699d22b1422123 100644 (file)
@@ -81,12 +81,12 @@ namespace llvm
       Filled = false;
     }
 
-    virtual void write_impl(const char *Ptr, size_t Size) override;
+    void write_impl(const char *Ptr, size_t Size) override;
 
     /// current_pos - Return the current position within the stream,
     /// not counting the bytes currently in the buffer.
     ///
-    virtual uint64_t current_pos() const override {
+    uint64_t current_pos() const override {
       // This has the same effect as calling TheStream.current_pos(),
       // but that interface is private.
       return TheStream->tell() - TheStream->GetNumBytesInBuffer();
index 9bfce437f7747cf89bc0eac76673f0b2c76c8bde..04cf3b6202c439dadaaf82e07cc7c15eacb25006 100644 (file)
@@ -26,11 +26,11 @@ class raw_os_ostream : public raw_ostream {
   std::ostream &OS;
 
   /// write_impl - See raw_ostream::write_impl.
-  virtual void write_impl(const char *Ptr, size_t Size) override;
+  void write_impl(const char *Ptr, size_t Size) override;
 
   /// current_pos - Return the current position within the stream, not
   /// counting the bytes currently in the buffer.
-  virtual uint64_t current_pos() const override;
+  uint64_t current_pos() const override;
 
 public:
   raw_os_ostream(std::ostream &O) : OS(O) {}
index 6c91f5870b5d573d19685e0fe92c8aaa11e333c3..0240035b02479618499f956d2978d51bf8d7558d 100644 (file)
@@ -322,14 +322,14 @@ class raw_fd_ostream : public raw_ostream {
   uint64_t pos;
 
   /// write_impl - See raw_ostream::write_impl.
-  virtual void write_impl(const char *Ptr, size_t Size) override;
+  void write_impl(const char *Ptr, size_t Size) override;
 
   /// current_pos - Return the current position within the stream, not
   /// counting the bytes currently in the buffer.
-  virtual uint64_t current_pos() const override { return pos; }
+  uint64_t current_pos() const override { return pos; }
 
   /// preferred_buffer_size - Determine an efficient buffer size.
-  virtual size_t preferred_buffer_size() const override;
+  size_t preferred_buffer_size() const override;
 
   /// error_detected - Set the flag indicating that an output error has
   /// been encountered.
@@ -373,15 +373,15 @@ public:
     UseAtomicWrites = Value;
   }
 
-  virtual raw_ostream &changeColor(enum Colors colors, bool bold=false,
-                                   bool bg=false) override;
-  virtual raw_ostream &resetColor() override;
+  raw_ostream &changeColor(enum Colors colors, bool bold=false,
+                           bool bg=false) override;
+  raw_ostream &resetColor() override;
 
-  virtual raw_ostream &reverseColor() override;
+  raw_ostream &reverseColor() override;
 
-  virtual bool is_displayed() const override;
+  bool is_displayed() const override;
 
-  virtual bool has_colors() const override;
+  bool has_colors() const override;
 
   /// has_error - Return the value of the flag in this raw_fd_ostream indicating
   /// whether an output error has been encountered.
@@ -427,11 +427,11 @@ class raw_string_ostream : public raw_ostream {
   std::string &OS;
 
   /// write_impl - See raw_ostream::write_impl.
-  virtual void write_impl(const char *Ptr, size_t Size) override;
+  void write_impl(const char *Ptr, size_t Size) override;
 
   /// current_pos - Return the current position within the stream, not
   /// counting the bytes currently in the buffer.
-  virtual uint64_t current_pos() const override { return OS.size(); }
+  uint64_t current_pos() const override { return OS.size(); }
 public:
   explicit raw_string_ostream(std::string &O) : OS(O) {}
   ~raw_string_ostream();
@@ -451,11 +451,11 @@ class raw_svector_ostream : public raw_ostream {
   SmallVectorImpl<char> &OS;
 
   /// write_impl - See raw_ostream::write_impl.
-  virtual void write_impl(const char *Ptr, size_t Size) override;
+  void write_impl(const char *Ptr, size_t Size) override;
 
   /// current_pos - Return the current position within the stream, not
   /// counting the bytes currently in the buffer.
-  virtual uint64_t current_pos() const override;
+  uint64_t current_pos() const override;
 public:
   /// Construct a new raw_svector_ostream.
   ///
@@ -477,11 +477,11 @@ public:
 /// raw_null_ostream - A raw_ostream that discards all output.
 class raw_null_ostream : public raw_ostream {
   /// write_impl - See raw_ostream::write_impl.
-  virtual void write_impl(const char *Ptr, size_t size) override;
+  void write_impl(const char *Ptr, size_t size) override;
 
   /// current_pos - Return the current position within the stream, not
   /// counting the bytes currently in the buffer.
-  virtual uint64_t current_pos() const override;
+  uint64_t current_pos() const override;
 
 public:
   explicit raw_null_ostream() {}
index ecd3e3c97dfe6da909363322986ef37e1a202b26..046132f8598407bd3975aa048b96f1ca5d0ae99a 100644 (file)
@@ -652,7 +652,7 @@ public:
 class _do_message : public error_category
 {
 public:
-  virtual std::string message(int ev) const override;
+  std::string message(int ev) const override;
 };
 
 const error_category& generic_category();
index 7b81a113514ae2be7417b3a29172d4e5c3f4db96..29acb7d3387f1512d518a6c722ca9d14842e88d0 100644 (file)
@@ -162,12 +162,12 @@ class DeltaActiveSetHelper : public DeltaAlgorithm {
 
 protected:
   /// UpdatedSearchState - Callback used when the search state changes.
-  virtual void UpdatedSearchState(const changeset_ty &Changes,
+  void UpdatedSearchState(const changeset_ty &Changes,
                                   const changesetlist_ty &Sets) override {
     DDAI.UpdatedSearchState(Changes, Sets, Required);
   }
 
-  virtual bool ExecuteOneTest(const changeset_ty &S) override {
+  bool ExecuteOneTest(const changeset_ty &S) override {
     return DDAI.GetTestResult(S, Required);
   }
 
index d02b83cb923febe2730b796e3c7a8dd45800afe1..1caeddfe24a2eb7263d03034a93d49f5df09ceec 100644 (file)
@@ -58,7 +58,7 @@ public:
   virtual ~DataFileStreamer() {
     close(Fd);
   }
-  virtual size_t GetBytes(unsigned char *buf, size_t len) override {
+  size_t GetBytes(unsigned char *buf, size_t len) override {
     NumStreamFetches++;
     return read(Fd, buf, len);
   }
index c7f76d3d7e711fa8064a3ebb359e775ca2ea92de..2d593a8f4146f5e9fdc845e6e520432663e08b2f 100644 (file)
@@ -91,12 +91,12 @@ public:
     init(InputData.begin(), InputData.end(), RequiresNullTerminator);
   }
 
-  virtual const char *getBufferIdentifier() const override {
+  const char *getBufferIdentifier() const override {
      // The name is stored after the class itself.
     return reinterpret_cast<const char*>(this + 1);
   }
 
-  virtual BufferKind getBufferKind() const override {
+  BufferKind getBufferKind() const override {
     return MemoryBuffer_Malloc;
   }
 };
@@ -217,12 +217,12 @@ public:
     }
   }
 
-  virtual const char *getBufferIdentifier() const override {
+  const char *getBufferIdentifier() const override {
     // The name is stored after the class itself.
     return reinterpret_cast<const char *>(this + 1);
   }
 
-  virtual BufferKind getBufferKind() const override {
+  BufferKind getBufferKind() const override {
     return MemoryBuffer_MMap;
   }
 };
index d7804e65f2403c5b5d39deb4498fe86082b1a237..5cb0680522d379d5bc0754e2f3efa9cfe742d737 100644 (file)
@@ -25,20 +25,18 @@ public:
     assert(LastChar >= FirstChar && "Invalid start/end range");
   }
 
-  virtual uint64_t getBase() const override { return 0; }
-  virtual uint64_t getExtent() const override {
+  uint64_t getBase() const override { return 0; }
+  uint64_t getExtent() const override {
     return LastChar - FirstChar;
   }
-  virtual int readByte(uint64_t address, uint8_t* ptr) const override;
-  virtual int readBytes(uint64_t address,
-                        uint64_t size,
-                        uint8_t *buf) const override;
-  virtual const uint8_t *getPointer(uint64_t address,
-                                    uint64_t size) const override;
-  virtual bool isValidAddress(uint64_t address) const override {
+  int readByte(uint64_t address, uint8_t* ptr) const override;
+  int readBytes(uint64_t address, uint64_t size,
+                uint8_t *buf) const override;
+  const uint8_t *getPointer(uint64_t address, uint64_t size) const override;
+  bool isValidAddress(uint64_t address) const override {
     return validAddress(address);
   }
-  virtual bool isObjectEnd(uint64_t address) const override {
+  bool isObjectEnd(uint64_t address) const override {
     return objectEnd(address);
   }
 
index b4a5f678ede9d70ae0b71b2e781aeec29b0f9fec..299f54abb15cd110e7b159661c0bfb0749d6d904 100644 (file)
@@ -48,8 +48,8 @@ _do_message::message(int ev) const {
 
 class _generic_error_category : public _do_message {
 public:
-  virtual const char* name() const override;
-  virtual std::string message(int ev) const override;
+  const char* name() const override;
+  std::string message(int ev) const override;
 };
 
 const char*
@@ -74,9 +74,9 @@ generic_category() {
 
 class _system_error_category : public _do_message {
 public:
-  virtual const char* name() const override;
-  virtual std::string message(int ev) const override;
-  virtual error_condition default_error_condition(int ev) const override;
+  const char* name() const override;
+  std::string message(int ev) const override;
+  error_condition default_error_condition(int ev) const override;
 };
 
 const char*