Rewrite image type in CompilerOptions.
Prepare for introduction of boot image extension.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Change-Id: Id007c4aeb4ada84fe65c1148fdf67e8a412e5b74
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index 2f4e542..12fa251 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -58,6 +58,12 @@
static const size_t kDefaultInlineMaxCodeUnits = 32;
static constexpr size_t kUnsetInlineMaxCodeUnits = -1;
+ enum class ImageType : uint8_t {
+ kNone, // JIT or AOT app compilation producing only an oat file but no image.
+ kBootImage, // Creating boot image.
+ kAppImage, // Creating app image.
+ };
+
CompilerOptions();
~CompilerOptions();
@@ -191,7 +197,7 @@
// Are we compiling a boot image?
bool IsBootImage() const {
- return boot_image_;
+ return image_type_ == ImageType::kBootImage;
}
bool IsBaseline() const {
@@ -200,11 +206,7 @@
// Are we compiling an app image?
bool IsAppImage() const {
- return app_image_;
- }
-
- void DisableAppImage() {
- app_image_ = false;
+ return image_type_ == ImageType::kAppImage;
}
// Returns whether we are compiling against a "core" image, which
@@ -356,8 +358,7 @@
// Must not be empty for real boot image, only for tests pretending to compile boot image.
HashSet<std::string> image_classes_;
- bool boot_image_;
- bool app_image_;
+ ImageType image_type_;
bool compiling_with_core_image_;
bool baseline_;
bool debuggable_;