summaryrefslogtreecommitdiffstats
path: root/libdexfile/dex
diff options
context:
space:
mode:
authorRoland Levillain <rpl@google.com>2018-08-24 16:58:47 +0100
committerRoland Levillain <rpl@google.com>2018-08-28 11:06:07 +0100
commitbbc6e7edb5fca4a61ac53dd9bce79cb4f0bb3403 (patch)
tree0fbce767bc383358cf4cd65aafc74140e1850982 /libdexfile/dex
parent19379b58bd433da91230e4fe6cd96e7416d16adc (diff)
downloadart-bbc6e7edb5fca4a61ac53dd9bce79cb4f0bb3403.tar.gz
art-bbc6e7edb5fca4a61ac53dd9bce79cb4f0bb3403.tar.bz2
art-bbc6e7edb5fca4a61ac53dd9bce79cb4f0bb3403.zip
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
Diffstat (limited to 'libdexfile/dex')
-rw-r--r--libdexfile/dex/art_dex_file_loader.cc10
-rw-r--r--libdexfile/dex/art_dex_file_loader.h4
-rw-r--r--libdexfile/dex/art_dex_file_loader_test.cc2
-rw-r--r--libdexfile/dex/compact_dex_file.h12
-rw-r--r--libdexfile/dex/dex_file_loader.cc10
-rw-r--r--libdexfile/dex/dex_instruction.h12
-rw-r--r--libdexfile/dex/standard_dex_file.h10
7 files changed, 30 insertions, 30 deletions
diff --git a/libdexfile/dex/art_dex_file_loader.cc b/libdexfile/dex/art_dex_file_loader.cc
index 1846a13a20..f50bf1cc9f 100644
--- a/libdexfile/dex/art_dex_file_loader.cc
+++ b/libdexfile/dex/art_dex_file_loader.cc
@@ -40,9 +40,9 @@ namespace {
class MemMapContainer : public DexFileContainer {
public:
explicit MemMapContainer(MemMap&& mem_map) : mem_map_(std::move(mem_map)) { }
- virtual ~MemMapContainer() OVERRIDE { }
+ virtual ~MemMapContainer() override { }
- int GetPermissions() OVERRIDE {
+ int GetPermissions() override {
if (!mem_map_.IsValid()) {
return 0;
} else {
@@ -50,11 +50,11 @@ class MemMapContainer : public DexFileContainer {
}
}
- bool IsReadOnly() OVERRIDE {
+ bool IsReadOnly() override {
return GetPermissions() == PROT_READ;
}
- bool EnableWrite() OVERRIDE {
+ bool EnableWrite() override {
CHECK(IsReadOnly());
if (!mem_map_.IsValid()) {
return false;
@@ -63,7 +63,7 @@ class MemMapContainer : public DexFileContainer {
}
}
- bool DisableWrite() OVERRIDE {
+ bool DisableWrite() override {
CHECK(!IsReadOnly());
if (!mem_map_.IsValid()) {
return false;
diff --git a/libdexfile/dex/art_dex_file_loader.h b/libdexfile/dex/art_dex_file_loader.h
index 420b347808..40d4673625 100644
--- a/libdexfile/dex/art_dex_file_loader.h
+++ b/libdexfile/dex/art_dex_file_loader.h
@@ -51,7 +51,7 @@ class ArtDexFileLoader : public DexFileLoader {
std::vector<uint32_t>* checksums,
std::string* error_msg,
int zip_fd = -1,
- bool* only_contains_uncompressed_dex = nullptr) const OVERRIDE;
+ bool* only_contains_uncompressed_dex = nullptr) const override;
// Opens .dex file, backed by existing memory
std::unique_ptr<const DexFile> Open(const uint8_t* base,
@@ -61,7 +61,7 @@ class ArtDexFileLoader : public DexFileLoader {
const OatDexFile* oat_dex_file,
bool verify,
bool verify_checksum,
- std::string* error_msg) const OVERRIDE;
+ std::string* error_msg) const override;
// Opens .dex file that has been memory-mapped by the caller.
std::unique_ptr<const DexFile> Open(const std::string& location,
diff --git a/libdexfile/dex/art_dex_file_loader_test.cc b/libdexfile/dex/art_dex_file_loader_test.cc
index 3f311b7451..a7d03637b1 100644
--- a/libdexfile/dex/art_dex_file_loader_test.cc
+++ b/libdexfile/dex/art_dex_file_loader_test.cc
@@ -44,7 +44,7 @@ static void Copy(const std::string& src, const std::string& dst) {
}
class ArtDexFileLoaderTest : public CommonArtTest {
- void SetUp() OVERRIDE {
+ void SetUp() override {
CommonArtTest::SetUp();
// Open a jar file from the boot classpath for use in basic tests of dex accessors.
std::vector<std::string> lib_core_dex_file_names = GetLibCoreDexFileNames();
diff --git a/libdexfile/dex/compact_dex_file.h b/libdexfile/dex/compact_dex_file.h
index affc9a20b0..6db68c025d 100644
--- a/libdexfile/dex/compact_dex_file.h
+++ b/libdexfile/dex/compact_dex_file.h
@@ -253,15 +253,15 @@ class CompactDexFile : public DexFile {
// Returns true if the byte string points to the magic value.
static bool IsMagicValid(const uint8_t* magic);
- virtual bool IsMagicValid() const OVERRIDE;
+ virtual bool IsMagicValid() const override;
// Returns true if the byte string after the magic is the correct value.
static bool IsVersionValid(const uint8_t* magic);
- virtual bool IsVersionValid() const OVERRIDE;
+ virtual bool IsVersionValid() const override;
// TODO This is completely a guess. We really need to do better. b/72402467
// We ask for 64 megabytes which should be big enough for any realistic dex file.
- virtual size_t GetDequickenedSize() const OVERRIDE {
+ virtual size_t GetDequickenedSize() const override {
return 64 * MB;
}
@@ -269,9 +269,9 @@ class CompactDexFile : public DexFile {
return down_cast<const Header&>(DexFile::GetHeader());
}
- virtual bool SupportsDefaultMethods() const OVERRIDE;
+ virtual bool SupportsDefaultMethods() const override;
- uint32_t GetCodeItemSize(const DexFile::CodeItem& item) const OVERRIDE;
+ uint32_t GetCodeItemSize(const DexFile::CodeItem& item) const override;
uint32_t GetDebugInfoOffset(uint32_t dex_method_index) const {
return debug_info_offsets_.GetOffset(dex_method_index);
@@ -281,7 +281,7 @@ class CompactDexFile : public DexFile {
size_t base_size,
const uint8_t* data_begin,
size_t data_size);
- virtual uint32_t CalculateChecksum() const OVERRIDE;
+ virtual uint32_t CalculateChecksum() const override;
private:
CompactDexFile(const uint8_t* base,
diff --git a/libdexfile/dex/dex_file_loader.cc b/libdexfile/dex/dex_file_loader.cc
index 6d9ca4aafa..d9e483d643 100644
--- a/libdexfile/dex/dex_file_loader.cc
+++ b/libdexfile/dex/dex_file_loader.cc
@@ -36,21 +36,21 @@ namespace {
class VectorContainer : public DexFileContainer {
public:
explicit VectorContainer(std::vector<uint8_t>&& vector) : vector_(std::move(vector)) { }
- virtual ~VectorContainer() OVERRIDE { }
+ virtual ~VectorContainer() override { }
- int GetPermissions() OVERRIDE {
+ int GetPermissions() override {
return 0;
}
- bool IsReadOnly() OVERRIDE {
+ bool IsReadOnly() override {
return true;
}
- bool EnableWrite() OVERRIDE {
+ bool EnableWrite() override {
return false;
}
- bool DisableWrite() OVERRIDE {
+ bool DisableWrite() override {
return false;
}
diff --git a/libdexfile/dex/dex_instruction.h b/libdexfile/dex/dex_instruction.h
index 6807025e13..ad8a1842fc 100644
--- a/libdexfile/dex/dex_instruction.h
+++ b/libdexfile/dex/dex_instruction.h
@@ -708,12 +708,12 @@ class InstructionOperands {
// Class for accessing operands for instructions with a range format
// (e.g. 3rc and 4rcc).
-class RangeInstructionOperands FINAL : public InstructionOperands {
+class RangeInstructionOperands final : public InstructionOperands {
public:
RangeInstructionOperands(uint32_t first_operand, size_t num_operands)
: InstructionOperands(num_operands), first_operand_(first_operand) {}
~RangeInstructionOperands() {}
- uint32_t GetOperand(size_t operand_index) const OVERRIDE;
+ uint32_t GetOperand(size_t operand_index) const override;
private:
const uint32_t first_operand_;
@@ -723,13 +723,13 @@ class RangeInstructionOperands FINAL : public InstructionOperands {
// Class for accessing operands for instructions with a variable
// number of arguments format (e.g. 35c and 45cc).
-class VarArgsInstructionOperands FINAL : public InstructionOperands {
+class VarArgsInstructionOperands final : public InstructionOperands {
public:
VarArgsInstructionOperands(const uint32_t (&operands)[Instruction::kMaxVarArgRegs],
size_t num_operands)
: InstructionOperands(num_operands), operands_(operands) {}
~VarArgsInstructionOperands() {}
- uint32_t GetOperand(size_t operand_index) const OVERRIDE;
+ uint32_t GetOperand(size_t operand_index) const override;
private:
const uint32_t (&operands_)[Instruction::kMaxVarArgRegs];
@@ -739,12 +739,12 @@ class VarArgsInstructionOperands FINAL : public InstructionOperands {
// Class for accessing operands without the receiver by wrapping an
// existing InstructionOperands instance.
-class NoReceiverInstructionOperands FINAL : public InstructionOperands {
+class NoReceiverInstructionOperands final : public InstructionOperands {
public:
explicit NoReceiverInstructionOperands(const InstructionOperands* const inner)
: InstructionOperands(inner->GetNumberOfOperands() - 1), inner_(inner) {}
~NoReceiverInstructionOperands() {}
- uint32_t GetOperand(size_t operand_index) const OVERRIDE;
+ uint32_t GetOperand(size_t operand_index) const override;
private:
const InstructionOperands* const inner_;
diff --git a/libdexfile/dex/standard_dex_file.h b/libdexfile/dex/standard_dex_file.h
index 999e5b99e9..a2896353de 100644
--- a/libdexfile/dex/standard_dex_file.h
+++ b/libdexfile/dex/standard_dex_file.h
@@ -73,17 +73,17 @@ class StandardDexFile : public DexFile {
// Returns true if the byte string points to the magic value.
static bool IsMagicValid(const uint8_t* magic);
- virtual bool IsMagicValid() const OVERRIDE;
+ virtual bool IsMagicValid() const override;
// Returns true if the byte string after the magic is the correct value.
static bool IsVersionValid(const uint8_t* magic);
- virtual bool IsVersionValid() const OVERRIDE;
+ virtual bool IsVersionValid() const override;
- virtual bool SupportsDefaultMethods() const OVERRIDE;
+ virtual bool SupportsDefaultMethods() const override;
- uint32_t GetCodeItemSize(const DexFile::CodeItem& item) const OVERRIDE;
+ uint32_t GetCodeItemSize(const DexFile::CodeItem& item) const override;
- virtual size_t GetDequickenedSize() const OVERRIDE {
+ virtual size_t GetDequickenedSize() const override {
return Size();
}