<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Symbol/CompilerType.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][TypeSystem] Remove count parameter from TypeSystem::IsFloatingPointType (#165707)</title>
<updated>2025-10-31T10:18:13+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-10-31T10:18:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b81a9927974b5b2941114b1ca6ceedb61875d988'/>
<id>b81a9927974b5b2941114b1ca6ceedb61875d988</id>
<content type='text'>
Similar motivation to https://github.com/llvm/llvm-project/pull/165702.
It was unused in all callsites and inconsistent with other APIs like
`IsIntegerType` (which doesn't take a `count` parameter).

If we ever need a "how many elements does this type represent", we can
implement one with a new TypeSystem API that does exactly that.

Some callsites checked for `count == 1` previously, but I suspect what
they intended to do is check for whether it's a vector type or complex
type, before reading the FP register. I'm somewhat confident that's the
case because the `TypeSystemClang::GetTypeInfo` currently incorrectly
sets the integer and floating point bits for complex and vector types
(will fix separately). But some architectures might choose to pass
single-element vectors in scalar registers. I should probably changes
these to check the vector element size.

All the `count == 2 &amp;&amp; is_complex` were redundant because `count == 2`
iff `is_complex == true`. So I just removed the count check there.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similar motivation to https://github.com/llvm/llvm-project/pull/165702.
It was unused in all callsites and inconsistent with other APIs like
`IsIntegerType` (which doesn't take a `count` parameter).

If we ever need a "how many elements does this type represent", we can
implement one with a new TypeSystem API that does exactly that.

Some callsites checked for `count == 1` previously, but I suspect what
they intended to do is check for whether it's a vector type or complex
type, before reading the FP register. I'm somewhat confident that's the
case because the `TypeSystemClang::GetTypeInfo` currently incorrectly
sets the integer and floating point bits for complex and vector types
(will fix separately). But some architectures might choose to pass
single-element vectors in scalar registers. I should probably changes
these to check the vector element size.

All the `count == 2 &amp;&amp; is_complex` were redundant because `count == 2`
iff `is_complex == true`. So I just removed the count check there.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][TypeSystem] Remove count parameter from TypeSystem::GetEncoding (#165702)</title>
<updated>2025-10-31T09:08:12+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-10-31T09:08:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a6eac9e729d781abc8c43a1d45da97f5abcb64e9'/>
<id>a6eac9e729d781abc8c43a1d45da97f5abcb64e9</id>
<content type='text'>
There were a couple of quirks with this parameter:
1. It wasn't being set consistently. E.g., vector types would be of
count `1` but complex types would be `2`. Hence, it wasn't clear what
count was referring to.
2. `count` was not being set if the input type was invalid, possibly
leaving the input reference uninitialized.
3. Only one callsite actually made use of `count`, and that in itself
seems like it could be improved (added a FIXME).

If we ever need a "how many elements does this type represent", we can
implement one with a new `TypeSystem` API that does exactly that.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were a couple of quirks with this parameter:
1. It wasn't being set consistently. E.g., vector types would be of
count `1` but complex types would be `2`. Hence, it wasn't clear what
count was referring to.
2. `count` was not being set if the input type was invalid, possibly
leaving the input reference uninitialized.
3. Only one callsite actually made use of `count`, and that in itself
seems like it could be improved (added a FIXME).

If we ever need a "how many elements does this type represent", we can
implement one with a new `TypeSystem` API that does exactly that.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][SBType] GetBasicType to unwrap canonical type (#149112)</title>
<updated>2025-07-23T07:52:49+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-07-23T07:52:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b7889a65a8e54f2d9c7f578a515a7bf970044bfe'/>
<id>b7889a65a8e54f2d9c7f578a515a7bf970044bfe</id>
<content type='text'>
`SBType::GetBasicType` fails on typedefs to primitive types. The docs
for `GetBasicType` state:
```
Returns the BasicType value that is most appropriate to this type
```
But, e.g., for `uint64_t` this would currently return
`eBasicTypeInvalid`.

`TypeSystemClang::GetBasicTypeEnumeration` (which is what
`SBType::GetBasicType` uses) doesn't see through typedefs. Inside LLDB
we almost always call `GetBasicTypeEnumeration` on the canonical type.
In the cases we don't I suspect those were just subtle bugs. This patch
gets the canonical type inside of `GetBasicTypeEnumeration` instead.

rdar://155829208</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`SBType::GetBasicType` fails on typedefs to primitive types. The docs
for `GetBasicType` state:
```
Returns the BasicType value that is most appropriate to this type
```
But, e.g., for `uint64_t` this would currently return
`eBasicTypeInvalid`.

`TypeSystemClang::GetBasicTypeEnumeration` (which is what
`SBType::GetBasicType` uses) doesn't see through typedefs. Inside LLDB
we almost always call `GetBasicTypeEnumeration` on the canonical type.
In the cases we don't I suspect those were just subtle bugs. This patch
gets the canonical type inside of `GetBasicTypeEnumeration` instead.

rdar://155829208</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][TypeSystemClang] Allow arrays to be dereferenced in C/C++. (#135843)</title>
<updated>2025-05-12T11:46:58+00:00</updated>
<author>
<name>Ilia Kuklin</name>
<email>ikuklin@accesssoftek.com</email>
</author>
<published>2025-05-12T11:46:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3aacd74594b1f8ab04904d277b6a106c98904b29'/>
<id>3aacd74594b1f8ab04904d277b6a106c98904b29</id>
<content type='text'>
Add a function `GetDereferencedType` to `CompilerType` and allow
`TypeSystemClang` to dereference arrays.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a function `GetDereferencedType` to `CompilerType` and allow
`TypeSystemClang` to dereference arrays.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Upgrade `GetIndexOfChildWithName` to use `llvm::Expected` (#136693)</title>
<updated>2025-04-30T10:44:19+00:00</updated>
<author>
<name>Charles Zablit</name>
<email>c_zablit@apple.com</email>
</author>
<published>2025-04-30T10:44:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b3d130279f5c59a82d48d4647bef626ac4e202cf'/>
<id>b3d130279f5c59a82d48d4647bef626ac4e202cf</id>
<content type='text'>
This patch replaces the use of `UINT32_MAX` as the error return value of
`GetIndexOfChildWithName` with `llvm::Expected`.


# Tasks to do in another PR

1. Replace `CalculateNumChildrenIgnoringErrors` with
`CalculateNumChildren`. See [this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2056319358).
2. Update `lldb_private::formatters::ExtractIndexFromString` to use
`llvm::Expected`. See [this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2054217536).
3. Create a new class which carries both user and internal errors. See
[this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2056439608).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces the use of `UINT32_MAX` as the error return value of
`GetIndexOfChildWithName` with `llvm::Expected`.


# Tasks to do in another PR

1. Replace `CalculateNumChildrenIgnoringErrors` with
`CalculateNumChildren`. See [this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2056319358).
2. Update `lldb_private::formatters::ExtractIndexFromString` to use
`llvm::Expected`. See [this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2054217536).
3. Create a new class which carries both user and internal errors. See
[this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2056439608).</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Remove CompilerType::GetIndexOfFieldWithName (#135963)</title>
<updated>2025-04-17T11:55:18+00:00</updated>
<author>
<name>Charles Zablit</name>
<email>zablitcharles@gmail.com</email>
</author>
<published>2025-04-17T11:55:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f135ce6a9329124f1e508fcad2eedf5326a668fa'/>
<id>f135ce6a9329124f1e508fcad2eedf5326a668fa</id>
<content type='text'>
This patch removes the unused `CompilerType::GetIndexOfFieldWithName` API (it wasn't used apart from in a single testcase). Given we have so many similarly named APIs already, it's best not to maintain this API that's not really used (and isnt tested).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes the unused `CompilerType::GetIndexOfFieldWithName` API (it wasn't used apart from in a single testcase). Given we have so many similarly named APIs already, it's best not to maintain this API that's not really used (and isnt tested).</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Upgrade CompilerType::GetBitSize to return llvm::Expected  (#129601)</title>
<updated>2025-03-05T18:21:19+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2025-03-05T18:21:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=878a64f94a264ea4b564d6063614ddb0b5da3f6c'/>
<id>878a64f94a264ea4b564d6063614ddb0b5da3f6c</id>
<content type='text'>
This patch pushes the error handling boundary for the GetBitSize()
methods from Runtime into the Type and CompilerType APIs. This makes it
easier to diagnose problems thanks to more meaningful error messages
being available. GetBitSize() is often the first thing LLDB asks about a
type, so this method is particularly important for a better user
experience.

rdar://145667239</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch pushes the error handling boundary for the GetBitSize()
methods from Runtime into the Type and CompilerType APIs. This makes it
easier to diagnose problems thanks to more meaningful error messages
being available. GetBitSize() is often the first thing LLDB asks about a
type, so this method is particularly important for a better user
experience.

rdar://145667239</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Handle a byte size of zero in CompilerType::GetValueAsScalar (#123107)</title>
<updated>2025-01-16T17:33:59+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-01-16T17:33:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8965dd40c63cf00610fcf550017b46dae736d94b'/>
<id>8965dd40c63cf00610fcf550017b46dae736d94b</id>
<content type='text'>
A bit or byte size of 0 is not a bug. It can legitimately (and
frequently) happen in Swift and C, just not in C++. However, it doesn't
make sense to read a scalar of zero bytes.

Currently, when this happens, we trigger an `lldb_assert` in the data
extractor and return 0, which isn't accurate. I have a bunch of reports
of the assert triggering, but nobody has been able to provide me with a
reproducer that I can turn into a test and I wasn't able to concoct a
test case by reverse-engineering the code.

rdar://141630334</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A bit or byte size of 0 is not a bug. It can legitimately (and
frequently) happen in Swift and C, just not in C++. However, it doesn't
make sense to read a scalar of zero bytes.

Currently, when this happens, we trigger an `lldb_assert` in the data
extractor and return 0, which isn't accurate. I have a bunch of reports
of the assert triggering, but nobody has been able to provide me with a
reproducer that I can turn into a test and I wasn't able to concoct a
test case by reverse-engineering the code.

rdar://141630334</pre>
</div>
</content>
</entry>
<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>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>
</feed>
