From 44197df7a371194b60eda04093a541a8c4d6032a Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 22 Jan 2018 09:41:36 +0000 Subject: [BinaryFormat] Add .debug_names support Summary: This adds a definition of the .debug_names section and the new constants (DW_IDX_???) which are used in it. Reviewers: JDevlieghere, aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42296 llvm-svn: 323084 --- llvm/lib/BinaryFormat/Dwarf.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'llvm/lib/BinaryFormat/Dwarf.cpp') diff --git a/llvm/lib/BinaryFormat/Dwarf.cpp b/llvm/lib/BinaryFormat/Dwarf.cpp index 86e3b02577f..593ce7a1965 100644 --- a/llvm/lib/BinaryFormat/Dwarf.cpp +++ b/llvm/lib/BinaryFormat/Dwarf.cpp @@ -567,6 +567,17 @@ StringRef llvm::dwarf::AttributeValueString(uint16_t Attr, unsigned Val) { return StringRef(); } +StringRef llvm::dwarf::IndexString(unsigned Idx) { + switch (Idx) { + default: + return StringRef(); +#define HANDLE_DW_IDX(ID, NAME) \ + case DW_IDX_##NAME: \ + return "DW_IDX_" #NAME; +#include "llvm/BinaryFormat/Dwarf.def" + } +} + bool llvm::dwarf::isValidFormForVersion(Form F, unsigned Version, bool ExtensionsOk) { if (FormVendor(F) == DWARF_VENDOR_DWARF) { -- cgit v1.2.3