File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 2929#include " llvm/Support/Endian.h"
3030#include " llvm/Support/ErrorHandling.h"
3131#include " llvm/Support/FileSystem.h"
32+ #include " llvm/Support/FormatVariadic.h"
3233#include " llvm/Support/MathExtras.h"
3334#include " llvm/Support/MemoryBuffer.h"
3435#include " llvm/Support/Path.h"
@@ -2240,19 +2241,13 @@ static std::string humanizeNumber(uint64_t Number) {
22402241 {1'000'000UL , ' M' },
22412242 {1'000UL , ' k' }}};
22422243
2243- std::string HumanString;
2244- llvm::raw_string_ostream HumanStringStream (HumanString);
22452244 for (const auto &[UnitSize, UnitSign] : Units) {
22462245 if (Number >= UnitSize) {
2247- HumanStringStream << llvm::format (
2248- " %.2f%c" , Number / static_cast <double >(UnitSize), UnitSign);
2249- break ;
2246+ return llvm::formatv (" {0:F}{1}" , Number / static_cast <double >(UnitSize),
2247+ UnitSign);
22502248 }
22512249 }
2252- if (HumanString.empty ()) {
2253- HumanStringStream << Number;
2254- }
2255- return HumanString;
2250+ return std::to_string (Number);
22562251}
22572252
22582253void SourceManager::noteSLocAddressSpaceUsage (
You can’t perform that action at this time.
0 commit comments