Tidy logging code not using UNIMPLEMENTED.
Change-Id: I7a79c1671a6ff8b2040887133b3e0925ef9a3cfe
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index 83da063..ad3bb11 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -813,6 +813,7 @@
break;
default:
LOG(FATAL) << "Unreachable";
+ UNREACHABLE();
}
TimingLogger::ScopedTiming t(name, GetTimings());
ScanObjectVisitor visitor(this);
diff --git a/runtime/gc/gc_cause.cc b/runtime/gc/gc_cause.cc
index f0e1512..6be683d 100644
--- a/runtime/gc/gc_cause.cc
+++ b/runtime/gc/gc_cause.cc
@@ -35,8 +35,8 @@
case kGcCauseTrim: return "HeapTrim";
default:
LOG(FATAL) << "Unreachable";
+ UNREACHABLE();
}
- return "";
}
std::ostream& operator<<(std::ostream& os, const GcCause& gc_cause) {
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index bceac44..c0008aa 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -1325,8 +1325,9 @@
// Throw OOM by default.
break;
default: {
- LOG(FATAL) << "Unimplemented homogeneous space compaction result "
- << static_cast<size_t>(result);
+ UNIMPLEMENTED(FATAL) << "homogeneous space compaction result: "
+ << static_cast<size_t>(result);
+ UNREACHABLE();
}
}
// Always print that we ran homogeneous space compation since this can cause jank.
@@ -1761,7 +1762,8 @@
break;
}
default: {
- LOG(FATAL) << "Unimplemented";
+ UNIMPLEMENTED(FATAL);
+ UNREACHABLE();
}
}
if (IsGcConcurrent()) {
diff --git a/runtime/gc/space/bump_pointer_space.cc b/runtime/gc/space/bump_pointer_space.cc
index 8f42642..0a55b52 100644
--- a/runtime/gc/space/bump_pointer_space.cc
+++ b/runtime/gc/space/bump_pointer_space.cc
@@ -201,8 +201,8 @@
}
accounting::ContinuousSpaceBitmap::SweepCallback* BumpPointerSpace::GetSweepCallback() {
- LOG(FATAL) << "Unimplemented";
- return nullptr;
+ UNIMPLEMENTED(FATAL);
+ UNREACHABLE();
}
uint64_t BumpPointerSpace::GetBytesAllocated() {
diff --git a/runtime/gc/space/space.cc b/runtime/gc/space/space.cc
index bff28f6..b233805 100644
--- a/runtime/gc/space/space.cc
+++ b/runtime/gc/space/space.cc
@@ -39,33 +39,33 @@
}
DlMallocSpace* Space::AsDlMallocSpace() {
- LOG(FATAL) << "Unreachable";
- return nullptr;
+ UNIMPLEMENTED(FATAL) << "Unreachable";
+ UNREACHABLE();
}
RosAllocSpace* Space::AsRosAllocSpace() {
- LOG(FATAL) << "Unreachable";
- return nullptr;
+ UNIMPLEMENTED(FATAL) << "Unreachable";
+ UNREACHABLE();
}
ZygoteSpace* Space::AsZygoteSpace() {
- LOG(FATAL) << "Unreachable";
- return nullptr;
+ UNIMPLEMENTED(FATAL) << "Unreachable";
+ UNREACHABLE();
}
BumpPointerSpace* Space::AsBumpPointerSpace() {
- LOG(FATAL) << "Unreachable";
- return nullptr;
+ UNIMPLEMENTED(FATAL) << "Unreachable";
+ UNREACHABLE();
}
AllocSpace* Space::AsAllocSpace() {
- LOG(FATAL) << "Unimplemented";
- return nullptr;
+ UNIMPLEMENTED(FATAL) << "Unreachable";
+ UNREACHABLE();
}
ContinuousMemMapAllocSpace* Space::AsContinuousMemMapAllocSpace() {
- LOG(FATAL) << "Unimplemented";
- return nullptr;
+ UNIMPLEMENTED(FATAL) << "Unreachable";
+ UNREACHABLE();
}
DiscontinuousSpace::DiscontinuousSpace(const std::string& name,
diff --git a/runtime/gc/space/zygote_space.cc b/runtime/gc/space/zygote_space.cc
index 51d84f5..9de0548 100644
--- a/runtime/gc/space/zygote_space.cc
+++ b/runtime/gc/space/zygote_space.cc
@@ -58,7 +58,8 @@
}
void ZygoteSpace::Clear() {
- LOG(FATAL) << "Unimplemented";
+ UNIMPLEMENTED(FATAL);
+ UNREACHABLE();
}
ZygoteSpace::ZygoteSpace(const std::string& name, MemMap* mem_map, size_t objects_allocated)