ART: Introduce compiler data type.
Replace most uses of the runtime's Primitive in compiler
with a new class DataType. This prepares for introducing
new types, such as Uint8, that the runtime does not need
to know about.
Test: m test-art-host-gtest
Test: testrunner.py --host
Bug: 23964345
Change-Id: Iec2ad82454eec678fffcd8279a9746b90feb9b0c
diff --git a/runtime/primitive.cc b/runtime/primitive.cc
index 1ec345a..6f3571c 100644
--- a/runtime/primitive.cc
+++ b/runtime/primitive.cc
@@ -60,9 +60,9 @@
return kBoxedDescriptors[type];
}
-std::ostream& operator<<(std::ostream& os, const Primitive::Type& type) {
- int32_t int_type = static_cast<int32_t>(type);
- if (type >= Primitive::kPrimNot && type <= Primitive::kPrimVoid) {
+std::ostream& operator<<(std::ostream& os, Primitive::Type type) {
+ uint32_t int_type = static_cast<uint32_t>(type);
+ if (type <= Primitive::kPrimLast) {
os << kTypeNames[int_type];
} else {
os << "Type[" << int_type << "]";