Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h @@ -14,6 +14,7 @@ #include "lldb/Symbol/SymbolFile.h" #include "lldb/Symbol/CompilerDecl.h" #include "lldb/Symbol/CompilerDeclContext.h" +#include "lldb/lldb-enumerations.h" class DWARFDIE; namespace lldb_private { @@ -54,6 +55,8 @@ static llvm::Optional ParseChildArrayInfo(const DWARFDIE &parent_die, const lldb_private::ExecutionContext *exe_ctx = nullptr); + + static lldb::AccessType GetAccessTypeFromDWARF(uint32_t dwarf_accessibility); }; #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFASTPARSER_H Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.cpp @@ -100,3 +100,18 @@ } return array_info; } + +AccessType +DWARFASTParser::GetAccessTypeFromDWARF(uint32_t dwarf_accessibility) { + switch (dwarf_accessibility) { + case DW_ACCESS_public: + return eAccessPublic; + case DW_ACCESS_private: + return eAccessPrivate; + case DW_ACCESS_protected: + return eAccessProtected; + default: + break; + } + return eAccessNone; +} Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -8,6 +8,7 @@ #include +#include "DWARFASTParser.h" #include "DWARFASTParserClang.h" #include "DWARFDebugInfo.h" #include "DWARFDeclContext.h" @@ -62,20 +63,6 @@ DWARFASTParserClang::~DWARFASTParserClang() = default; -static AccessType DW_ACCESS_to_AccessType(uint32_t dwarf_accessibility) { - switch (dwarf_accessibility) { - case DW_ACCESS_public: - return eAccessPublic; - case DW_ACCESS_private: - return eAccessPrivate; - case DW_ACCESS_protected: - return eAccessProtected; - default: - break; - } - return eAccessNone; -} - static bool DeclKindIsCXXClass(clang::Decl::Kind decl_kind) { switch (decl_kind) { case clang::Decl::CXXRecord: @@ -313,7 +300,7 @@ break; case DW_AT_accessibility: - accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); + accessibility = DWARFASTParser::GetAccessTypeFromDWARF(form_value.Unsigned()); break; case DW_AT_artificial: @@ -1463,7 +1450,7 @@ break; case DW_AT_accessibility: - accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); + accessibility = DWARFASTParser::GetAccessTypeFromDWARF(form_value.Unsigned()); break; case DW_AT_virtuality: @@ -2532,7 +2519,7 @@ break; case DW_AT_accessibility: - accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); + accessibility = DWARFASTParser::GetAccessTypeFromDWARF(form_value.Unsigned()); break; case DW_AT_artificial: is_artificial = form_value.Boolean();