[Lldb-commits] [lldb] [lldb] Nits on uses of llvm::raw_string_ostream (NFC) (PR #108745)

2024-09-15 Thread Youngsuk Kim via lldb-commits

https://github.com/JOE1994 closed 
https://github.com/llvm/llvm-project/pull/108745
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Nits on uses of llvm::raw_string_ostream (NFC) (PR #108745)

2024-09-15 Thread Youngsuk Kim via lldb-commits

https://github.com/JOE1994 edited 
https://github.com/llvm/llvm-project/pull/108745
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Nits on uses of llvm::raw_string_ostream (NFC) (PR #108745)

2024-09-15 Thread Youngsuk Kim via lldb-commits

https://github.com/JOE1994 edited 
https://github.com/llvm/llvm-project/pull/108745
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Nits on uses of llvm::raw_string_ostream (NFC) (PR #108745)

2024-09-15 Thread Youngsuk Kim via lldb-commits

https://github.com/JOE1994 edited 
https://github.com/llvm/llvm-project/pull/108745
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Nits on uses of llvm::raw_string_ostream (NFC) (PR #108745)

2024-09-15 Thread Youngsuk Kim via lldb-commits

https://github.com/JOE1994 created 
https://github.com/llvm/llvm-project/pull/108745

* Don't call raw_string_ostream::flush(), which is essentially a no-op.
* Avoid unneeded calls to raw_string_ostream::str(), to avoid excess 
indirection.

>From 35f463d394ec57a38a4e940a61af5cd1f527a00d Mon Sep 17 00:00:00 2001
From: JOE1994 
Date: Sun, 15 Sep 2024 05:16:25 -0400
Subject: [PATCH] [lldb] Nits on uses of llvm::raw_string_ostream (NFC)

* Don't call raw_string_ostream::flush(), which is essentially a no-op.
* Avoid unneeded calls to raw_string_ostream::str(), to avoid excess 
indirection.
---
 lldb/include/lldb/Utility/Instrumentation.h  | 2 +-
 lldb/source/Breakpoint/Breakpoint.cpp| 2 +-
 lldb/source/Commands/CommandObjectLog.cpp| 8 
 lldb/source/Commands/CommandObjectRegexCommand.cpp   | 2 +-
 lldb/source/Core/Module.cpp  | 4 ++--
 lldb/source/Expression/IRExecutionUnit.cpp   | 2 --
 lldb/source/Expression/IRInterpreter.cpp | 4 
 lldb/source/Host/windows/PipeWindows.cpp | 1 -
 lldb/source/Interpreter/Options.cpp  | 2 +-
 .../Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp | 2 --
 .../ExpressionParser/Clang/ClangExpressionParser.cpp | 2 --
 .../ExpressionParser/Clang/ClangModulesDeclVendor.cpp| 1 -
 .../Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp   | 3 ---
 .../Plugins/ExpressionParser/Clang/IRForTarget.cpp   | 9 -
 .../ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp | 2 +-
 .../Process/Windows/Common/NativeProcessWindows.cpp  | 2 +-
 .../Plugins/Process/Windows/Common/ProcessWindows.cpp| 6 +++---
 .../Process/gdb-remote/GDBRemoteCommunicationClient.cpp  | 5 +
 .../Plugins/Process/gdb-remote/ProcessGDBRemote.cpp  | 2 +-
 lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp | 4 ++--
 .../Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp| 2 +-
 .../source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp | 2 +-
 .../Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp  | 2 +-
 lldb/source/Symbol/Symtab.cpp| 2 +-
 lldb/source/Target/Statistics.cpp| 2 +-
 lldb/source/Target/Target.cpp| 2 +-
 lldb/source/Utility/LLDBAssert.cpp   | 2 +-
 lldb/source/Utility/Log.cpp  | 2 +-
 lldb/tools/lldb-dap/DAP.cpp  | 6 ++
 lldb/tools/lldb-dap/JSONUtils.cpp| 1 -
 lldb/tools/lldb-dap/LLDBUtils.cpp| 1 -
 lldb/tools/lldb-dap/lldb-dap.cpp | 3 ---
 lldb/tools/lldb-instr/Instrument.cpp | 4 ++--
 lldb/tools/lldb-server/LLDBServerUtilities.cpp   | 2 +-
 lldb/tools/lldb-test/lldb-test.cpp   | 2 +-
 lldb/unittests/Symbol/PostfixExpressionTest.cpp  | 2 +-
 .../NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp| 2 +-
 37 files changed, 35 insertions(+), 69 deletions(-)

diff --git a/lldb/include/lldb/Utility/Instrumentation.h 
b/lldb/include/lldb/Utility/Instrumentation.h
index 4a9ac810eb05e9..1a86bfb38654b5 100644
--- a/lldb/include/lldb/Utility/Instrumentation.h
+++ b/lldb/include/lldb/Utility/Instrumentation.h
@@ -70,7 +70,7 @@ template  inline std::string 
stringify_args(const Ts &...ts) {
   std::string buffer;
   llvm::raw_string_ostream ss(buffer);
   stringify_helper(ss, ts...);
-  return ss.str();
+  return buffer;
 }
 
 /// RAII object for instrumenting LLDB API functions.
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp 
b/lldb/source/Breakpoint/Breakpoint.cpp
index 3268ce0b6857da..54ebafc3f65b5c 100644
--- a/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/lldb/source/Breakpoint/Breakpoint.cpp
@@ -1127,7 +1127,7 @@ json::Value Breakpoint::GetStatistics() {
 llvm::raw_string_ostream ss(buffer);
 json::OStream json_os(ss);
 bp_data_sp->Serialize(json_os);
-if (auto expected_value = llvm::json::parse(ss.str())) {
+if (auto expected_value = llvm::json::parse(buffer)) {
   bp.try_emplace("details", std::move(*expected_value));
 } else {
   std::string details_error = toString(expected_value.takeError());
diff --git a/lldb/source/Commands/CommandObjectLog.cpp 
b/lldb/source/Commands/CommandObjectLog.cpp
index 9eb68ddb73b6e9..5fb2dfaab8de03 100644
--- a/lldb/source/Commands/CommandObjectLog.cpp
+++ b/lldb/source/Commands/CommandObjectLog.cpp
@@ -204,7 +204,7 @@ class CommandObjectLogEnable : public CommandObjectParsed {
 channel, args.GetArgumentArrayRef(), log_file, m_options.log_options,
 m_options.buffer_size.GetCurrentValue(), m_options.handler,
 error_stream);
-result.GetErrorStream() << error_stream.str();
+result.GetErrorStream() << error;
 
 if (success)
   result.SetStatus(eReturnStatusSuccessFinishNoResult);
@@ -273,7 +273,7 @@ class CommandObjectLogDisable : pu

[Lldb-commits] [lldb] [llvm] Use StringRef::starts_with (NFC) (PR #94112)

2024-06-01 Thread Youngsuk Kim via lldb-commits

https://github.com/JOE1994 approved this pull request.


https://github.com/llvm/llvm-project/pull/94112
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [lldb] Refactor string manipulation in Debugger.cpp (#91209) (PR #91880)

2024-05-17 Thread Youngsuk Kim via lldb-commits

https://github.com/JOE1994 requested changes to this pull request.

* The PR contains irrelevant changes to `X86` codegen.
* Author of the commit shows up as another contributor.

It seems like the author of this PR did a `git commit --amend`
on top of e586556e375fc5c4f7e76b5c299cb981f2016108 to add new changes.

Please update the branch to address these issues.

https://github.com/llvm/llvm-project/pull/91880
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [lldb] Refactor string manipulation in Debugger.cpp (#91209) (PR #91880)

2024-05-17 Thread Youngsuk Kim via lldb-commits

https://github.com/JOE1994 reopened 
https://github.com/llvm/llvm-project/pull/91880
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [lldb] Refactor string manipulation in Debugger.cpp (#91209) (PR #91880)

2024-05-13 Thread Youngsuk Kim via lldb-commits

JOE1994 wrote:

> We usually don't grant exclusive rights to work on an issue in the project, 
> since individual priorities may always change and people might loose interest 
> in an issue. Typically this kind of conflict doesn't happen very often 
> either. 

I understand that, but just for "good first issue"s,
I think it's desirable to allow 1 week to the person (likely a newcomer to the 
project) who first requested to be assigned to it
(the 1st step in the "good first issue" instructions also suggests this).

The user who initially asked to be assigned to the linked issue doesn't have 
"assign" access, and was likely waiting to get assigned. Assigning the issue to 
another user without any explanation or ping can be emotionally frustrating to 
the new user.

I've seen a similar conflict around a "good first issue" get heated in 
(`#84207`).

https://github.com/llvm/llvm-project/pull/91880
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [lldb] Refactor string manipulation in Debugger.cpp (#91209) (PR #91880)

2024-05-12 Thread Youngsuk Kim via lldb-commits

https://github.com/JOE1994 closed 
https://github.com/llvm/llvm-project/pull/91880
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [lldb] Refactor string manipulation in Debugger.cpp (#91209) (PR #91880)

2024-05-12 Thread Youngsuk Kim via lldb-commits

JOE1994 wrote:

A new user already asked to be assigned to work on #91209 2 days ago in the 
comments.
**I think that user deserves an opportunity to work on the issue**.

Next time when you see a **"good first issue"** which a new user had already 
asked to get assigned to,
please assign it to the new user.

https://github.com/llvm/llvm-project/pull/91880
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits