This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readelf] Print EI_ABIVERSION as decimal instead of hexadecimal
ClosedPublic

Authored by MaskRay on Jan 5 2020, 3:01 PM.

Diff Detail

Event Timeline

MaskRay created this revision.Jan 5 2020, 3:01 PM

Unit tests: fail. 61248 tests passed, 1 failed and 736 were skipped.

failed: LLVM.tools/llvm-objcopy/ELF/partitions.test

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

jhenderson accepted this revision.Jan 6 2020, 1:49 AM

LGTM. I have no idea why this was hex in the first place.

llvm/tools/llvm-readobj/ELFDumper.cpp
3065

BTW, do you know the rationale for using llvm::to_string versus std::to_string? Both are widely used in the code base...

This revision is now accepted and ready to land.Jan 6 2020, 1:49 AM
MaskRay updated this revision to Diff 236394.Jan 6 2020, 9:14 AM

Fix tools/llvm-objcopy/ELF/partitions.test

MaskRay marked an inline comment as done.Jan 6 2020, 9:20 AM
MaskRay added inline comments.
llvm/tools/llvm-readobj/ELFDumper.cpp
3065

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..

This revision was automatically updated to reflect the committed changes.

Unit tests: pass. 61252 tests passed, 0 failed and 736 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml