Files
clang-p2996/lldb/source/Utility/Log.cpp
Alex Langford 77e3914be7 [lldb][NFCI] Stop creating additional temporary string in Log::VAPrintf
Instead of creating a std::string from the `SmallString`,
let's just use a std::string from the start. I initially tried to make
`SmallString` work but getting it right proved complicated because
`LogHandler::Emit` will take its `StringRef` parameter and touch the raw
`const char *` from it directly, which isn't guaranteed to be
null-terminated with a `SmallString`.

I changed `WriteMessage` to take a `StringRef` instead of a
`const std::string &` for flexibility.

Differential Revision: https://reviews.llvm.org/D148676
2023-04-19 14:16:12 -07:00

13 KiB