[Lldb-commits] [PATCH] D158026: [lldb][NFCI] Remove unneeded ConstString from ValueObject::GetValueForExpressionPath_Impl

2023-08-17 Thread Alex Langford via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3415798f7993: [lldb][NFCI] Remove unneeded ConstString from 
ValueObject… (authored by bulbazord).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158026/new/

https://reviews.llvm.org/D158026

Files:
  lldb/source/Core/ValueObject.cpp


Index: lldb/source/Core/ValueObject.cpp
===
--- lldb/source/Core/ValueObject.cpp
+++ lldb/source/Core/ValueObject.cpp
@@ -2131,11 +2131,10 @@
   temp_expression = temp_expression.drop_front(); // skip . or >
 
   size_t next_sep_pos = temp_expression.find_first_of("-.[", 1);
-  ConstString child_name;
   if (next_sep_pos == llvm::StringRef::npos) // if no other separator just
  // expand this last layer
   {
-child_name.SetString(temp_expression);
+llvm::StringRef child_name = temp_expression;
 ValueObjectSP child_valobj_sp =
 root->GetChildMemberWithName(child_name);
 
@@ -2203,8 +2202,7 @@
   } else // other layers do expand
   {
 llvm::StringRef next_separator = temp_expression.substr(next_sep_pos);
-
-child_name.SetString(temp_expression.slice(0, next_sep_pos));
+llvm::StringRef child_name = temp_expression.slice(0, next_sep_pos);
 
 ValueObjectSP child_valobj_sp =
 root->GetChildMemberWithName(child_name);


Index: lldb/source/Core/ValueObject.cpp
===
--- lldb/source/Core/ValueObject.cpp
+++ lldb/source/Core/ValueObject.cpp
@@ -2131,11 +2131,10 @@
   temp_expression = temp_expression.drop_front(); // skip . or >
 
   size_t next_sep_pos = temp_expression.find_first_of("-.[", 1);
-  ConstString child_name;
   if (next_sep_pos == llvm::StringRef::npos) // if no other separator just
  // expand this last layer
   {
-child_name.SetString(temp_expression);
+llvm::StringRef child_name = temp_expression;
 ValueObjectSP child_valobj_sp =
 root->GetChildMemberWithName(child_name);
 
@@ -2203,8 +2202,7 @@
   } else // other layers do expand
   {
 llvm::StringRef next_separator = temp_expression.substr(next_sep_pos);
-
-child_name.SetString(temp_expression.slice(0, next_sep_pos));
+llvm::StringRef child_name = temp_expression.slice(0, next_sep_pos);
 
 ValueObjectSP child_valobj_sp =
 root->GetChildMemberWithName(child_name);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D158026: [lldb][NFCI] Remove unneeded ConstString from ValueObject::GetValueForExpressionPath_Impl

2023-08-15 Thread Alex Langford via Phabricator via lldb-commits
bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, mib, kastiglione, jingham.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158026

Files:
  lldb/source/Core/ValueObject.cpp


Index: lldb/source/Core/ValueObject.cpp
===
--- lldb/source/Core/ValueObject.cpp
+++ lldb/source/Core/ValueObject.cpp
@@ -2148,11 +2148,10 @@
   temp_expression = temp_expression.drop_front(); // skip . or >
 
   size_t next_sep_pos = temp_expression.find_first_of("-.[", 1);
-  ConstString child_name;
   if (next_sep_pos == llvm::StringRef::npos) // if no other separator just
  // expand this last layer
   {
-child_name.SetString(temp_expression);
+llvm::StringRef child_name = temp_expression;
 ValueObjectSP child_valobj_sp =
 root->GetChildMemberWithName(child_name);
 
@@ -2220,8 +2219,7 @@
   } else // other layers do expand
   {
 llvm::StringRef next_separator = temp_expression.substr(next_sep_pos);
-
-child_name.SetString(temp_expression.slice(0, next_sep_pos));
+llvm::StringRef child_name = temp_expression.slice(0, next_sep_pos);
 
 ValueObjectSP child_valobj_sp =
 root->GetChildMemberWithName(child_name);


Index: lldb/source/Core/ValueObject.cpp
===
--- lldb/source/Core/ValueObject.cpp
+++ lldb/source/Core/ValueObject.cpp
@@ -2148,11 +2148,10 @@
   temp_expression = temp_expression.drop_front(); // skip . or >
 
   size_t next_sep_pos = temp_expression.find_first_of("-.[", 1);
-  ConstString child_name;
   if (next_sep_pos == llvm::StringRef::npos) // if no other separator just
  // expand this last layer
   {
-child_name.SetString(temp_expression);
+llvm::StringRef child_name = temp_expression;
 ValueObjectSP child_valobj_sp =
 root->GetChildMemberWithName(child_name);
 
@@ -2220,8 +2219,7 @@
   } else // other layers do expand
   {
 llvm::StringRef next_separator = temp_expression.substr(next_sep_pos);
-
-child_name.SetString(temp_expression.slice(0, next_sep_pos));
+llvm::StringRef child_name = temp_expression.slice(0, next_sep_pos);
 
 ValueObjectSP child_valobj_sp =
 root->GetChildMemberWithName(child_name);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits