diff options
author | Kenny Root <kroot@google.com> | 2014-05-13 14:47:05 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2014-05-13 14:47:11 -0700 |
commit | d5185344e19d9feb7ac268369e0af6a467d1cb48 (patch) | |
tree | bf5e7174ff631a86b5776ff6ddfa0dfa9de810fb /dex2oat | |
parent | a47dcbf4bc226b5bbf30618fc052e7c79672af7a (diff) | |
download | art-d5185344e19d9feb7ac268369e0af6a467d1cb48.zip art-d5185344e19d9feb7ac268369e0af6a467d1cb48.tar.gz art-d5185344e19d9feb7ac268369e0af6a467d1cb48.tar.bz2 |
Changes for vogar compatibility
Make sure dex2oat can make an image with an empty list of image_classes.
Add in some checks to make sure that no bad arguments sneak into
CompilerDriver.
If we're not on the ART_TARGET, we should check for the "hostdex"
versions of the libraries to substitute in our libart version.
Change-Id: I5e8485c6089d25664492f0217b43ef64ca84c061
Diffstat (limited to 'dex2oat')
-rw-r--r-- | dex2oat/dex2oat.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index e0bfc6b..fe0ebf1 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -1139,21 +1139,23 @@ static int dex2oat(int argc, char** argv) { WellKnownClasses::Init(self->GetJniEnv()); // If --image-classes was specified, calculate the full list of classes to include in the image - UniquePtr<CompilerDriver::DescriptorSet> image_classes(NULL); - if (image_classes_filename != NULL) { + UniquePtr<CompilerDriver::DescriptorSet> image_classes(nullptr); + if (image_classes_filename != nullptr) { std::string error_msg; - if (image_classes_zip_filename != NULL) { + if (image_classes_zip_filename != nullptr) { image_classes.reset(dex2oat->ReadImageClassesFromZip(image_classes_zip_filename, image_classes_filename, &error_msg)); } else { image_classes.reset(dex2oat->ReadImageClassesFromFile(image_classes_filename)); } - if (image_classes.get() == NULL) { + if (image_classes.get() == nullptr) { LOG(ERROR) << "Failed to create list of image classes from '" << image_classes_filename << "': " << error_msg; return EXIT_FAILURE; } + } else if (image) { + image_classes.reset(new CompilerDriver::DescriptorSet); } std::vector<const DexFile*> dex_files; |