Index: llvm/trunk/include/llvm/Support/Dwarf.h =================================================================== --- llvm/trunk/include/llvm/Support/Dwarf.h +++ llvm/trunk/include/llvm/Support/Dwarf.h @@ -7,9 +7,13 @@ // //===----------------------------------------------------------------------===// // -// 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. // //===----------------------------------------------------------------------===// @@ -782,95 +786,6 @@ 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. @@ -893,9 +808,6 @@ 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, @@ -908,15 +820,51 @@ 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 @@ -948,9 +896,6 @@ }; }; -/// 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 Index: llvm/trunk/lib/Support/Dwarf.cpp =================================================================== --- llvm/trunk/lib/Support/Dwarf.cpp +++ llvm/trunk/lib/Support/Dwarf.cpp @@ -17,8 +17,6 @@ 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"; @@ -104,8 +102,6 @@ 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"; @@ -114,8 +110,6 @@ 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"; @@ -275,8 +269,6 @@ 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"; @@ -312,8 +304,6 @@ 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"; @@ -481,8 +471,6 @@ 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"; @@ -507,8 +495,6 @@ 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"; @@ -520,8 +506,6 @@ 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"; @@ -533,8 +517,6 @@ return nullptr; } -/// AccessibilityString - Return the string for the specified accessibility. -/// const char *llvm::dwarf::AccessibilityString(unsigned Access) { switch (Access) { // Accessibility codes @@ -545,8 +527,6 @@ 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"; @@ -556,8 +536,6 @@ 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"; @@ -567,8 +545,6 @@ 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"; @@ -605,8 +581,6 @@ 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"; @@ -617,8 +591,6 @@ 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"; @@ -630,8 +602,6 @@ 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"; @@ -642,8 +612,6 @@ 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"; @@ -652,8 +620,6 @@ 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"; @@ -662,8 +628,6 @@ 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"; @@ -682,8 +646,6 @@ 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 @@ -697,8 +659,6 @@ return nullptr; } -/// MacinfoString - Return the string for the specified macinfo type encodings. -/// const char *llvm::dwarf::MacinfoString(unsigned Encoding) { switch (Encoding) { // Macinfo Type Encodings @@ -711,8 +671,6 @@ 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"; @@ -750,9 +708,6 @@ 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: