Refactor and clean up OatWriter and Dex2Oat.
This is in preparation for early writing of dex files
to oat file.
Change-Id: I31195f3c94eb8ff676c600c60bd35ae531f457b4
diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc
index b8610d0..f995cd7 100644
--- a/compiler/oat_test.cc
+++ b/compiler/oat_test.cc
@@ -157,14 +157,9 @@
elf_writer->EndText(text);
elf_writer->SetBssSize(oat_writer.GetBssSize());
-
elf_writer->WriteDynamicSection();
-
- ArrayRef<const dwarf::MethodDebugInfo> method_infos(oat_writer.GetMethodDebugInfo());
- elf_writer->WriteDebugInfo(method_infos);
-
- ArrayRef<const uintptr_t> patch_locations(oat_writer.GetAbsolutePatchLocations());
- elf_writer->WritePatchLocations(patch_locations);
+ elf_writer->WriteDebugInfo(oat_writer.GetMethodDebugInfo());
+ elf_writer->WritePatchLocations(oat_writer.GetAbsolutePatchLocations());
return elf_writer->End();
}
@@ -269,14 +264,9 @@
std::unique_ptr<const InstructionSetFeatures> insn_features(
InstructionSetFeatures::FromVariant(insn_set, "default", &error_msg));
ASSERT_TRUE(insn_features.get() != nullptr) << error_msg;
- std::vector<const DexFile*> dex_files;
- uint32_t image_file_location_oat_checksum = 0;
- uint32_t image_file_location_oat_begin = 0;
std::unique_ptr<OatHeader> oat_header(OatHeader::Create(insn_set,
insn_features.get(),
- &dex_files,
- image_file_location_oat_checksum,
- image_file_location_oat_begin,
+ 0u,
nullptr));
ASSERT_NE(oat_header.get(), nullptr);
ASSERT_TRUE(oat_header->IsValid());