//
//===----------------------------------------------------------------------===//
//
-// This file contains constants used for implementing Dwarf debug support. For
-// Details on the Dwarf 3 specfication see DWARF Debugging Information Format
-// V.3 reference manual http://dwarf.freestandards.org ,
+// \file
+// \brief This file contains constants used for implementing Dwarf
+// debug support.
+//
+// For details on the Dwarf specfication see the latest DWARF Debugging
+// Information Format standard document on http://www.dwarfstd.org. This
+// file often includes support for non-released standard features.
//
//===----------------------------------------------------------------------===//
DW_APPLE_PROPERTY_unsafe_unretained = 0x800
};
-/// TagString - Return the string for the specified tag.
-///
-const char *TagString(unsigned Tag);
-
-/// ChildrenString - Return the string for the specified children flag.
-///
-const char *ChildrenString(unsigned Children);
-
-/// AttributeString - Return the string for the specified attribute.
-///
-const char *AttributeString(unsigned Attribute);
-
-/// FormEncodingString - Return the string for the specified form encoding.
-///
-const char *FormEncodingString(unsigned Encoding);
-
-/// OperationEncodingString - Return the string for the specified operation
-/// encoding.
-const char *OperationEncodingString(unsigned Encoding);
-
-/// AttributeEncodingString - Return the string for the specified attribute
-/// encoding.
-const char *AttributeEncodingString(unsigned Encoding);
-
-/// DecimalSignString - Return the string for the specified decimal sign
-/// attribute.
-const char *DecimalSignString(unsigned Sign);
-
-/// EndianityString - Return the string for the specified endianity.
-///
-const char *EndianityString(unsigned Endian);
-
-/// AccessibilityString - Return the string for the specified accessibility.
-///
-const char *AccessibilityString(unsigned Access);
-
-/// VisibilityString - Return the string for the specified visibility.
-///
-const char *VisibilityString(unsigned Visibility);
-
-/// VirtualityString - Return the string for the specified virtuality.
-///
-const char *VirtualityString(unsigned Virtuality);
-
-/// LanguageString - Return the string for the specified language.
-///
-const char *LanguageString(unsigned Language);
-
-/// CaseString - Return the string for the specified identifier case.
-///
-const char *CaseString(unsigned Case);
-
-/// ConventionString - Return the string for the specified calling convention.
-///
-const char *ConventionString(unsigned Convention);
-
-/// InlineCodeString - Return the string for the specified inline code.
-///
-const char *InlineCodeString(unsigned Code);
-
-/// ArrayOrderString - Return the string for the specified array order.
-///
-const char *ArrayOrderString(unsigned Order);
-
-/// DiscriminantString - Return the string for the specified discriminant
-/// descriptor.
-const char *DiscriminantString(unsigned Discriminant);
-
-/// LNStandardString - Return the string for the specified line number standard.
-///
-const char *LNStandardString(unsigned Standard);
-
-/// LNExtendedString - Return the string for the specified line number extended
-/// opcode encodings.
-const char *LNExtendedString(unsigned Encoding);
-
-/// MacinfoString - Return the string for the specified macinfo type encodings.
-///
-const char *MacinfoString(unsigned Encoding);
-
-/// CallFrameString - Return the string for the specified call frame instruction
-/// encodings.
-const char *CallFrameString(unsigned Encoding);
-
-/// ApplePropertyString - Return the string for the specified Apple
-/// property bit. This function is meant to return the symbolic name
-/// for 1 bit of the DW_AT_APPLE_property attribute, not for the whole attribute.
-const char *ApplePropertyString(unsigned);
-
// Constants for the DWARF5 Accelerator Table Proposal
enum AcceleratorTable {
// Data layout descriptors.
DW_hash_function_djb = 0u
};
-/// AtomTypeString - Return the string for the specified Atom type.
-const char *AtomTypeString(unsigned Atom);
-
// Constants for the GNU pubnames/pubtypes extensions supporting gdb index.
enum GDBIndexEntryKind {
GIEK_NONE,
GIEK_UNUSED7
};
-const char *GDBIndexEntryKindString(GDBIndexEntryKind Kind);
-
enum GDBIndexEntryLinkage {
GIEL_EXTERNAL,
GIEL_STATIC
};
+/// \defgroup DwarfConstantsDumping Dwarf constants dumping functions
+///
+/// All these functions map their argument's value back to the
+/// corresponding enumerator name or return nullptr if the value isn't
+/// known.
+///
+/// @{
+const char *TagString(unsigned Tag);
+const char *ChildrenString(unsigned Children);
+const char *AttributeString(unsigned Attribute);
+const char *FormEncodingString(unsigned Encoding);
+const char *OperationEncodingString(unsigned Encoding);
+const char *AttributeEncodingString(unsigned Encoding);
+const char *DecimalSignString(unsigned Sign);
+const char *EndianityString(unsigned Endian);
+const char *AccessibilityString(unsigned Access);
+const char *VisibilityString(unsigned Visibility);
+const char *VirtualityString(unsigned Virtuality);
+const char *LanguageString(unsigned Language);
+const char *CaseString(unsigned Case);
+const char *ConventionString(unsigned Convention);
+const char *InlineCodeString(unsigned Code);
+const char *ArrayOrderString(unsigned Order);
+const char *DiscriminantString(unsigned Discriminant);
+const char *LNStandardString(unsigned Standard);
+const char *LNExtendedString(unsigned Encoding);
+const char *MacinfoString(unsigned Encoding);
+const char *CallFrameString(unsigned Encoding);
+const char *ApplePropertyString(unsigned);
+const char *AtomTypeString(unsigned Atom);
+const char *GDBIndexEntryKindString(GDBIndexEntryKind Kind);
const char *GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);
+/// @}
+/// \brief Returns the symbolic string representing Val when used as a value
+/// for attribute Attr.
+const char *AttributeValueString(uint16_t Attr, unsigned Val);
+
+/// \brief Decsribes an entry of the various gnu_pub* debug sections.
+///
/// The gnu_pub* kind looks like:
///
/// 0-3 reserved
};
};
-/// Returns the symbolic string representing Val when used as a value
-/// for attribute Attr.
-const char *AttributeValueString(uint16_t Attr, unsigned Val);
} // End of namespace dwarf
using namespace llvm;
using namespace dwarf;
-/// TagString - Return the string for the specified tag.
-///
const char *llvm::dwarf::TagString(unsigned Tag) {
switch (Tag) {
case DW_TAG_array_type: return "DW_TAG_array_type";
return nullptr;
}
-/// ChildrenString - Return the string for the specified children flag.
-///
const char *llvm::dwarf::ChildrenString(unsigned Children) {
switch (Children) {
case DW_CHILDREN_no: return "DW_CHILDREN_no";
return nullptr;
}
-/// AttributeString - Return the string for the specified attribute.
-///
const char *llvm::dwarf::AttributeString(unsigned Attribute) {
switch (Attribute) {
case DW_AT_sibling: return "DW_AT_sibling";
return nullptr;
}
-/// FormEncodingString - Return the string for the specified form encoding.
-///
const char *llvm::dwarf::FormEncodingString(unsigned Encoding) {
switch (Encoding) {
case DW_FORM_addr: return "DW_FORM_addr";
return nullptr;
}
-/// OperationEncodingString - Return the string for the specified operation
-/// encoding.
const char *llvm::dwarf::OperationEncodingString(unsigned Encoding) {
switch (Encoding) {
case DW_OP_addr: return "DW_OP_addr";
return nullptr;
}
-/// AttributeEncodingString - Return the string for the specified attribute
-/// encoding.
const char *llvm::dwarf::AttributeEncodingString(unsigned Encoding) {
switch (Encoding) {
case DW_ATE_address: return "DW_ATE_address";
return nullptr;
}
-/// DecimalSignString - Return the string for the specified decimal sign
-/// attribute.
const char *llvm::dwarf::DecimalSignString(unsigned Sign) {
switch (Sign) {
case DW_DS_unsigned: return "DW_DS_unsigned";
return nullptr;
}
-/// EndianityString - Return the string for the specified endianity.
-///
const char *llvm::dwarf::EndianityString(unsigned Endian) {
switch (Endian) {
case DW_END_default: return "DW_END_default";
return nullptr;
}
-/// AccessibilityString - Return the string for the specified accessibility.
-///
const char *llvm::dwarf::AccessibilityString(unsigned Access) {
switch (Access) {
// Accessibility codes
return nullptr;
}
-/// VisibilityString - Return the string for the specified visibility.
-///
const char *llvm::dwarf::VisibilityString(unsigned Visibility) {
switch (Visibility) {
case DW_VIS_local: return "DW_VIS_local";
return nullptr;
}
-/// VirtualityString - Return the string for the specified virtuality.
-///
const char *llvm::dwarf::VirtualityString(unsigned Virtuality) {
switch (Virtuality) {
case DW_VIRTUALITY_none: return "DW_VIRTUALITY_none";
return nullptr;
}
-/// LanguageString - Return the string for the specified language.
-///
const char *llvm::dwarf::LanguageString(unsigned Language) {
switch (Language) {
case DW_LANG_C89: return "DW_LANG_C89";
return nullptr;
}
-/// CaseString - Return the string for the specified identifier case.
-///
const char *llvm::dwarf::CaseString(unsigned Case) {
switch (Case) {
case DW_ID_case_sensitive: return "DW_ID_case_sensitive";
return nullptr;
}
-/// ConventionString - Return the string for the specified calling convention.
-///
const char *llvm::dwarf::ConventionString(unsigned Convention) {
switch (Convention) {
case DW_CC_normal: return "DW_CC_normal";
return nullptr;
}
-/// InlineCodeString - Return the string for the specified inline code.
-///
const char *llvm::dwarf::InlineCodeString(unsigned Code) {
switch (Code) {
case DW_INL_not_inlined: return "DW_INL_not_inlined";
return nullptr;
}
-/// ArrayOrderString - Return the string for the specified array order.
-///
const char *llvm::dwarf::ArrayOrderString(unsigned Order) {
switch (Order) {
case DW_ORD_row_major: return "DW_ORD_row_major";
return nullptr;
}
-/// DiscriminantString - Return the string for the specified discriminant
-/// descriptor.
const char *llvm::dwarf::DiscriminantString(unsigned Discriminant) {
switch (Discriminant) {
case DW_DSC_label: return "DW_DSC_label";
return nullptr;
}
-/// LNStandardString - Return the string for the specified line number standard.
-///
const char *llvm::dwarf::LNStandardString(unsigned Standard) {
switch (Standard) {
case DW_LNS_copy: return "DW_LNS_copy";
return nullptr;
}
-/// LNExtendedString - Return the string for the specified line number extended
-/// opcode encodings.
const char *llvm::dwarf::LNExtendedString(unsigned Encoding) {
switch (Encoding) {
// Line Number Extended Opcode Encodings
return nullptr;
}
-/// MacinfoString - Return the string for the specified macinfo type encodings.
-///
const char *llvm::dwarf::MacinfoString(unsigned Encoding) {
switch (Encoding) {
// Macinfo Type Encodings
return nullptr;
}
-/// CallFrameString - Return the string for the specified call frame instruction
-/// encodings.
const char *llvm::dwarf::CallFrameString(unsigned Encoding) {
switch (Encoding) {
case DW_CFA_nop: return "DW_CFA_nop";
return nullptr;
}
-/// ApplePropertyString - Return the string for the specified Apple
-/// property bit. This function is meant to return the symbolic name
-/// for 1 bit of the DW_AT_APPLE_property attribute, not for the whole attribute.
const char *llvm::dwarf::ApplePropertyString(unsigned Prop) {
switch (Prop) {
case DW_APPLE_PROPERTY_readonly: