summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_options.cc
diff options
context:
space:
mode:
authorRichard Uhler <ruhler@google.com>2016-03-18 15:05:30 -0700
committerRichard Uhler <ruhler@google.com>2016-03-22 15:38:36 -0700
commita62d2f04a6ecf804f8a78e722a6ca8ccb2dfa931 (patch)
treed8624bb85016a3301b473b6503324db4d4cf24a3 /compiler/driver/compiler_options.cc
parent48e722432bb6e19df7bba02427e4a707e671af06 (diff)
Use compiler filter to determine oat file status.
Record the compiler filter in the oat header. Use that to determine when the oat file is up-to-date with respect to a target compiler filter level. New xxx-profile filter levels are added to specify if a profile should be used instead of testing for the presence of a profile file. This change should allow for different compiler-filters to be set for different package manager use cases. Bug: 27689078 Change-Id: Id6706d0ed91b45f307142692ea4316aa9713b023
Diffstat (limited to 'compiler/driver/compiler_options.cc')
-rw-r--r--compiler/driver/compiler_options.cc22
1 files changed, 2 insertions, 20 deletions
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc
index f5969aa825..1bd4c3ad80 100644
--- a/compiler/driver/compiler_options.cc
+++ b/compiler/driver/compiler_options.cc
@@ -52,7 +52,7 @@ CompilerOptions::~CompilerOptions() {
// because we don't want to include the PassManagerOptions definition from the header file.
}
-CompilerOptions::CompilerOptions(CompilerFilter compiler_filter,
+CompilerOptions::CompilerOptions(CompilerFilter::Filter compiler_filter,
size_t huge_method_threshold,
size_t large_method_threshold,
size_t small_method_threshold,
@@ -147,25 +147,7 @@ void CompilerOptions::ParseDumpInitFailures(const StringPiece& option,
bool CompilerOptions::ParseCompilerOption(const StringPiece& option, UsageFn Usage) {
if (option.starts_with("--compiler-filter=")) {
const char* compiler_filter_string = option.substr(strlen("--compiler-filter=")).data();
- if (strcmp(compiler_filter_string, "verify-none") == 0) {
- compiler_filter_ = CompilerOptions::kVerifyNone;
- } else if (strcmp(compiler_filter_string, "interpret-only") == 0) {
- compiler_filter_ = CompilerOptions::kInterpretOnly;
- } else if (strcmp(compiler_filter_string, "verify-at-runtime") == 0) {
- compiler_filter_ = CompilerOptions::kVerifyAtRuntime;
- } else if (strcmp(compiler_filter_string, "space") == 0) {
- compiler_filter_ = CompilerOptions::kSpace;
- } else if (strcmp(compiler_filter_string, "balanced") == 0) {
- compiler_filter_ = CompilerOptions::kBalanced;
- } else if (strcmp(compiler_filter_string, "speed") == 0) {
- compiler_filter_ = CompilerOptions::kSpeed;
- } else if (strcmp(compiler_filter_string, "everything") == 0) {
- compiler_filter_ = CompilerOptions::kEverything;
- } else if (strcmp(compiler_filter_string, "time") == 0) {
- compiler_filter_ = CompilerOptions::kTime;
- } else if (strcmp(compiler_filter_string, "verify-profile") == 0) {
- compiler_filter_ = CompilerOptions::kVerifyProfile;
- } else {
+ if (!CompilerFilter::ParseCompilerFilter(compiler_filter_string, &compiler_filter_)) {
Usage("Unknown --compiler-filter value %s", compiler_filter_string);
}
} else if (option == "--compile-pic") {