[Lldb-commits] [lldb] [lldb] Use Locale to convert between std::wstring and std::string (NFC) (PR #112582)

via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 16 10:11:33 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 92ad0397f494a9895385057586cc59a908107f81 de1a1c4cfb5a8c3fc47194275fcc8fc48b7cbbf9 --extensions h,cpp -- lldb/include/lldb/Host/Editline.h lldb/source/Host/common/Editline.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp
index 99a5003e7a..aec8098c5f 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -724,8 +724,7 @@ unsigned char Editline::EndOrAddLineCommand(int ch) {
       m_input_lines.clear();
       for (unsigned index = 0; index < lines.GetSize(); index++) {
 #if LLDB_EDITLINE_USE_WCHAR
-        m_input_lines.insert(m_input_lines.end(),
-                             FromBytes(lines[index]));
+        m_input_lines.insert(m_input_lines.end(), FromBytes(lines[index]));
 #else
         m_input_lines.insert(m_input_lines.end(), lines[index]);
 #endif
@@ -1615,7 +1614,8 @@ bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {
   return true;
 #else
   std::locale locale("C.UTF-8");
-  const auto &cvt = std::use_facet<std::codecvt<wchar_t, char, std::mbstate_t>>(locale);
+  const auto &cvt =
+      std::use_facet<std::codecvt<wchar_t, char, std::mbstate_t>>(locale);
   llvm::SmallString<4> input;
   for (;;) {
     const char *from_next;

``````````

</details>


https://github.com/llvm/llvm-project/pull/112582


More information about the lldb-commits mailing list