mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
[lldb] Add SBType::FindDirectNestedType() function (#68705)
This patch adds a `SBType::FindDirectNestedType(name)` function which performs a non-recursive search in given class for a type with specified name. The intent is to perform a fast search in debug info, so that it can be used in formatters, and let them remain responsive.
This is driven by my work on formatters for Clang and LLVM types. In particular, by [`PointerIntPairInfo::MaskAndShiftConstants`](cde9f9df79/llvm/include/llvm/ADT/PointerIntPair.h (L174C16-L174C16)), which is required to extract pointer and integer from `PointerIntPair`.
Related Discourse thread: https://discourse.llvm.org/t/traversing-member-types-of-a-type/72452
This commit is contained in:
committed by
GitHub
parent
02f67c097d
commit
93229c7bfd
@@ -586,6 +586,14 @@ lldb::TemplateArgumentKind SBType::GetTemplateArgumentKind(uint32_t idx) {
|
||||
return eTemplateArgumentKindNull;
|
||||
}
|
||||
|
||||
SBType SBType::FindDirectNestedType(const char *name) {
|
||||
LLDB_INSTRUMENT_VA(this, name);
|
||||
|
||||
if (!IsValid())
|
||||
return SBType();
|
||||
return SBType(m_opaque_sp->FindDirectNestedType(name));
|
||||
}
|
||||
|
||||
SBTypeList::SBTypeList() : m_opaque_up(new TypeListImpl()) {
|
||||
LLDB_INSTRUMENT_VA(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user