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/runtime/runtime_callbacks_test.cc b/runtime/runtime_callbacks_test.cc
index ed0472f..e1e0e23 100644
--- a/runtime/runtime_callbacks_test.cc
+++ b/runtime/runtime_callbacks_test.cc
@@ -50,7 +50,7 @@
class RuntimeCallbacksTest : public CommonRuntimeTest {
protected:
- void SetUp() OVERRIDE {
+ void SetUp() override {
CommonRuntimeTest::SetUp();
Thread* self = Thread::Current();
@@ -60,7 +60,7 @@
AddListener();
}
- void TearDown() OVERRIDE {
+ void TearDown() override {
{
Thread* self = Thread::Current();
ScopedObjectAccess soa(self);
@@ -101,10 +101,10 @@
}
protected:
- void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void AddListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->AddThreadLifecycleCallback(&cb_);
}
- void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void RemoveListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->RemoveThreadLifecycleCallback(&cb_);
}
@@ -117,7 +117,7 @@
};
struct Callback : public ThreadLifecycleCallback {
- void ThreadStart(Thread* self) OVERRIDE {
+ void ThreadStart(Thread* self) override {
if (state == CallbackState::kBase) {
state = CallbackState::kStarted;
stored_self = self;
@@ -126,7 +126,7 @@
}
}
- void ThreadDeath(Thread* self) OVERRIDE {
+ void ThreadDeath(Thread* self) override {
if (state == CallbackState::kStarted && self == stored_self) {
state = CallbackState::kDied;
} else {
@@ -219,10 +219,10 @@
class ClassLoadCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest {
protected:
- void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void AddListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->AddClassLoadCallback(&cb_);
}
- void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void RemoveListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->RemoveClassLoadCallback(&cb_);
}
@@ -259,7 +259,7 @@
const DexFile::ClassDef& initial_class_def ATTRIBUTE_UNUSED,
/*out*/DexFile const** final_dex_file ATTRIBUTE_UNUSED,
/*out*/DexFile::ClassDef const** final_class_def ATTRIBUTE_UNUSED)
- OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) {
+ override REQUIRES_SHARED(Locks::mutator_lock_) {
const std::string& location = initial_dex_file.GetLocation();
std::string event =
std::string("PreDefine:") + descriptor + " <" +
@@ -267,14 +267,14 @@
data.push_back(event);
}
- void ClassLoad(Handle<mirror::Class> klass) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) {
+ void ClassLoad(Handle<mirror::Class> klass) override REQUIRES_SHARED(Locks::mutator_lock_) {
std::string tmp;
std::string event = std::string("Load:") + klass->GetDescriptor(&tmp);
data.push_back(event);
}
void ClassPrepare(Handle<mirror::Class> temp_klass,
- Handle<mirror::Class> klass) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) {
+ Handle<mirror::Class> klass) override REQUIRES_SHARED(Locks::mutator_lock_) {
std::string tmp, tmp2;
std::string event = std::string("Prepare:") + klass->GetDescriptor(&tmp)
+ "[" + temp_klass->GetDescriptor(&tmp2) + "]";
@@ -319,15 +319,15 @@
class RuntimeSigQuitCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest {
protected:
- void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void AddListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->AddRuntimeSigQuitCallback(&cb_);
}
- void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void RemoveListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->RemoveRuntimeSigQuitCallback(&cb_);
}
struct Callback : public RuntimeSigQuitCallback {
- void SigQuit() OVERRIDE {
+ void SigQuit() override {
++sigquit_count;
}
@@ -362,20 +362,20 @@
class RuntimePhaseCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest {
protected:
- void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void AddListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->AddRuntimePhaseCallback(&cb_);
}
- void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void RemoveListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->RemoveRuntimePhaseCallback(&cb_);
}
- void TearDown() OVERRIDE {
+ void TearDown() override {
// Bypass RuntimeCallbacksTest::TearDown, as the runtime is already gone.
CommonRuntimeTest::TearDown();
}
struct Callback : public RuntimePhaseCallback {
- void NextRuntimePhase(RuntimePhaseCallback::RuntimePhase p) OVERRIDE {
+ void NextRuntimePhase(RuntimePhaseCallback::RuntimePhase p) override {
if (p == RuntimePhaseCallback::RuntimePhase::kInitialAgents) {
if (start_seen > 0 || init_seen > 0 || death_seen > 0) {
LOG(FATAL) << "Unexpected order";
@@ -434,10 +434,10 @@
class MonitorWaitCallbacksTest : public RuntimeCallbacksTest {
protected:
- void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void AddListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->AddMonitorCallback(&cb_);
}
- void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) {
+ void RemoveListener() override REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetRuntimeCallbacks()->RemoveMonitorCallback(&cb_);
}