diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-07-13 17:21:51 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-07-13 17:21:51 +0000 |
commit | 327e7a16083c0bec70841288876815554e5f4367 (patch) | |
tree | 46bdb32e11eb2d64e903b3d9b16a3d7e7792edc4 /llvm/lib/BinaryFormat/Dwarf.cpp | |
parent | e86e6efea18ee10893b9f0d659482dbfdfe25e00 (diff) | |
download | llvm-327e7a16083c0bec70841288876815554e5f4367.zip llvm-327e7a16083c0bec70841288876815554e5f4367.tar.gz llvm-327e7a16083c0bec70841288876815554e5f4367.tar.bz2 |
[dwarfdump] Add pretty printer for accelerator table based on Atom.
For instance, When dumping .apple_types, the second atom represents the
DW_TAG. In addition to printing the raw value, we now also pretty print
the value if the ATOM tells us how.
llvm-svn: 337026
Diffstat (limited to 'llvm/lib/BinaryFormat/Dwarf.cpp')
-rw-r--r-- | llvm/lib/BinaryFormat/Dwarf.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/BinaryFormat/Dwarf.cpp b/llvm/lib/BinaryFormat/Dwarf.cpp index a2e86c7..5984de7 100644 --- a/llvm/lib/BinaryFormat/Dwarf.cpp +++ b/llvm/lib/BinaryFormat/Dwarf.cpp @@ -571,6 +571,17 @@ StringRef llvm::dwarf::AttributeValueString(uint16_t Attr, unsigned Val) { return StringRef(); } +StringRef llvm::dwarf::AtomValueString(uint16_t Atom, unsigned Val) { + switch (Atom) { + case DW_ATOM_null: + return "NULL"; + case DW_ATOM_die_tag: + return TagString(Val); + } + + return StringRef(); +} + StringRef llvm::dwarf::IndexString(unsigned Idx) { switch (Idx) { default: |