From bbc6e7edb5fca4a61ac53dd9bce79cb4f0bb3403 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Fri, 24 Aug 2018 16:58:47 +0100 Subject: 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 --- compiler/linker/elf_builder.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'compiler/linker/elf_builder.h') diff --git a/compiler/linker/elf_builder.h b/compiler/linker/elf_builder.h index 974c590a65..81ecc175b5 100644 --- a/compiler/linker/elf_builder.h +++ b/compiler/linker/elf_builder.h @@ -75,7 +75,7 @@ namespace linker { // The debug sections are written last for easier stripping. // template -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 @@ class ElfBuilder FINAL { // 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 @@ class ElfBuilder FINAL { }; // Writer of .dynstr section. - class CachedStringSection FINAL : public CachedSection { + class CachedStringSection final : public CachedSection { public: CachedStringSection(ElfBuilder* owner, const std::string& name, @@ -295,7 +295,7 @@ class ElfBuilder FINAL { }; // Writer of .strtab and .shstrtab sections. - class StringSection FINAL : public Section { + class StringSection final : public Section { public: StringSection(ElfBuilder* owner, const std::string& name, @@ -338,7 +338,7 @@ class ElfBuilder FINAL { }; // Writer of .dynsym and .symtab sections. - class SymbolSection FINAL : public Section { + class SymbolSection final : public Section { public: SymbolSection(ElfBuilder* owner, const std::string& name, @@ -410,7 +410,7 @@ class ElfBuilder FINAL { std::vector 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 @@ class ElfBuilder FINAL { } abiflags_; }; - class BuildIdSection FINAL : public Section { + class BuildIdSection final : public Section { public: BuildIdSection(ElfBuilder* owner, const std::string& name, -- cgit v1.2.3-59-g8ed1b