[Lldb-commits] [PATCH] D155030: [lldb][NFCI] Avoid construction of temporary std::strings in RegisterValue

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 11 16:46:02 PDT 2023


bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, mib, 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/D155030

Files:
  lldb/source/Utility/RegisterValue.cpp


Index: lldb/source/Utility/RegisterValue.cpp
===================================================================
--- lldb/source/Utility/RegisterValue.cpp
+++ lldb/source/Utility/RegisterValue.cpp
@@ -342,9 +342,8 @@
       break;
     }
     if (value_str.getAsInteger(0, uval64)) {
-      error.SetErrorStringWithFormat(
-          "'%s' is not a valid unsigned integer string value",
-          value_str.str().c_str());
+      error.SetErrorStringWithFormatv(
+          "'{0}' is not a valid unsigned integer string value", value_str);
       break;
     }
 
@@ -371,9 +370,8 @@
     }
 
     if (value_str.getAsInteger(0, ival64)) {
-      error.SetErrorStringWithFormat(
-          "'%s' is not a valid signed integer string value",
-          value_str.str().c_str());
+      error.SetErrorStringWithFormatv(
+          "'{0}' is not a valid signed integer string value", value_str);
       break;
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155030.539340.patch
Type: text/x-patch
Size: 915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230711/b547c223/attachment-0001.bin>


More information about the lldb-commits mailing list