[PATCH] D127958: Replace to_hexString by touhexstring [NFC]

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 06:18:26 PDT 2022


thakis accepted this revision.
thakis added a comment.
This revision is now accepted and ready to land.

Other than the typo in the commit message, this lgtm. Optional suggestions below.

(If the LHS had followed these suggestions too, the diff would've been easier to review ;) )



================
Comment at: llvm/include/llvm/Support/ScopedPrinter.h:97
       return std::string(EnumItem.AltName);
-  return to_hexString(Value, false);
+  return utohexstr(Value, true);
 }
----------------
nit: consider spelling the 2nd arg `/*LowerCase=*/true`


================
Comment at: llvm/tools/llvm-profgen/PerfReader.cpp:472
                          Binary->virtualAddrToOffset(CtxKey->Context[I]),
-                         false);
+                         true);
     }
----------------
nit: consider spelling the 2nd arg `/*LowerCase=*/true`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3325
     if (e.e_type >= ET_LOPROC)
-      Str = "Processor Specific: (" + to_hexString(e.e_type, false) + ")";
+      Str = "Processor Specific: (" + utohexstr(e.e_type, true) + ")";
     else if (e.e_type >= ET_LOOS)
----------------
nit: consider spelling the 2nd arg `/*LowerCase=*/true`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3327
     else if (e.e_type >= ET_LOOS)
-      Str = "OS Specific: (" + to_hexString(e.e_type, false) + ")";
+      Str = "OS Specific: (" + utohexstr(e.e_type, true) + ")";
     else
----------------
nit: consider spelling the 2nd arg `/*LowerCase=*/true`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3328
+      Str = "OS Specific: (" + utohexstr(e.e_type, true) + ")";
     else
+      Str = "<unknown>: " + utohexstr(e.e_type, true);
----------------
nit: consider spelling the 2nd arg `/*LowerCase=*/true`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3329
     else
-      Str = "<unknown>: " + to_hexString(e.e_type, false);
+      Str = "<unknown>: " + utohexstr(e.e_type, true);
   }
----------------
nit: consider spelling the 2nd arg `/*LowerCase=*/true`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3532
     }
-    Addend += to_hexString(RelAddend, false);
+    Addend += utohexstr(RelAddend, true);
   }
----------------
nit: consider spelling the 2nd arg `/*LowerCase=*/true`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3564
   OS << "\n'" << Name.str().c_str() << "' relocation section at offset 0x"
-     << to_hexString(Offset, false) << " contains " << Reg.Size << " bytes:\n";
+     << utohexstr(Offset, true) << " contains " << Reg.Size << " bytes:\n";
   printRelocHeaderFields<ELFT>(OS, Type);
----------------
nit: consider spelling the 2nd arg `/*LowerCase=*/true`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3617
     OS << "\nRelocation section '" << Name << "' at offset 0x"
-       << to_hexString(Offset, false) << " contains " << EntriesNum
+       << utohexstr(Offset, true) << " contains " << EntriesNum
        << " entries:\n";
----------------
nit: consider spelling the 2nd arg `/*LowerCase=*/true`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3682
      << " section headers, starting at offset "
-     << "0x" << to_hexString(this->Obj.getHeader().e_shoff, false) << ":\n\n";
+     << "0x" << utohexstr(this->Obj.getHeader().e_shoff, true) << ":\n\n";
   OS << "Section Headers:\n";
----------------
...you get the idea


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3840
         if (Other != 0)
-          Fields[5].Str.append(" | " + to_hexString(Other, false));
+          Fields[5].Str.append(" | " + utohexstr(Other, true));
         Fields[5].Str.append("]");
----------------
same


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3850
+          Fields[5].Str.append(" | " + utohexstr(Other, true));
         Fields[5].Str.append("]");
       }
----------------
same


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4061
      << " section headers, starting at offset "
-     << "0x" << to_hexString(this->Obj.getHeader().e_shoff, false) << ":\n\n";
+     << "0x" << utohexstr(this->Obj.getHeader().e_shoff, true) << ":\n\n";
 
----------------
same


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127958/new/

https://reviews.llvm.org/D127958



More information about the llvm-commits mailing list