[PATCH] D57583: [PGO] Fix the type of the formated variable

Miloš Stojanović via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 1 06:45:35 PST 2019


mstojanovic created this revision.
mstojanovic added reviewers: xur, petarj, zoran.jovanovic.
Herald added subscribers: atanasyan, arichardson, sdardis.

Change the format type of Value to PRIu64 since it is a uint64_t.
The problem was detected on a big-endian mips64 board where it was printing junk values and causing test failure.


https://reviews.llvm.org/D57583

Files:
  tools/llvm-profdata/llvm-profdata.cpp


Index: tools/llvm-profdata/llvm-profdata.cpp
===================================================================
--- tools/llvm-profdata/llvm-profdata.cpp
+++ tools/llvm-profdata/llvm-profdata.cpp
@@ -642,7 +642,7 @@
     for (uint32_t V = 0; V < NV; V++) {
       OS << "\t[ " << format("%2u", I) << ", ";
       if (Symtab == nullptr)
-        OS << format("%4u", VD[V].Value);
+        OS << format("%4" PRIu64, VD[V].Value);
       else
         OS << Symtab->getFuncName(VD[V].Value);
       OS << ", " << format("%10" PRId64, VD[V].Count) << " ] ("


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57583.184737.patch
Type: text/x-patch
Size: 555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190201/4b697ae0/attachment.bin>


More information about the llvm-commits mailing list