From a5b09a67034e57a6e10231dd4bd92f4cb50b824c Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 17 Nov 2016 15:21:22 -0800 Subject: ART: Add dex::TypeIndex Add abstraction for uint16_t type index. Test: m test-art-host Change-Id: I47708741c7c579cbbe59ab723c1e31c5fe71f83a --- compiler/utils/test_dex_file_builder_test.cc | 3 ++- compiler/utils/type_reference.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'compiler/utils') diff --git a/compiler/utils/test_dex_file_builder_test.cc b/compiler/utils/test_dex_file_builder_test.cc index da4ac798c7..922f8b1dfa 100644 --- a/compiler/utils/test_dex_file_builder_test.cc +++ b/compiler/utils/test_dex_file_builder_test.cc @@ -62,7 +62,8 @@ TEST(TestDexFileBuilderTest, SimpleTest) { }; ASSERT_EQ(arraysize(expected_types), dex_file->NumTypeIds()); for (size_t i = 0; i != arraysize(expected_types); ++i) { - EXPECT_STREQ(expected_types[i], dex_file->GetTypeDescriptor(dex_file->GetTypeId(i))) << i; + EXPECT_STREQ(expected_types[i], + dex_file->GetTypeDescriptor(dex_file->GetTypeId(dex::TypeIndex(i)))) << i; } ASSERT_EQ(1u, dex_file->NumFieldIds()); diff --git a/compiler/utils/type_reference.h b/compiler/utils/type_reference.h index d0c1656836..a0fa1a4a63 100644 --- a/compiler/utils/type_reference.h +++ b/compiler/utils/type_reference.h @@ -20,6 +20,7 @@ #include #include "base/logging.h" +#include "dex_file_types.h" #include "string_reference.h" namespace art { @@ -28,10 +29,10 @@ class DexFile; // A type is located by its DexFile and the string_ids_ table index into that DexFile. struct TypeReference { - TypeReference(const DexFile* file, uint32_t index) : dex_file(file), type_index(index) { } + TypeReference(const DexFile* file, dex::TypeIndex index) : dex_file(file), type_index(index) { } const DexFile* dex_file; - uint32_t type_index; + dex::TypeIndex type_index; }; // Compare the actual referenced type names. Used for type reference deduplication. -- cgit v1.2.3-59-g8ed1b