Enable -Wunreachable-code
Caught bugs in DeoptimizeStackVisitor and assemble_x86 SIB encoding.
Add UNREACHABLE macro to document code expected to be unreachable.
Bug: 17731047
Change-Id: I2e363fe5b38a1246354d98be18c902a6031c0b9e
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index cc77c50..2cf3820 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2269,9 +2269,7 @@
return soa.Decode<mirror::Class*>(result.get());
}
}
-
- ThrowNoClassDefFoundError("Class %s not found", PrintableString(descriptor).c_str());
- return nullptr;
+ UNREACHABLE();
}
mirror::Class* ClassLinker::DefineClass(Thread* self, const char* descriptor,
@@ -4340,7 +4338,7 @@
LOG(FATAL) << "Unexpected class status. " << PrettyClass(klass.Get()) << " is "
<< klass->GetStatus();
}
- LOG(FATAL) << "Not Reached" << PrettyClass(klass.Get());
+ UNREACHABLE();
}
bool ClassLinker::ValidateSuperClassDescriptors(Handle<mirror::Class> klass) {