<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Symbol/TypeSystem.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[lldb] Add GetMangledTypeName to TypeSystem/CompilerType (#113006)</title>
<updated>2024-10-19T05:57:45+00:00</updated>
<author>
<name>Augusto Noronha</name>
<email>anoronha@apple.com</email>
</author>
<published>2024-10-19T05:57:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3d84b74cb3543428c35fc39e889684497286d482'/>
<id>3d84b74cb3543428c35fc39e889684497286d482</id>
<content type='text'>
Swift types have mangled names, so there should be a way to read those
from the compiler type.

This patch upstreams these two changes from swiftlang/llvm-project
(which were added there since at least 2016).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Swift types have mangled names, so there should be a way to read those
from the compiler type.

This patch upstreams these two changes from swiftlang/llvm-project
(which were added there since at least 2016).</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply  PR/87550 (again) (#95571)</title>
<updated>2024-06-25T16:01:17+00:00</updated>
<author>
<name>Vy Nguyen</name>
<email>vyng@google.com</email>
</author>
<published>2024-06-25T16:01:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e951bd0f51f8b077296f09d9c60ddf150048042f'/>
<id>e951bd0f51f8b077296f09d9c60ddf150048042f</id>
<content type='text'>
New fixes:
- properly init the `std::optional&lt;std::vector&gt;` to an empty vector as
opposed to `{}` (which was effectively `std::nullopt`).

---------

Co-authored-by: Vy Nguyen &lt;oontvoo@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
New fixes:
- properly init the `std::optional&lt;std::vector&gt;` to an empty vector as
opposed to `{}` (which was effectively `std::nullopt`).

---------

Co-authored-by: Vy Nguyen &lt;oontvoo@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Reapply PR/87550 (#94625)"</title>
<updated>2024-06-07T17:14:58+00:00</updated>
<author>
<name>Felipe de Azevedo Piovezan</name>
<email>fpiovezan@apple.com</email>
</author>
<published>2024-06-07T17:14:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=adcf33f8fbcc0f068bd4b8254994b16dda525009'/>
<id>adcf33f8fbcc0f068bd4b8254994b16dda525009</id>
<content type='text'>
This reverts commit 35fa2ded2ac52151be22c206fc92b983d1fd8e30.

It broke the LLDB bots on green dragon
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 35fa2ded2ac52151be22c206fc92b983d1fd8e30.

It broke the LLDB bots on green dragon
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply PR/87550 (#94625)</title>
<updated>2024-06-07T15:27:52+00:00</updated>
<author>
<name>Vy Nguyen</name>
<email>oontvoo@users.noreply.github.com</email>
</author>
<published>2024-06-07T15:27:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=35fa2ded2ac52151be22c206fc92b983d1fd8e30'/>
<id>35fa2ded2ac52151be22c206fc92b983d1fd8e30</id>
<content type='text'>
Re-apply https://github.com/llvm/llvm-project/pull/87550 with fixes.

Details:
Some tests in fuchsia failed because of the newly added assertion.
This was because `GetExceptionBreakpoint()` could be called before
`g_dap.debugger` was initted.

The fix here is to just lazily populate the list in
GetExceptionBreakpoint() rather than assuming it's already been initted.
(There is some nuisance here because we can't simply just populate it in
DAP::DAP(), which is a global ctor and is called before
`SBDebugger::Initialize()` is called. )</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Re-apply https://github.com/llvm/llvm-project/pull/87550 with fixes.

Details:
Some tests in fuchsia failed because of the newly added assertion.
This was because `GetExceptionBreakpoint()` could be called before
`g_dap.debugger` was initted.

The fix here is to just lazily populate the list in
GetExceptionBreakpoint() rather than assuming it's already been initted.
(There is some nuisance here because we can't simply just populate it in
DAP::DAP(), which is a global ctor and is called before
`SBDebugger::Initialize()` is called. )</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[lldb][lldb-dap] Cleanup breakpoint filters." (#93739)</title>
<updated>2024-05-29T20:56:37+00:00</updated>
<author>
<name>gulfemsavrun</name>
<email>gulfem@google.com</email>
</author>
<published>2024-05-29T20:56:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6595e7fa1b5588f860aa057aac47c43623169584'/>
<id>6595e7fa1b5588f860aa057aac47c43623169584</id>
<content type='text'>
Reverts llvm/llvm-project#87550 because it broke `TestDAP*` lldb tests.

https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64-rbe/b8746585790559468897/overview</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#87550 because it broke `TestDAP*` lldb tests.

https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64-rbe/b8746585790559468897/overview</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][lldb-dap] Cleanup breakpoint filters. (#87550)</title>
<updated>2024-05-29T16:22:42+00:00</updated>
<author>
<name>Vy Nguyen</name>
<email>oontvoo@users.noreply.github.com</email>
</author>
<published>2024-05-29T16:22:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cfb209b92a26f16ed7413b32da20fc436eff8c58'/>
<id>cfb209b92a26f16ed7413b32da20fc436eff8c58</id>
<content type='text'>
Details:
- remove Swift breakpoint filter because this version of LLDB does not
support Swift.
  - only return objc filters when working on macos.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Details:
- remove Swift breakpoint filter because this version of LLDB does not
support Swift.
  - only return objc filters when working on macos.</pre>
</div>
</content>
</entry>
<entry>
<title>Add a createError variant without error code (NFC) (#93209)</title>
<updated>2024-05-23T21:22:07+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2024-05-23T21:22:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=af31883341a122a7285e9b4f0a034470024021eb'/>
<id>af31883341a122a7285e9b4f0a034470024021eb</id>
<content type='text'>
For the significant amount of call sites that want to create an
incontrovertible error, such a wrapper function creates a significant
readability improvement and lowers the cost of entry to add error
handling in more places.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For the significant amount of call sites that want to create an
incontrovertible error, such a wrapper function creates a significant
readability improvement and lowers the cost of entry to add error
handling in more places.</pre>
</div>
</content>
</entry>
<entry>
<title>[PAC][lldb][Dwarf] Support `__ptrauth`-qualified types in user expressions (#84387)</title>
<updated>2024-04-30T08:15:35+00:00</updated>
<author>
<name>Daniil Kovalev</name>
<email>dkovalev@accesssoftek.com</email>
</author>
<published>2024-04-30T08:15:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=64248d7dee09fef4900058ba98a67feb68eb617c'/>
<id>64248d7dee09fef4900058ba98a67feb68eb617c</id>
<content type='text'>
Depends on #84384 and #90329

This adds support for `DW_TAG_LLVM_ptrauth_type` entries corresponding
to explicitly signed types (e.g. free function pointers) in lldb user
expressions. Applies PR https://github.com/apple/llvm-project/pull/8239
from Apple's downstream and also adds tests and related code.

---------

Co-authored-by: Jonas Devlieghere &lt;jonas@devlieghere.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Depends on #84384 and #90329

This adds support for `DW_TAG_LLVM_ptrauth_type` entries corresponding
to explicitly signed types (e.g. free function pointers) in lldb user
expressions. Applies PR https://github.com/apple/llvm-project/pull/8239
from Apple's downstream and also adds tests and related code.

---------

Co-authored-by: Jonas Devlieghere &lt;jonas@devlieghere.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Make only one function that needs to be implemented when searching for types (#74786)</title>
<updated>2023-12-13T00:51:49+00:00</updated>
<author>
<name>Greg Clayton</name>
<email>gclayton@fb.com</email>
</author>
<published>2023-12-13T00:51:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dd9587795811ba21e6ca6ad52b4531e17e6babd6'/>
<id>dd9587795811ba21e6ca6ad52b4531e17e6babd6</id>
<content type='text'>
This patch revives the effort to get this Phabricator patch into
upstream:

https://reviews.llvm.org/D137900

This patch was accepted before in Phabricator but I found some
-gsimple-template-names issues that are fixed in this patch.

A fixed up version of the description from the original patch starts
now.

This patch started off trying to fix Module::FindFirstType() as it
sometimes didn't work. The issue was the SymbolFile plug-ins didn't do
any filtering of the matching types they produced, and they only looked
up types using the type basename. This means if you have two types with
the same basename, your type lookup can fail when only looking up a
single type. We would ask the Module::FindFirstType to lookup "Foo::Bar"
and it would ask the symbol file to find only 1 type matching the
basename "Bar", and then we would filter out any matches that didn't
match "Foo::Bar". So if the SymbolFile found "Foo::Bar" first, then it
would work, but if it found "Baz::Bar" first, it would return only that
type and it would be filtered out.

Discovering this issue lead me to think of the patch Alex Langford did a
few months ago that was done for finding functions, where he allowed
SymbolFile objects to make sure something fully matched before parsing
the debug information into an AST type and other LLDB types. So this
patch aimed to allow type lookups to also be much more efficient.

As LLDB has been developed over the years, we added more ways to to type
lookups. These functions have lots of arguments. This patch aims to make
one API that needs to be implemented that serves all previous lookups:

- Find a single type
- Find all types
- Find types in a namespace

This patch introduces a `TypeQuery` class that contains all of the state
needed to perform the lookup which is powerful enough to perform all of
the type searches that used to be in our API. It contain a vector of
CompilerContext objects that can fully or partially specify the lookup
that needs to take place.

If you just want to lookup all types with a matching basename,
regardless of the containing context, you can specify just a single
CompilerContext entry that has a name and a CompilerContextKind mask of
CompilerContextKind::AnyType.

Or you can fully specify the exact context to use when doing lookups
like: CompilerContextKind::Namespace "std"
CompilerContextKind::Class "foo"
CompilerContextKind::Typedef "size_type"

This change expands on the clang modules code that already used a
vector&lt;CompilerContext&gt; items, but it modifies it to work with
expression type lookups which have contexts, or user lookups where users
query for types. The clang modules type lookup is still an option that
can be enabled on the `TypeQuery` objects.

This mirrors the most recent addition of type lookups that took a
vector&lt;CompilerContext&gt; that allowed lookups to happen for the
expression parser in certain places.

Prior to this we had the following APIs in Module:

```
void
Module::FindTypes(ConstString type_name, bool exact_match, size_t max_matches,
                  llvm::DenseSet&lt;lldb_private::SymbolFile *&gt; &amp;searched_symbol_files,
                  TypeList &amp;types);

void
Module::FindTypes(llvm::ArrayRef&lt;CompilerContext&gt; pattern, LanguageSet languages,
                  llvm::DenseSet&lt;lldb_private::SymbolFile *&gt; &amp;searched_symbol_files,
                  TypeMap &amp;types);

void Module::FindTypesInNamespace(ConstString type_name,
                                  const CompilerDeclContext &amp;parent_decl_ctx,
                                  size_t max_matches, TypeList &amp;type_list);
```

The new Module API is much simpler. It gets rid of all three above
functions and replaces them with:

```
void FindTypes(const TypeQuery &amp;query, TypeResults &amp;results);
```
The `TypeQuery` class contains all of the needed settings:

- The vector&lt;CompilerContext&gt; that allow efficient lookups in the symbol
file classes since they can look at basename matches only realize fully
matching types. Before this any basename that matched was fully realized
only to be removed later by code outside of the SymbolFile layer which
could cause many types to be realized when they didn't need to.
- If the lookup is exact or not. If not exact, then the compiler context
must match the bottom most items that match the compiler context,
otherwise it must match exactly
- If the compiler context match is for clang modules or not. Clang
modules matches include a Module compiler context kind that allows types
to be matched only from certain modules and these matches are not needed
when d oing user type lookups.
- An optional list of languages to use to limit the search to only
certain languages

The `TypeResults` object contains all state required to do the lookup
and store the results:
- The max number of matches
- The set of SymbolFile objects that have already been searched
- The matching type list for any matches that are found

The benefits of this approach are:
- Simpler API, and only one API to implement in SymbolFile classes
- Replaces the FindTypesInNamespace that used a CompilerDeclContext as a
way to limit the search, but this only worked if the TypeSystem matched
the current symbol file's type system, so you couldn't use it to lookup
a type in another module
- Fixes a serious bug in our FindFirstType functions where if we were
searching for "foo::bar", and we found a "baz::bar" first, the basename
would match and we would only fetch 1 type using the basename, only to
drop it from the matching list and returning no results</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch revives the effort to get this Phabricator patch into
upstream:

https://reviews.llvm.org/D137900

This patch was accepted before in Phabricator but I found some
-gsimple-template-names issues that are fixed in this patch.

A fixed up version of the description from the original patch starts
now.

This patch started off trying to fix Module::FindFirstType() as it
sometimes didn't work. The issue was the SymbolFile plug-ins didn't do
any filtering of the matching types they produced, and they only looked
up types using the type basename. This means if you have two types with
the same basename, your type lookup can fail when only looking up a
single type. We would ask the Module::FindFirstType to lookup "Foo::Bar"
and it would ask the symbol file to find only 1 type matching the
basename "Bar", and then we would filter out any matches that didn't
match "Foo::Bar". So if the SymbolFile found "Foo::Bar" first, then it
would work, but if it found "Baz::Bar" first, it would return only that
type and it would be filtered out.

Discovering this issue lead me to think of the patch Alex Langford did a
few months ago that was done for finding functions, where he allowed
SymbolFile objects to make sure something fully matched before parsing
the debug information into an AST type and other LLDB types. So this
patch aimed to allow type lookups to also be much more efficient.

As LLDB has been developed over the years, we added more ways to to type
lookups. These functions have lots of arguments. This patch aims to make
one API that needs to be implemented that serves all previous lookups:

- Find a single type
- Find all types
- Find types in a namespace

This patch introduces a `TypeQuery` class that contains all of the state
needed to perform the lookup which is powerful enough to perform all of
the type searches that used to be in our API. It contain a vector of
CompilerContext objects that can fully or partially specify the lookup
that needs to take place.

If you just want to lookup all types with a matching basename,
regardless of the containing context, you can specify just a single
CompilerContext entry that has a name and a CompilerContextKind mask of
CompilerContextKind::AnyType.

Or you can fully specify the exact context to use when doing lookups
like: CompilerContextKind::Namespace "std"
CompilerContextKind::Class "foo"
CompilerContextKind::Typedef "size_type"

This change expands on the clang modules code that already used a
vector&lt;CompilerContext&gt; items, but it modifies it to work with
expression type lookups which have contexts, or user lookups where users
query for types. The clang modules type lookup is still an option that
can be enabled on the `TypeQuery` objects.

This mirrors the most recent addition of type lookups that took a
vector&lt;CompilerContext&gt; that allowed lookups to happen for the
expression parser in certain places.

Prior to this we had the following APIs in Module:

```
void
Module::FindTypes(ConstString type_name, bool exact_match, size_t max_matches,
                  llvm::DenseSet&lt;lldb_private::SymbolFile *&gt; &amp;searched_symbol_files,
                  TypeList &amp;types);

void
Module::FindTypes(llvm::ArrayRef&lt;CompilerContext&gt; pattern, LanguageSet languages,
                  llvm::DenseSet&lt;lldb_private::SymbolFile *&gt; &amp;searched_symbol_files,
                  TypeMap &amp;types);

void Module::FindTypesInNamespace(ConstString type_name,
                                  const CompilerDeclContext &amp;parent_decl_ctx,
                                  size_t max_matches, TypeList &amp;type_list);
```

The new Module API is much simpler. It gets rid of all three above
functions and replaces them with:

```
void FindTypes(const TypeQuery &amp;query, TypeResults &amp;results);
```
The `TypeQuery` class contains all of the needed settings:

- The vector&lt;CompilerContext&gt; that allow efficient lookups in the symbol
file classes since they can look at basename matches only realize fully
matching types. Before this any basename that matched was fully realized
only to be removed later by code outside of the SymbolFile layer which
could cause many types to be realized when they didn't need to.
- If the lookup is exact or not. If not exact, then the compiler context
must match the bottom most items that match the compiler context,
otherwise it must match exactly
- If the compiler context match is for clang modules or not. Clang
modules matches include a Module compiler context kind that allows types
to be matched only from certain modules and these matches are not needed
when d oing user type lookups.
- An optional list of languages to use to limit the search to only
certain languages

The `TypeResults` object contains all state required to do the lookup
and store the results:
- The max number of matches
- The set of SymbolFile objects that have already been searched
- The matching type list for any matches that are found

The benefits of this approach are:
- Simpler API, and only one API to implement in SymbolFile classes
- Replaces the FindTypesInNamespace that used a CompilerDeclContext as a
way to limit the search, but this only worked if the TypeSystem matched
the current symbol file's type system, so you couldn't use it to lookup
a type in another module
- Fixes a serious bug in our FindFirstType functions where if we were
searching for "foo::bar", and we found a "baz::bar" first, the basename
would match and we would only fetch 1 type using the basename, only to
drop it from the matching list and returning no results</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Add SBType::FindDirectNestedType() function (#68705)</title>
<updated>2023-10-14T06:52:34+00:00</updated>
<author>
<name>Vlad Serebrennikov</name>
<email>serebrennikov.vladislav@gmail.com</email>
</author>
<published>2023-10-14T06:52:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=93229c7bfd97429aa0ac55b45e618bdb013702b2'/>
<id>93229c7bfd97429aa0ac55b45e618bdb013702b2</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
</feed>
