[PATCH] D72234: [llvm-readelf] Print EI_ABIVERSION as decimal instead of hexadecimal

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 09:20:59 PST 2020


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3065
+  printFields(OS,
+              "ABI Version:", std::to_string(e->e_ident[ELF::EI_ABIVERSION]));
   Str = printEnum(e->e_type, makeArrayRef(ElfObjectFileType));
----------------
jhenderson wrote:
> BTW, do you know the rationale for using llvm::to_string versus std::to_string? Both are widely used in the code base...
D17523 added llvm::to_string and used it in llvm-readobj. Over time, the function gets adopted in more than 100 places.. I think many call sites convert an integer to a string and they should use https://en.cppreference.com/w/cpp/string/basic_string/to_string instead. They got adopted probably because the authors thought std::to_string is C++14 (LLVM migrated to LLVM just last year), like std::make_unique vs llvm::make_unique..


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72234





More information about the llvm-commits mailing list