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/utils/assembler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/utils/assembler.h') diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h index 379a6396eb..251b82cb54 100644 --- a/compiler/utils/assembler.h +++ b/compiler/utils/assembler.h @@ -283,7 +283,7 @@ class AssemblerBuffer { // The purpose of this class is to ensure that we do not have to explicitly // call the AdvancePC method (which is good for convenience and correctness). -class DebugFrameOpCodeWriterForAssembler FINAL +class DebugFrameOpCodeWriterForAssembler final : public dwarf::DebugFrameOpCodeWriter<> { public: struct DelayedAdvancePC { @@ -292,7 +292,7 @@ class DebugFrameOpCodeWriterForAssembler FINAL }; // This method is called the by the opcode writers. - virtual void ImplicitlyAdvancePC() FINAL; + virtual void ImplicitlyAdvancePC() final; explicit DebugFrameOpCodeWriterForAssembler(Assembler* buffer) : dwarf::DebugFrameOpCodeWriter<>(false /* enabled */), -- cgit v1.2.3-59-g8ed1b From 625ca4759941299e8a9cc876c985558c4d76bdc0 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Fri, 24 Aug 2018 19:14:16 +0100 Subject: Remove 'virtual' and 'override' qualifiers on final methods. Cpplint considers that 'virtual' and 'override' qualifers are redundant for methods declared 'final'. Test: mmma art Change-Id: If4de1e1fe306f2ee3db9534930b1d24abeaf9fe4 --- compiler/optimizing/nodes.h | 12 ++++++------ compiler/utils/assembler.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'compiler/utils/assembler.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 748e21f510..5feffa0511 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2645,7 +2645,7 @@ class HExpression : public HInstruction { virtual ~HExpression() {} using HInstruction::GetInputRecords; // Keep the const version visible. - ArrayRef> GetInputRecords() override final { + ArrayRef> GetInputRecords() final { return ArrayRef>(inputs_); } @@ -2667,7 +2667,7 @@ class HExpression<0> : public HInstruction { virtual ~HExpression() {} using HInstruction::GetInputRecords; // Keep the const version visible. - ArrayRef> GetInputRecords() override final { + ArrayRef> GetInputRecords() final { return ArrayRef>(); } @@ -6311,7 +6311,7 @@ class HLoadClass final : public HInstruction { void AddSpecialInput(HInstruction* special_input); using HInstruction::GetInputRecords; // Keep the const version visible. - ArrayRef> GetInputRecords() override final { + ArrayRef> GetInputRecords() final { return ArrayRef>( &special_input_, (special_input_.GetInstruction() != nullptr) ? 1u : 0u); } @@ -6499,7 +6499,7 @@ class HLoadString final : public HInstruction { void AddSpecialInput(HInstruction* special_input); using HInstruction::GetInputRecords; // Keep the const version visible. - ArrayRef> GetInputRecords() override final { + ArrayRef> GetInputRecords() final { return ArrayRef>( &special_input_, (special_input_.GetInstruction() != nullptr) ? 1u : 0u); } @@ -6577,7 +6577,7 @@ class HLoadMethodHandle final : public HInstruction { } using HInstruction::GetInputRecords; // Keep the const version visible. - ArrayRef> GetInputRecords() override final { + ArrayRef> GetInputRecords() final { return ArrayRef>( &special_input_, (special_input_.GetInstruction() != nullptr) ? 1u : 0u); } @@ -6621,7 +6621,7 @@ class HLoadMethodType final : public HInstruction { } using HInstruction::GetInputRecords; // Keep the const version visible. - ArrayRef> GetInputRecords() override final { + ArrayRef> GetInputRecords() final { return ArrayRef>( &special_input_, (special_input_.GetInstruction() != nullptr) ? 1u : 0u); } diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h index 251b82cb54..096410de3e 100644 --- a/compiler/utils/assembler.h +++ b/compiler/utils/assembler.h @@ -292,7 +292,7 @@ class DebugFrameOpCodeWriterForAssembler final }; // This method is called the by the opcode writers. - virtual void ImplicitlyAdvancePC() final; + void ImplicitlyAdvancePC() final; explicit DebugFrameOpCodeWriterForAssembler(Assembler* buffer) : dwarf::DebugFrameOpCodeWriter<>(false /* enabled */), -- cgit v1.2.3-59-g8ed1b