diff options
Diffstat (limited to 'compiler/driver/compiler_options.h')
-rw-r--r-- | compiler/driver/compiler_options.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 77f84820e5..12fa251606 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -58,6 +58,12 @@ class CompilerOptions final { 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,27 +197,23 @@ class CompilerOptions final { // Are we compiling a boot image? bool IsBootImage() const { - return boot_image_; + return image_type_ == ImageType::kBootImage; } bool IsBaseline() const { return baseline_; } - // Are we compiling a core image (small boot image only used for ART testing)? - bool IsCoreImage() const { - // Ensure that `core_image_` => `boot_image_`. - DCHECK(!core_image_ || boot_image_); - return core_image_; - } - // Are we compiling an app image? bool IsAppImage() const { - return app_image_; + return image_type_ == ImageType::kAppImage; } - void DisableAppImage() { - app_image_ = false; + // Returns whether we are compiling against a "core" image, which + // is an indicative we are running tests. The compiler will use that + // information for checking invariants. + bool CompilingWithCoreImage() const { + return compiling_with_core_image_; } // Should the code be compiled as position independent? @@ -356,9 +358,8 @@ class CompilerOptions final { // 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 core_image_; - bool app_image_; + ImageType image_type_; + bool compiling_with_core_image_; bool baseline_; bool debuggable_; bool generate_debug_info_; |