Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.
This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.
This doesn't actually modify StringRef yet, I'll do that in a follow-up.
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp
index 9b2c6ad..ffe331a 100644
--- a/llvm/tools/llvm-readobj/COFFDumper.cpp
+++ b/llvm/tools/llvm-readobj/COFFDumper.cpp
@@ -1135,7 +1135,7 @@
return;
}
- std::string PC = formatv("+{0:X}", uint32_t(Line.Offset));
+ std::string PC = std::string(formatv("+{0:X}", uint32_t(Line.Offset)));
ListScope PCScope(W, PC);
codeview::LineInfo LI(Line.Flags);