ART: Continue adding override annotations
Use Clang-tidy's modernize-use-override to add more annotations. Ignore
inferred annotations on destructors.
Bug: 32619234
Test: mmma art
Change-Id: Ic432c928e398d44df9171e42db04ee19946e6887
diff --git a/runtime/barrier_test.cc b/runtime/barrier_test.cc
index 88075ba..5ec24bc 100644
--- a/runtime/barrier_test.cc
+++ b/runtime/barrier_test.cc
@@ -32,7 +32,7 @@
count1_(count1),
count2_(count2) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
LOG(INFO) << "Before barrier" << *self;
++*count1_;
barrier_->Wait(self);
@@ -40,7 +40,7 @@
LOG(INFO) << "After barrier" << *self;
}
- virtual void Finalize() {
+ void Finalize() override {
delete this;
}
@@ -91,7 +91,7 @@
count_(count),
subtasks_(subtasks) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
for (size_t i = 0; i < subtasks_; ++i) {
++*count_;
// Pass through to next subtask.
@@ -99,7 +99,7 @@
}
}
- void Finalize() {
+ void Finalize() override {
delete this;
}
private:
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 511d468..b014e52 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1157,7 +1157,7 @@
VerifyDeclaringClassVisitor() REQUIRES_SHARED(Locks::mutator_lock_, Locks::heap_bitmap_lock_)
: live_bitmap_(Runtime::Current()->GetHeap()->GetLiveBitmap()) {}
- virtual void Visit(ArtMethod* method)
+ void Visit(ArtMethod* method) override
REQUIRES_SHARED(Locks::mutator_lock_, Locks::heap_bitmap_lock_) {
ObjPtr<mirror::Class> klass = method->GetDeclaringClassUnchecked();
if (klass != nullptr) {
@@ -1557,7 +1557,7 @@
public:
explicit VerifyClassInTableArtMethodVisitor(ClassTable* table) : table_(table) {}
- virtual void Visit(ArtMethod* method)
+ void Visit(ArtMethod* method) override
REQUIRES_SHARED(Locks::mutator_lock_, Locks::classlinker_classes_lock_) {
ObjPtr<mirror::Class> klass = method->GetDeclaringClass();
if (klass != nullptr && !Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(klass)) {
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 366b5ec..7103214 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -897,7 +897,7 @@
// TODO: Enable annotalysis. We know lock is held in constructor, but abstraction confuses
// annotalysis.
- bool VisitFrame() NO_THREAD_SAFETY_ANALYSIS {
+ bool VisitFrame() override NO_THREAD_SAFETY_ANALYSIS {
if (!GetMethod()->IsRuntimeMethod()) {
Monitor::VisitLocks(this, AppendOwnedMonitors, this);
++current_stack_depth;
@@ -2406,7 +2406,7 @@
// TODO: Enable annotalysis. We know lock is held in constructor, but abstraction confuses
// annotalysis.
- bool VisitFrame() NO_THREAD_SAFETY_ANALYSIS {
+ bool VisitFrame() override NO_THREAD_SAFETY_ANALYSIS {
if (!GetMethod()->IsRuntimeMethod()) {
++depth;
}
@@ -2576,7 +2576,7 @@
// TODO: Enable annotalysis. We know lock is held in constructor, but abstraction confuses
// annotalysis.
- virtual bool VisitFrame() NO_THREAD_SAFETY_ANALYSIS {
+ bool VisitFrame() override NO_THREAD_SAFETY_ANALYSIS {
if (frame_id != GetFrameId()) {
return true; // continue
} else {
@@ -2618,7 +2618,7 @@
// TODO: Enable annotalysis. We know lock is held in constructor, but abstraction confuses
// annotalysis.
- bool VisitFrame() NO_THREAD_SAFETY_ANALYSIS {
+ bool VisitFrame() override NO_THREAD_SAFETY_ANALYSIS {
if (GetFrameId() != frame_id_) {
return true; // Not our frame, carry on.
}
@@ -3831,7 +3831,7 @@
// TODO: Enable annotalysis. We know lock is held in constructor, but abstraction confuses
// annotalysis.
- bool VisitFrame() NO_THREAD_SAFETY_ANALYSIS {
+ bool VisitFrame() override NO_THREAD_SAFETY_ANALYSIS {
ArtMethod* m = GetMethod();
if (!m->IsRuntimeMethod()) {
++stack_depth;
diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc
index eede5a5..d91cc24 100644
--- a/runtime/gc/collector/concurrent_copying.cc
+++ b/runtime/gc/collector/concurrent_copying.cc
@@ -423,7 +423,7 @@
void VisitRoots(mirror::Object*** roots,
size_t count,
- const RootInfo& info ATTRIBUTE_UNUSED)
+ const RootInfo& info ATTRIBUTE_UNUSED) override
REQUIRES_SHARED(Locks::mutator_lock_) {
Thread* self = Thread::Current();
for (size_t i = 0; i < count; ++i) {
@@ -440,7 +440,7 @@
void VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
size_t count,
- const RootInfo& info ATTRIBUTE_UNUSED)
+ const RootInfo& info ATTRIBUTE_UNUSED) override
REQUIRES_SHARED(Locks::mutator_lock_) {
Thread* self = Thread::Current();
for (size_t i = 0; i < count; ++i) {
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index 23b2719..5f44a72 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -789,12 +789,12 @@
mark_stack_[mark_stack_pos_++].Assign(obj);
}
- virtual void Finalize() {
+ void Finalize() override {
delete this;
}
// Scans all of the objects
- virtual void Run(Thread* self ATTRIBUTE_UNUSED)
+ void Run(Thread* self ATTRIBUTE_UNUSED) override
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES_SHARED(Locks::mutator_lock_) {
ScanObjectParallelVisitor visitor(this);
@@ -852,11 +852,11 @@
const uint8_t minimum_age_;
const bool clear_card_;
- virtual void Finalize() {
+ void Finalize() override {
delete this;
}
- virtual void Run(Thread* self) NO_THREAD_SAFETY_ANALYSIS {
+ void Run(Thread* self) override NO_THREAD_SAFETY_ANALYSIS {
ScanObjectParallelVisitor visitor(this);
accounting::CardTable* card_table = mark_sweep_->GetHeap()->GetCardTable();
size_t cards_scanned = clear_card_
@@ -1009,12 +1009,12 @@
const uintptr_t begin_;
const uintptr_t end_;
- virtual void Finalize() {
+ void Finalize() override {
delete this;
}
// Scans all of the objects
- virtual void Run(Thread* self) NO_THREAD_SAFETY_ANALYSIS {
+ void Run(Thread* self) override NO_THREAD_SAFETY_ANALYSIS {
ScanObjectParallelVisitor visitor(this);
bitmap_->VisitMarkedRange(begin_, end_, visitor);
// Finish by emptying our local mark stack.
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index e76d35d..b6610b7 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2280,13 +2280,13 @@
}
}
- virtual bool ShouldSweepSpace(space::ContinuousSpace* space ATTRIBUTE_UNUSED) const {
+ bool ShouldSweepSpace(space::ContinuousSpace* space ATTRIBUTE_UNUSED) const override {
// Don't sweep any spaces since we probably blasted the internal accounting of the free list
// allocator.
return false;
}
- virtual mirror::Object* MarkNonForwardedObject(mirror::Object* obj)
+ mirror::Object* MarkNonForwardedObject(mirror::Object* obj) override
REQUIRES(Locks::heap_bitmap_lock_, Locks::mutator_lock_) {
size_t obj_size = obj->SizeOf<kDefaultVerifyFlags>();
size_t alloc_size = RoundUp(obj_size, kObjectAlignment);
diff --git a/runtime/gc/heap_test.cc b/runtime/gc/heap_test.cc
index 7cbad3b..05a04f2 100644
--- a/runtime/gc/heap_test.cc
+++ b/runtime/gc/heap_test.cc
@@ -96,7 +96,7 @@
}
class ZygoteHeapTest : public CommonRuntimeTest {
- void SetUpRuntimeOptions(RuntimeOptions* options) {
+ void SetUpRuntimeOptions(RuntimeOptions* options) override {
CommonRuntimeTest::SetUpRuntimeOptions(options);
options->push_back(std::make_pair("-Xzygote", nullptr));
}
diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc
index fe4124d..c212bad 100644
--- a/runtime/gc/reference_processor.cc
+++ b/runtime/gc/reference_processor.cc
@@ -276,7 +276,7 @@
explicit ClearedReferenceTask(jobject cleared_references)
: HeapTask(NanoTime()), cleared_references_(cleared_references) {
}
- virtual void Run(Thread* thread) {
+ void Run(Thread* thread) override {
ScopedObjectAccess soa(thread);
jvalue args[1];
args[0].l = cleared_references_;
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index 3999e27..b9c8e15 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -1099,7 +1099,7 @@
fixup_heap_objects_(fixup_heap_objects),
pointer_size_(pointer_size) {}
- virtual void Visit(ArtMethod* method) NO_THREAD_SAFETY_ANALYSIS {
+ void Visit(ArtMethod* method) override NO_THREAD_SAFETY_ANALYSIS {
// TODO: Separate visitor for runtime vs normal methods.
if (UNLIKELY(method->IsRuntimeMethod())) {
ImtConflictTable* table = method->GetImtConflictTable(pointer_size_);
@@ -1132,7 +1132,7 @@
template<typename... Args>
explicit FixupArtFieldVisitor(Args... args) : FixupVisitor(args...) {}
- virtual void Visit(ArtField* field) NO_THREAD_SAFETY_ANALYSIS {
+ void Visit(ArtField* field) override NO_THREAD_SAFETY_ANALYSIS {
field->UpdateObjects(ForwardObjectAdapter(this));
}
};
diff --git a/runtime/gc/space/large_object_space_test.cc b/runtime/gc/space/large_object_space_test.cc
index 9baa016..d55ccd6 100644
--- a/runtime/gc/space/large_object_space_test.cc
+++ b/runtime/gc/space/large_object_space_test.cc
@@ -128,7 +128,7 @@
AllocRaceTask(size_t id, size_t iterations, size_t size, LargeObjectSpace* los) :
id_(id), iterations_(iterations), size_(size), los_(los) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
for (size_t i = 0; i < iterations_ ; ++i) {
size_t alloc_size, bytes_tl_bulk_allocated;
mirror::Object* ptr = los_->Alloc(self, size_, &alloc_size, nullptr,
@@ -140,7 +140,7 @@
}
}
- virtual void Finalize() {
+ void Finalize() override {
delete this;
}
diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc
index b42433c..03fd964 100644
--- a/runtime/instrumentation.cc
+++ b/runtime/instrumentation.cc
@@ -1385,7 +1385,7 @@
: StackVisitor(thread, nullptr, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
shorty('V') {}
- bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) {
+ bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) {
ArtMethod* m = GetMethod();
if (m != nullptr && !m->IsRuntimeMethod()) {
// The first Java method.
diff --git a/runtime/jdwp/jdwp_adb.cc b/runtime/jdwp/jdwp_adb.cc
index 481aff9..e6043c6 100644
--- a/runtime/jdwp/jdwp_adb.cc
+++ b/runtime/jdwp/jdwp_adb.cc
@@ -87,13 +87,13 @@
}
}
- virtual bool Accept() REQUIRES(!state_lock_);
+ bool Accept() override REQUIRES(!state_lock_);
- virtual bool Establish(const JdwpOptions*) {
+ bool Establish(const JdwpOptions*) override {
return false;
}
- virtual void Shutdown() REQUIRES(!state_lock_) {
+ void Shutdown() override REQUIRES(!state_lock_) {
int control_sock;
int local_clientSock;
{
@@ -116,7 +116,7 @@
WakePipe();
}
- virtual bool ProcessIncoming() REQUIRES(!state_lock_);
+ bool ProcessIncoming() override REQUIRES(!state_lock_);
private:
int ReceiveClientFd() REQUIRES(!state_lock_);
diff --git a/runtime/jdwp/jdwp_socket.cc b/runtime/jdwp/jdwp_socket.cc
index 673a942..29fa160 100644
--- a/runtime/jdwp/jdwp_socket.cc
+++ b/runtime/jdwp/jdwp_socket.cc
@@ -54,10 +54,10 @@
remote_port_(0U) {
}
- virtual bool Accept();
- virtual bool Establish(const JdwpOptions*);
- virtual void Shutdown();
- virtual bool ProcessIncoming();
+ bool Accept() override;
+ bool Establish(const JdwpOptions*) override;
+ void Shutdown() override;
+ bool ProcessIncoming() override;
private:
in_addr remote_addr_;
diff --git a/runtime/jit/profile_saver.cc b/runtime/jit/profile_saver.cc
index d9ef922..9043f26 100644
--- a/runtime/jit/profile_saver.cc
+++ b/runtime/jit/profile_saver.cc
@@ -274,7 +274,7 @@
: profile_boot_class_path_(profile_boot_class_path),
out_(out) {}
- virtual bool operator()(ObjPtr<mirror::Class> klass) REQUIRES_SHARED(Locks::mutator_lock_) {
+ bool operator()(ObjPtr<mirror::Class> klass) override REQUIRES_SHARED(Locks::mutator_lock_) {
if (klass->IsProxyClass() ||
klass->IsArrayClass() ||
klass->IsPrimitive() ||
diff --git a/runtime/jni/java_vm_ext_test.cc b/runtime/jni/java_vm_ext_test.cc
index 4049c6e..dfe50cf 100644
--- a/runtime/jni/java_vm_ext_test.cc
+++ b/runtime/jni/java_vm_ext_test.cc
@@ -27,7 +27,7 @@
class JavaVmExtTest : public CommonRuntimeTest {
protected:
- virtual void SetUp() {
+ void SetUp() override {
CommonRuntimeTest::SetUp();
vm_ = Runtime::Current()->GetJavaVM();
diff --git a/runtime/jni/jni_internal_test.cc b/runtime/jni/jni_internal_test.cc
index 3040b90..4ad4c14 100644
--- a/runtime/jni/jni_internal_test.cc
+++ b/runtime/jni/jni_internal_test.cc
@@ -34,7 +34,7 @@
// TODO: Convert to CommonRuntimeTest. Currently MakeExecutable is used.
class JniInternalTest : public CommonCompilerTest {
protected:
- virtual void SetUp() {
+ void SetUp() override {
CommonCompilerTest::SetUp();
vm_ = Runtime::Current()->GetJavaVM();
diff --git a/runtime/monitor_test.cc b/runtime/monitor_test.cc
index c88748f..0b168f8 100644
--- a/runtime/monitor_test.cc
+++ b/runtime/monitor_test.cc
@@ -62,7 +62,7 @@
monitor_test_(monitor_test), initial_sleep_(initial_sleep), millis_(millis),
expected_(expected) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
{
ScopedObjectAccess soa(self);
@@ -118,7 +118,7 @@
}
}
- void Finalize() {
+ void Finalize() override {
delete this;
}
@@ -136,7 +136,7 @@
monitor_test_(monitor_test), initial_sleep_(initial_sleep), millis_(millis),
expected_(expected) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
monitor_test_->barrier_->Wait(self); // Wait for the other thread to set up the monitor.
{
@@ -158,7 +158,7 @@
monitor_test_->complete_barrier_->Wait(self); // Wait for test completion.
}
- void Finalize() {
+ void Finalize() override {
delete this;
}
@@ -174,7 +174,7 @@
InterruptTask(MonitorTest* monitor_test, uint64_t initial_sleep, uint64_t millis) :
monitor_test_(monitor_test), initial_sleep_(initial_sleep), millis_(millis) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
monitor_test_->barrier_->Wait(self); // Wait for the other thread to set up the monitor.
{
@@ -202,7 +202,7 @@
monitor_test_->complete_barrier_->Wait(self); // Wait for test completion.
}
- void Finalize() {
+ void Finalize() override {
delete this;
}
@@ -216,7 +216,7 @@
public:
explicit WatchdogTask(MonitorTest* monitor_test) : monitor_test_(monitor_test) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
ScopedObjectAccess soa(self);
monitor_test_->watchdog_object_.Get()->MonitorEnter(self); // Lock the object.
@@ -231,7 +231,7 @@
}
}
- void Finalize() {
+ void Finalize() override {
delete this;
}
@@ -326,14 +326,14 @@
public:
explicit TryLockTask(Handle<mirror::Object> obj) : obj_(obj) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
ScopedObjectAccess soa(self);
// Lock is held by other thread, try lock should fail.
ObjectTryLock<mirror::Object> lock(self, obj_);
EXPECT_FALSE(lock.Acquired());
}
- void Finalize() {
+ void Finalize() override {
delete this;
}
diff --git a/runtime/native/dalvik_system_VMStack.cc b/runtime/native/dalvik_system_VMStack.cc
index 3919227..e3932df 100644
--- a/runtime/native/dalvik_system_VMStack.cc
+++ b/runtime/native/dalvik_system_VMStack.cc
@@ -113,7 +113,7 @@
: StackVisitor(thread, nullptr, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
class_loader(nullptr) {}
- bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) {
+ bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) {
DCHECK(class_loader == nullptr);
ObjPtr<mirror::Class> c = GetMethod()->GetDeclaringClass();
// c is null for runtime methods.
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index 5a5fb16..f5039d1 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -62,7 +62,7 @@
caller(nullptr) {
}
- bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) {
+ bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) {
ArtMethod *m = GetMethod();
if (m == nullptr) {
// Attached native thread. Assume this is *not* boot class path.
diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc
index efdefb1..3a974df 100644
--- a/runtime/oat_file_assistant_test.cc
+++ b/runtime/oat_file_assistant_test.cc
@@ -1148,7 +1148,7 @@
loaded_oat_file_(nullptr)
{}
- void Run(Thread* self ATTRIBUTE_UNUSED) {
+ void Run(Thread* self ATTRIBUTE_UNUSED) override {
// Load the dex files, and save a pointer to the loaded oat file, so that
// we can verify only one oat file was loaded for the dex location.
std::vector<std::unique_ptr<const DexFile>> dex_files;
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc
index 7b92151..e882e73 100644
--- a/runtime/quick_exception_handler.cc
+++ b/runtime/quick_exception_handler.cc
@@ -165,7 +165,7 @@
CHECK_NE(frame_depth_, kInvalidFrameDepth);
}
- bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) {
+ bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) {
size_t current_frame_depth = GetFrameDepth();
if (current_frame_depth < frame_depth_) {
CHECK(GetMethod() != nullptr);
diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc
index 424ee06..00e298e 100644
--- a/runtime/reflection_test.cc
+++ b/runtime/reflection_test.cc
@@ -33,7 +33,7 @@
// TODO: Convert to CommonRuntimeTest. Currently MakeExecutable is used.
class ReflectionTest : public CommonCompilerTest {
protected:
- virtual void SetUp() {
+ void SetUp() override {
CommonCompilerTest::SetUp();
vm_ = Runtime::Current()->GetJavaVM();
@@ -73,7 +73,7 @@
}
}
- virtual void TearDown() {
+ void TearDown() override {
CleanUpJniEnv();
CommonCompilerTest::TearDown();
}
diff --git a/runtime/runtime_callbacks_test.cc b/runtime/runtime_callbacks_test.cc
index aaedb23..89f3124 100644
--- a/runtime/runtime_callbacks_test.cc
+++ b/runtime/runtime_callbacks_test.cc
@@ -458,20 +458,20 @@
ref_ = { &k->GetDexFile(), k->GetDexClassDefIndex() };
}
- void MonitorContendedLocking(Monitor* mon ATTRIBUTE_UNUSED)
+ void MonitorContendedLocking(Monitor* mon ATTRIBUTE_UNUSED) override
REQUIRES_SHARED(Locks::mutator_lock_) { }
- void MonitorContendedLocked(Monitor* mon ATTRIBUTE_UNUSED)
+ void MonitorContendedLocked(Monitor* mon ATTRIBUTE_UNUSED) override
REQUIRES_SHARED(Locks::mutator_lock_) { }
- void ObjectWaitStart(Handle<mirror::Object> obj, int64_t millis ATTRIBUTE_UNUSED)
+ void ObjectWaitStart(Handle<mirror::Object> obj, int64_t millis ATTRIBUTE_UNUSED) override
REQUIRES_SHARED(Locks::mutator_lock_) {
if (IsInterestingObject(obj.Get())) {
saw_wait_start_ = true;
}
}
- void MonitorWaitFinished(Monitor* m, bool timed_out ATTRIBUTE_UNUSED)
+ void MonitorWaitFinished(Monitor* m, bool timed_out ATTRIBUTE_UNUSED) override
REQUIRES_SHARED(Locks::mutator_lock_) {
if (IsInterestingObject(m->GetObject())) {
saw_wait_finished_ = true;
diff --git a/runtime/subtype_check_info_test.cc b/runtime/subtype_check_info_test.cc
index e40bca5..5323093 100644
--- a/runtime/subtype_check_info_test.cc
+++ b/runtime/subtype_check_info_test.cc
@@ -86,11 +86,11 @@
struct SubtypeCheckInfoTest : public ::testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
android::base::InitLogging(/*argv*/nullptr);
}
- virtual void TearDown() {
+ void TearDown() override {
}
static SubtypeCheckInfo MakeSubtypeCheckInfo(BitString path_to_root = {},
diff --git a/runtime/subtype_check_test.cc b/runtime/subtype_check_test.cc
index 666bf81..9aa3032 100644
--- a/runtime/subtype_check_test.cc
+++ b/runtime/subtype_check_test.cc
@@ -301,13 +301,13 @@
struct SubtypeCheckTest : public ::testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
android::base::InitLogging(/*argv*/nullptr);
CreateRootedTree(BitString::kCapacity + 2u, BitString::kCapacity + 2u);
}
- virtual void TearDown() {
+ void TearDown() override {
}
void CreateRootedTree(size_t width, size_t height) {
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 19fe4ea..8a8f537 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -2515,7 +2515,7 @@
saved_frames_(saved_frames),
max_saved_frames_(max_saved_frames) {}
- bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) {
+ bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) {
// We want to skip frames up to and including the exception's constructor.
// Note we also skip the frame if it doesn't have a method (namely the callee
// save frame)
@@ -2603,7 +2603,7 @@
self_->EndAssertNoThreadSuspension(nullptr);
}
- bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) {
+ bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) {
if (trace_ == nullptr) {
return true; // We're probably trying to fillInStackTrace for an OutOfMemoryError.
}
@@ -3520,7 +3520,7 @@
: StackVisitor(thread, context, StackVisitor::StackWalkKind::kSkipInlinedFrames),
visitor_(visitor) {}
- bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) {
+ bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) {
if (false) {
LOG(INFO) << "Visiting stack roots in " << ArtMethod::PrettyMethod(GetMethod())
<< StringPrintf("@ PC:%04x", GetDexPc());
diff --git a/runtime/thread_pool_test.cc b/runtime/thread_pool_test.cc
index d784200..2600f55 100644
--- a/runtime/thread_pool_test.cc
+++ b/runtime/thread_pool_test.cc
@@ -29,7 +29,7 @@
public:
explicit CountTask(AtomicInteger* count) : count_(count), verbose_(false) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
if (verbose_) {
LOG(INFO) << "Running: " << *self;
}
@@ -39,7 +39,7 @@
++*count_;
}
- void Finalize() {
+ void Finalize() override {
if (verbose_) {
LOG(INFO) << "Finalizing: " << *Thread::Current();
}
@@ -129,7 +129,7 @@
count_(count),
depth_(depth) {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
if (depth_ > 1) {
thread_pool_->AddTask(self, new TreeTask(thread_pool_, count_, depth_ - 1));
thread_pool_->AddTask(self, new TreeTask(thread_pool_, count_, depth_ - 1));
@@ -138,7 +138,7 @@
++*count_;
}
- void Finalize() {
+ void Finalize() override {
delete this;
}
@@ -164,12 +164,12 @@
public:
PeerTask() {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
ScopedObjectAccess soa(self);
CHECK(self->GetPeer() != nullptr);
}
- void Finalize() {
+ void Finalize() override {
delete this;
}
};
@@ -178,12 +178,12 @@
public:
NoPeerTask() {}
- void Run(Thread* self) {
+ void Run(Thread* self) override {
ScopedObjectAccess soa(self);
CHECK(self->GetPeer() == nullptr);
}
- void Finalize() {
+ void Finalize() override {
delete this;
}
};
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 949fabe..7e48bae 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -64,7 +64,7 @@
: StackVisitor(thread, nullptr, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
method_trace_(Trace::AllocStackTrace()) {}
- bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) {
+ bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) {
ArtMethod* m = GetMethod();
// Ignore runtime frames (in particular callee save).
if (!m->IsRuntimeMethod()) {