summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2019-02-06 18:00:50 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-02-06 18:00:50 +0000
commit2f34e59c10c30ea24fa5f4bc4e3d5a9dc6469c34 (patch)
tree9360a99feb7a1aa6fe7b2685429ddb49b17a5e7c /compiler/driver/compiler_driver.cc
parentc66d6a7569ef72d9e9eb115bb7b663ccc8df5179 (diff)
parent7210108e6d930f9b8bcf5eac6b7a03ea29f92f84 (diff)
Merge changes I14c7cddd,I4a39d0e8,I3f24c8f4,I9699f138
* changes: Replace StringPiece with std::string_view in art/runtime/. Replace StringPiece with std::string_view in HashSet. Replace StringPiece with std::string_view in Signature. Replace StringPiece with std::string_view in class.h.
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index d46cffb1e8..56333b6d45 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -17,13 +17,15 @@
#include "compiler_driver.h"
#include <unistd.h>
-#include <unordered_set>
-#include <vector>
#ifndef __APPLE__
#include <malloc.h> // For mallinfo
#endif
+#include <string_view>
+#include <unordered_set>
+#include <vector>
+
#include "android-base/logging.h"
#include "android-base/strings.h"
@@ -35,6 +37,7 @@
#include "base/enums.h"
#include "base/logging.h" // For VLOG
#include "base/stl_util.h"
+#include "base/string_view_cpp20.h"
#include "base/systrace.h"
#include "base/time_utils.h"
#include "base/timing_logger.h"
@@ -1154,7 +1157,7 @@ static void MaybeAddToImageClasses(Thread* self,
const PointerSize pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
while (!klass->IsObjectClass()) {
const char* descriptor = klass->GetDescriptor(&temp);
- if (image_classes->find(StringPiece(descriptor)) != image_classes->end()) {
+ if (image_classes->find(std::string_view(descriptor)) != image_classes->end()) {
break; // Previously inserted.
}
image_classes->insert(descriptor);
@@ -1236,7 +1239,7 @@ class ClinitImageUpdate {
bool operator()(ObjPtr<mirror::Class> klass) override REQUIRES_SHARED(Locks::mutator_lock_) {
std::string temp;
- StringPiece name(klass->GetDescriptor(&temp));
+ std::string_view name(klass->GetDescriptor(&temp));
auto it = data_->image_class_descriptors_->find(name);
if (it != data_->image_class_descriptors_->end()) {
if (LIKELY(klass->IsResolved())) {
@@ -2226,7 +2229,7 @@ class InitializeClassVisitor : public CompilationVisitor {
// We need to initialize static fields, we only do this for image classes that aren't
// marked with the $NoPreloadHolder (which implies this should not be initialized
// early).
- can_init_static_fields = !StringPiece(descriptor).ends_with("$NoPreloadHolder;");
+ can_init_static_fields = !EndsWith(std::string_view(descriptor), "$NoPreloadHolder;");
} else {
CHECK(is_app_image);
// The boot image case doesn't need to recursively initialize the dependencies with