[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
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 @@
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: