25 auto apple_names_table_up = std::make_unique<DWARFMappedHash::MemoryTable>(
26 apple_names, debug_str,
".apple_names");
27 if (!apple_names_table_up->IsValid())
28 apple_names_table_up.reset();
30 auto apple_namespaces_table_up =
31 std::make_unique<DWARFMappedHash::MemoryTable>(
32 apple_namespaces, debug_str,
".apple_namespaces");
33 if (!apple_namespaces_table_up->IsValid())
34 apple_namespaces_table_up.reset();
36 auto apple_types_table_up = std::make_unique<DWARFMappedHash::MemoryTable>(
37 apple_types, debug_str,
".apple_types");
38 if (!apple_types_table_up->IsValid())
39 apple_types_table_up.reset();
41 auto apple_objc_table_up = std::make_unique<DWARFMappedHash::MemoryTable>(
42 apple_objc, debug_str,
".apple_objc");
43 if (!apple_objc_table_up->IsValid())
44 apple_objc_table_up.reset();
46 if (apple_names_table_up || apple_namespaces_table_up ||
47 apple_types_table_up || apple_objc_table_up)
48 return std::make_unique<AppleDWARFIndex>(
49 module, std::move(apple_names_table_up),
50 std::move(apple_namespaces_table_up), std::move(apple_types_table_up),
51 std::move(apple_objc_table_up));
67 llvm::function_ref<
bool(
DWARFDIE die)> callback) {
101 ConstString class_name,
bool must_be_implementation,
102 llvm::function_ref<
bool(
DWARFDIE die)> callback) {
108 must_be_implementation);
121 llvm::function_ref<
bool(
DWARFDIE die)> callback) {
126 const bool has_tag =
m_apple_types_up->GetHeader().header_data.ContainsAtom(
128 const bool has_qualified_name_hash =
133 const dw_tag_t tag = context[0].tag;
134 if (has_tag && has_qualified_name_hash) {
136 const uint32_t qualified_name_hash = llvm::djbHash(qualified_name);
152 if (!has_qualified_name_hash && (context.
GetSize() > 1) &&
153 (context[1].tag == DW_TAG_class_type ||
154 context[1].tag == DW_TAG_structure_type)) {
156 [&](
DIERef ref) { return false; }))
184 llvm::function_ref<
bool(
DWARFDIE die)> callback) {
187 return ProcessFunctionDIE(lookup_info, die_ref, dwarf, parent_decl_ctx,
194 llvm::function_ref<
bool(
DWARFDIE die)> callback) {
208 s.
PutCString(
".apple_namespaces index present\n");
Identifies a DWARF debug info entry within a given Module.
const char * GetQualifiedName() const
@ eAtomTypeQualNameHash
A 32 bit hash of the full qualified name (since all hash entries are basename only) For example a typ...
@ eAtomTypeTag
DW_TAG_xxx value, should be encoded as DW_FORM_data1 (if no tags exceed 255) or DW_FORM_data2.
std::vector< DIEInfo > DIEInfoArray
static bool ExtractDIEArray(const DIEInfoArray &die_info_array, llvm::function_ref< bool(DIERef ref)> callback)
dw_offset_t GetNextUnitOffset() const
DWARFUnit & GetNonSkeletonUnit()
dw_offset_t GetOffset() const
void GetGlobalVariables(ConstString basename, llvm::function_ref< bool(DWARFDIE die)> callback) override
Finds global variables with the given base name.
void GetNamespaces(ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
void GetObjCMethods(ConstString class_name, llvm::function_ref< bool(DWARFDIE die)> callback) override
static std::unique_ptr< AppleDWARFIndex > Create(Module &module, DWARFDataExtractor apple_names, DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types, DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str)
std::unique_ptr< DWARFMappedHash::MemoryTable > m_apple_types_up
void GetTypes(ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
std::unique_ptr< DWARFMappedHash::MemoryTable > m_apple_objc_up
std::unique_ptr< DWARFMappedHash::MemoryTable > m_apple_names_up
void Dump(Stream &s) override
void GetFunctions(const Module::LookupInfo &lookup_info, SymbolFileDWARF &dwarf, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< bool(DWARFDIE die)> callback) override
void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation, llvm::function_ref< bool(DWARFDIE die)> callback) override
std::unique_ptr< DWARFMappedHash::MemoryTable > m_apple_namespaces_up
Represents a generic declaration context in a program.
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
DIERefCallbackImpl DIERefCallback(llvm::function_ref< bool(DWARFDIE die)> callback, llvm::StringRef name={}) const
A class that encapsulates name lookup information.
ConstString GetLookupName() const
A class that describes an executable image and its associated object and symbol files.
void LogMessage(Log *log, const char *format, Args &&...args)
llvm::StringRef GetText() const
Access the regular expression text.
A stream class that can stream formatted output to a file.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
llvm::dwarf::Tag dw_tag_t
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.