diff options
| author | 2018-08-28 16:27:48 +0000 | |
|---|---|---|
| committer | 2018-08-28 16:27:48 +0000 | |
| commit | 6bfbdc7fe3751fb6af6ff65493ab9e0f74ed5ca8 (patch) | |
| tree | a2d391945f5b78e840155bbb420768d9dd402a5d /compiler/linker | |
| parent | aa317ffafe685b96993ffb2617c530f8b950480f (diff) | |
| parent | 625ca4759941299e8a9cc876c985558c4d76bdc0 (diff) | |
Merge changes If4de1e1f,I11493096,I256c7758
* changes:
Remove 'virtual' and 'override' qualifiers on final methods.
Remove superfluous 'virtual' specifiers in ART.
Use 'final' and 'override' specifiers directly in ART.
Diffstat (limited to 'compiler/linker')
| -rw-r--r-- | compiler/linker/buffered_output_stream.h | 10 | ||||
| -rw-r--r-- | compiler/linker/elf_builder.h | 18 | ||||
| -rw-r--r-- | compiler/linker/error_delaying_output_stream.h | 8 | ||||
| -rw-r--r-- | compiler/linker/file_output_stream.h | 10 | ||||
| -rw-r--r-- | compiler/linker/output_stream_test.cc | 8 | ||||
| -rw-r--r-- | compiler/linker/vector_output_stream.h | 10 |
6 files changed, 32 insertions, 32 deletions
diff --git a/compiler/linker/buffered_output_stream.h b/compiler/linker/buffered_output_stream.h index 512409cb2f..cb1c44ba23 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 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 <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 @@ 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<ElfTypes>* 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<ElfTypes>* 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<ElfTypes>* owner, const std::string& name, @@ -410,7 +410,7 @@ class ElfBuilder FINAL { 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 @@ class ElfBuilder FINAL { } 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 659f1dc093..cadd71c3f0 100644 --- a/compiler/linker/error_delaying_output_stream.h +++ b/compiler/linker/error_delaying_output_stream.h @@ -27,7 +27,7 @@ namespace art { 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 @@ class ErrorDelayingOutputStream FINAL : public OutputStream { // 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 @@ class ErrorDelayingOutputStream FINAL : public OutputStream { // 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 @@ class ErrorDelayingOutputStream FINAL : public OutputStream { // 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 deb051fca4..1417132981 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 f93ea7a709..bcb129c2da 100644 --- a/compiler/linker/output_stream_test.cc +++ b/compiler/linker/output_stream_test.cc @@ -106,20 +106,20 @@ TEST_F(OutputStreamTest, BufferedFlush) { 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 92caf596ab..0d34da6cba 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 @@ class VectorOutputStream FINAL : public OutputStream { 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; } |