[clang] [clang] Make source locations space usage diagnostics numbers easier to read (PR #114999)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 07:14:16 PST 2024


================
@@ -2227,6 +2227,28 @@ LLVM_DUMP_METHOD void SourceManager::dump() const {
   }
 }
 
+static std::string NumberToHumanString(uint64_t number) {
+  static constexpr std::array<std::pair<uint64_t, char>, 4> Units = {
+      {{1'000'000'000'000UL, 'T'},
+       {1'000'000'000UL, 'G'},
+       {1'000'000UL, 'M'},
+       {1'000UL, 'k'}}};
+
+  std::string human_string;
----------------
tbaederr wrote:

Variable names should use PascalCase.

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


More information about the cfe-commits mailing list