[all-commits] [llvm/llvm-project] 93229c: [lldb] Add SBType::FindDirectNestedType() function...

Vlad Serebrennikov via All-commits all-commits at lists.llvm.org
Fri Oct 13 23:52:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 93229c7bfd97429aa0ac55b45e618bdb013702b2
      https://github.com/llvm/llvm-project/commit/93229c7bfd97429aa0ac55b45e618bdb013702b2
  Author: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
  Date:   2023-10-14 (Sat, 14 Oct 2023)

  Changed paths:
    M lldb/bindings/interface/SBTypeDocstrings.i
    M lldb/include/lldb/API/SBType.h
    M lldb/include/lldb/Symbol/Type.h
    M lldb/include/lldb/Symbol/TypeSystem.h
    M lldb/source/API/SBType.cpp
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
    M lldb/source/Symbol/Type.cpp
    M lldb/source/Symbol/TypeSystem.cpp
    M lldb/test/API/python_api/type/TestTypeList.py
    M lldb/test/API/python_api/type/main.cpp
    M llvm/docs/ReleaseNotes.rst

  Log Message:
  -----------
  [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`](https://github.com/llvm/llvm-project/blob/cde9f9df79805a0850310870d6dcc64004292727/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




More information about the All-commits mailing list