Use 'final' and 'override' specifiers directly in ART.

Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with
'final' and 'override' specifiers. Remove all definitions of these
macros as well, which were located in these files:
- libartbase/base/macros.h
- test/913-heaps/heaps.cc
- test/ti-agent/ti_macros.h

ART is now using C++14; the 'final' and 'override' specifiers have
been introduced in C++11.

Test: mmma art
Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
diff --git a/compiler/linker/buffered_output_stream.h b/compiler/linker/buffered_output_stream.h
index 512409c..cb1c44b 100644
--- a/compiler/linker/buffered_output_stream.h
+++ b/compiler/linker/buffered_output_stream.h
@@ -26,17 +26,17 @@
 namespace art {
 namespace linker {
 
-class BufferedOutputStream FINAL : public OutputStream {
+class BufferedOutputStream final : public OutputStream {
  public:
   explicit BufferedOutputStream(std::unique_ptr<OutputStream> out);
 
-  ~BufferedOutputStream() OVERRIDE;
+  ~BufferedOutputStream() override;
 
-  bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE;
+  bool WriteFully(const void* buffer, size_t byte_count) override;
 
-  off_t Seek(off_t offset, Whence whence) OVERRIDE;
+  off_t Seek(off_t offset, Whence whence) override;
 
-  bool Flush() OVERRIDE;
+  bool Flush() override;
 
  private:
   static const size_t kBufferSize = 8 * KB;
diff --git a/compiler/linker/elf_builder.h b/compiler/linker/elf_builder.h
index 974c590..81ecc17 100644
--- a/compiler/linker/elf_builder.h
+++ b/compiler/linker/elf_builder.h
@@ -75,7 +75,7 @@
 // The debug sections are written last for easier stripping.
 //
 template <typename ElfTypes>
-class ElfBuilder FINAL {
+class ElfBuilder final {
  public:
   static constexpr size_t kMaxProgramHeaders = 16;
   // SHA-1 digest.  Not using SHA_DIGEST_LENGTH from openssl/sha.h to avoid
@@ -173,21 +173,21 @@
 
     // This function always succeeds to simplify code.
     // Use builder's Good() to check the actual status.
-    bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE {
+    bool WriteFully(const void* buffer, size_t byte_count) override {
       CHECK(owner_->current_section_ == this);
       return owner_->stream_.WriteFully(buffer, byte_count);
     }
 
     // This function always succeeds to simplify code.
     // Use builder's Good() to check the actual status.
-    off_t Seek(off_t offset, Whence whence) OVERRIDE {
+    off_t Seek(off_t offset, Whence whence) override {
       // Forward the seek as-is and trust the caller to use it reasonably.
       return owner_->stream_.Seek(offset, whence);
     }
 
     // This function flushes the output and returns whether it succeeded.
     // If there was a previous failure, this does nothing and returns false, i.e. failed.
-    bool Flush() OVERRIDE {
+    bool Flush() override {
       return owner_->stream_.Flush();
     }
 
@@ -271,7 +271,7 @@
   };
 
   // Writer of .dynstr section.
-  class CachedStringSection FINAL : public CachedSection {
+  class CachedStringSection final : public CachedSection {
    public:
     CachedStringSection(ElfBuilder<ElfTypes>* owner,
                         const std::string& name,
@@ -295,7 +295,7 @@
   };
 
   // Writer of .strtab and .shstrtab sections.
-  class StringSection FINAL : public Section {
+  class StringSection final : public Section {
    public:
     StringSection(ElfBuilder<ElfTypes>* owner,
                   const std::string& name,
@@ -338,7 +338,7 @@
   };
 
   // Writer of .dynsym and .symtab sections.
-  class SymbolSection FINAL : public Section {
+  class SymbolSection final : public Section {
    public:
     SymbolSection(ElfBuilder<ElfTypes>* owner,
                   const std::string& name,
@@ -410,7 +410,7 @@
     std::vector<Elf_Sym> syms_;  // Buffered/cached content of the whole section.
   };
 
-  class AbiflagsSection FINAL : public Section {
+  class AbiflagsSection final : public Section {
    public:
     // Section with Mips abiflag info.
     static constexpr uint8_t MIPS_AFL_REG_NONE =         0;  // no registers
@@ -480,7 +480,7 @@
     } abiflags_;
   };
 
-  class BuildIdSection FINAL : public Section {
+  class BuildIdSection final : public Section {
    public:
     BuildIdSection(ElfBuilder<ElfTypes>* owner,
                    const std::string& name,
diff --git a/compiler/linker/error_delaying_output_stream.h b/compiler/linker/error_delaying_output_stream.h
index 659f1dc..cadd71c 100644
--- a/compiler/linker/error_delaying_output_stream.h
+++ b/compiler/linker/error_delaying_output_stream.h
@@ -27,7 +27,7 @@
 namespace linker {
 
 // OutputStream wrapper that delays reporting an error until Flush().
-class ErrorDelayingOutputStream FINAL : public OutputStream {
+class ErrorDelayingOutputStream final : public OutputStream {
  public:
   explicit ErrorDelayingOutputStream(OutputStream* output)
       : OutputStream(output->GetLocation()),
@@ -37,7 +37,7 @@
 
   // This function always succeeds to simplify code.
   // Use Good() to check the actual status of the output stream.
-  bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE {
+  bool WriteFully(const void* buffer, size_t byte_count) override {
     if (output_good_) {
       if (!output_->WriteFully(buffer, byte_count)) {
         PLOG(ERROR) << "Failed to write " << byte_count
@@ -51,7 +51,7 @@
 
   // This function always succeeds to simplify code.
   // Use Good() to check the actual status of the output stream.
-  off_t Seek(off_t offset, Whence whence) OVERRIDE {
+  off_t Seek(off_t offset, Whence whence) override {
     // We keep shadow copy of the offset so that we return
     // the expected value even if the output stream failed.
     off_t new_offset;
@@ -81,7 +81,7 @@
 
   // Flush the output and return whether all operations have succeeded.
   // Do nothing if we already have a pending error.
-  bool Flush() OVERRIDE {
+  bool Flush() override {
     if (output_good_) {
       output_good_ = output_->Flush();
     }
diff --git a/compiler/linker/file_output_stream.h b/compiler/linker/file_output_stream.h
index deb051f..1417132 100644
--- a/compiler/linker/file_output_stream.h
+++ b/compiler/linker/file_output_stream.h
@@ -24,17 +24,17 @@
 namespace art {
 namespace linker {
 
-class FileOutputStream FINAL : public OutputStream {
+class FileOutputStream final : public OutputStream {
  public:
   explicit FileOutputStream(File* file);
 
-  ~FileOutputStream() OVERRIDE {}
+  ~FileOutputStream() override {}
 
-  bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE;
+  bool WriteFully(const void* buffer, size_t byte_count) override;
 
-  off_t Seek(off_t offset, Whence whence) OVERRIDE;
+  off_t Seek(off_t offset, Whence whence) override;
 
-  bool Flush() OVERRIDE;
+  bool Flush() override;
 
  private:
   File* const file_;
diff --git a/compiler/linker/output_stream_test.cc b/compiler/linker/output_stream_test.cc
index f93ea7a..bcb129c 100644
--- a/compiler/linker/output_stream_test.cc
+++ b/compiler/linker/output_stream_test.cc
@@ -106,20 +106,20 @@
     CheckingOutputStream()
         : OutputStream("dummy"),
           flush_called(false) { }
-    ~CheckingOutputStream() OVERRIDE {}
+    ~CheckingOutputStream() override {}
 
     bool WriteFully(const void* buffer ATTRIBUTE_UNUSED,
-                    size_t byte_count ATTRIBUTE_UNUSED) OVERRIDE {
+                    size_t byte_count ATTRIBUTE_UNUSED) override {
       LOG(FATAL) << "UNREACHABLE";
       UNREACHABLE();
     }
 
-    off_t Seek(off_t offset ATTRIBUTE_UNUSED, Whence whence ATTRIBUTE_UNUSED) OVERRIDE {
+    off_t Seek(off_t offset ATTRIBUTE_UNUSED, Whence whence ATTRIBUTE_UNUSED) override {
       LOG(FATAL) << "UNREACHABLE";
       UNREACHABLE();
     }
 
-    bool Flush() OVERRIDE {
+    bool Flush() override {
       flush_called = true;
       return true;
     }
diff --git a/compiler/linker/vector_output_stream.h b/compiler/linker/vector_output_stream.h
index 92caf59..0d34da6 100644
--- a/compiler/linker/vector_output_stream.h
+++ b/compiler/linker/vector_output_stream.h
@@ -26,13 +26,13 @@
 namespace art {
 namespace linker {
 
-class VectorOutputStream FINAL : public OutputStream {
+class VectorOutputStream final : public OutputStream {
  public:
   VectorOutputStream(const std::string& location, std::vector<uint8_t>* vector);
 
-  ~VectorOutputStream() OVERRIDE {}
+  ~VectorOutputStream() override {}
 
-  bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE {
+  bool WriteFully(const void* buffer, size_t byte_count) override {
     if (static_cast<size_t>(offset_) == vector_->size()) {
       const uint8_t* start = reinterpret_cast<const uint8_t*>(buffer);
       vector_->insert(vector_->end(), &start[0], &start[byte_count]);
@@ -46,9 +46,9 @@
     return true;
   }
 
-  off_t Seek(off_t offset, Whence whence) OVERRIDE;
+  off_t Seek(off_t offset, Whence whence) override;
 
-  bool Flush() OVERRIDE {
+  bool Flush() override {
     return true;
   }