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

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 17 12:54:52 PDT 2023


Author: Alex Langford
Date: 2023-07-17T12:53:34-07:00
New Revision: 1b29a848ffa2d2c108de9e64de1d271e10db25f0

URL: https://github.com/llvm/llvm-project/commit/1b29a848ffa2d2c108de9e64de1d271e10db25f0
DIFF: https://github.com/llvm/llvm-project/commit/1b29a848ffa2d2c108de9e64de1d271e10db25f0.diff

LOG: [lldb][NFCI] Avoid construction of temporary std::strings in RegisterValue

Differential Revision: https://reviews.llvm.org/D155030

Added: 
    

Modified: 
    lldb/source/Utility/RegisterValue.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Utility/RegisterValue.cpp b/lldb/source/Utility/RegisterValue.cpp
index 9563599df16280..fa92ba8a8f9236 100644
--- a/lldb/source/Utility/RegisterValue.cpp
+++ b/lldb/source/Utility/RegisterValue.cpp
@@ -342,9 +342,8 @@ Status RegisterValue::SetValueFromString(const RegisterInfo *reg_info,
       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 @@ Status RegisterValue::SetValueFromString(const RegisterInfo *reg_info,
     }
 
     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;
     }
 


        


More information about the lldb-commits mailing list