[llvm-readobj] Refactor ELFDumper::printAttributes()
authorJozef Lawrynowicz <jozefl.opensrc@gmail.com>
Tue, 17 Aug 2021 20:28:31 +0000 (13:28 -0700)
committerFangrui Song <i@maskray.me>
Tue, 17 Aug 2021 20:28:31 +0000 (13:28 -0700)
commit108ba4f4a48043067f0735f7f7c6f301045cf9b5
tree1743a26b31e9ea87d23bb74191c97001fcf750c1
parente21a21a977b492cc7172779d080db146e3c39e06
[llvm-readobj] Refactor ELFDumper::printAttributes()

The current implementation of printAttributes makes it fiddly to extend
attribute support for new targets.

By refactoring the code so all target specific variables are
initialized in a switch/case statement, it becomes simpler to extend
attribute support for new targets.

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D107968
llvm/test/tools/llvm-readobj/ELF/ARM/attribute-big-endian.test [new file with mode: 0644]
llvm/test/tools/llvm-readobj/ELF/RISCV/validate-attr-section.test
llvm/tools/llvm-readobj/ELFDumper.cpp