diff options
author | 2019-02-06 15:54:55 +0000 | |
---|---|---|
committer | 2019-02-07 14:13:58 +0000 | |
commit | 8581e2a234b562880c1d6c6b5ad14d23f7b597ed (patch) | |
tree | 460059a1717d7507fa2854c3d458ce0250ba2bbd /compiler/jit/jit_compiler.cc | |
parent | e512556ab85987c52e4be1fcd6d7a1d15a1b0fb6 (diff) |
Replace StringPiece with std::string_view.
This replaces the last few StringPiece uses and removes
the stringpiece.h.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 123750182
Change-Id: I1bb5d05df47319b6ca386db01e14ce048ae54daf
Diffstat (limited to 'compiler/jit/jit_compiler.cc')
-rw-r--r-- | compiler/jit/jit_compiler.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index 4d7ae9bd1b..2c20b3224e 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -22,7 +22,7 @@ #include "arch/instruction_set_features.h" #include "art_method-inl.h" #include "base/logging.h" // For VLOG -#include "base/stringpiece.h" +#include "base/string_view_cpp20.h" #include "base/systrace.h" #include "base/time_utils.h" #include "base/timing_logger.h" @@ -71,19 +71,19 @@ void JitCompiler::ParseCompilerOptions() { DCHECK_EQ(instruction_set, kRuntimeISA); } std::unique_ptr<const InstructionSetFeatures> instruction_set_features; - for (const StringPiece option : runtime->GetCompilerOptions()) { + for (const std::string& option : runtime->GetCompilerOptions()) { VLOG(compiler) << "JIT compiler option " << option; std::string error_msg; - if (option.starts_with("--instruction-set-variant=")) { - StringPiece str = option.substr(strlen("--instruction-set-variant=")).data(); + if (StartsWith(option, "--instruction-set-variant=")) { + const char* str = option.c_str() + strlen("--instruction-set-variant="); VLOG(compiler) << "JIT instruction set variant " << str; instruction_set_features = InstructionSetFeatures::FromVariant( - instruction_set, str.as_string(), &error_msg); + instruction_set, str, &error_msg); if (instruction_set_features == nullptr) { LOG(WARNING) << "Error parsing " << option << " message=" << error_msg; } - } else if (option.starts_with("--instruction-set-features=")) { - StringPiece str = option.substr(strlen("--instruction-set-features=")).data(); + } else if (StartsWith(option, "--instruction-set-features=")) { + const char* str = option.c_str() + strlen("--instruction-set-features="); VLOG(compiler) << "JIT instruction set features " << str; if (instruction_set_features == nullptr) { instruction_set_features = InstructionSetFeatures::FromVariant( @@ -93,7 +93,7 @@ void JitCompiler::ParseCompilerOptions() { } } instruction_set_features = - instruction_set_features->AddFeaturesFromString(str.as_string(), &error_msg); + instruction_set_features->AddFeaturesFromString(str, &error_msg); if (instruction_set_features == nullptr) { LOG(WARNING) << "Error parsing " << option << " message=" << error_msg; } |