Commit 11a7ee5
authored
[lldb][TypeSystemClang][NFC] Clean up TypeSystemClang::GetBitSize (#100674)
This patch performs following NFC changes to
TypeSystemClang::GetBitSize:
* Factor out the Objective-C logic into a helper function.
* Introduce a new case for `FunctionProto`. I don't see a good reason
for special-casing this in the `default` case.
* We had a redundant check for `GetCompleteType` in the `RecordType`
case. We used to allow zero-size types for records and function
prototypes, so we can just fold them into the same case.
* Introduce a new case for `IncompleteArray`.
The motivation for this is that there are a few issues around VLAs
(i.e., `Type::IncompleteArray`) whose fixes will be easier to reason
about after this refactor.
Generally I don't think treating a type with 0 size as an error is the
right thing to do (at least not for array types). But that's not
something I wanted to fold into this NFC change.1 parent 6ac0cf9 commit 11a7ee5
File tree
2 files changed
+60
-56
lines changed- lldb/source/Plugins/TypeSystem/Clang
2 files changed
+60
-56
lines changedLines changed: 57 additions & 56 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4725 | 4725 | | |
4726 | 4726 | | |
4727 | 4727 | | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
| 4738 | + | |
| 4739 | + | |
| 4740 | + | |
| 4741 | + | |
| 4742 | + | |
| 4743 | + | |
| 4744 | + | |
| 4745 | + | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
4728 | 4761 | | |
4729 | 4762 | | |
4730 | 4763 | | |
4731 | | - | |
4732 | | - | |
4733 | | - | |
4734 | | - | |
4735 | | - | |
4736 | | - | |
4737 | | - | |
4738 | | - | |
4739 | | - | |
4740 | | - | |
| 4764 | + | |
| 4765 | + | |
4741 | 4766 | | |
4742 | | - | |
4743 | | - | |
4744 | | - | |
4745 | | - | |
4746 | | - | |
4747 | | - | |
4748 | | - | |
4749 | | - | |
4750 | | - | |
4751 | | - | |
4752 | | - | |
4753 | | - | |
4754 | | - | |
4755 | | - | |
4756 | | - | |
4757 | | - | |
4758 | | - | |
4759 | | - | |
4760 | | - | |
4761 | | - | |
4762 | | - | |
4763 | | - | |
4764 | | - | |
4765 | | - | |
4766 | | - | |
4767 | | - | |
4768 | | - | |
4769 | | - | |
4770 | | - | |
4771 | | - | |
4772 | | - | |
4773 | | - | |
4774 | | - | |
4775 | | - | |
4776 | | - | |
4777 | | - | |
4778 | | - | |
4779 | | - | |
4780 | | - | |
4781 | | - | |
4782 | | - | |
4783 | | - | |
4784 | | - | |
4785 | | - | |
4786 | | - | |
4787 | | - | |
| 4767 | + | |
| 4768 | + | |
| 4769 | + | |
| 4770 | + | |
| 4771 | + | |
| 4772 | + | |
| 4773 | + | |
| 4774 | + | |
| 4775 | + | |
| 4776 | + | |
| 4777 | + | |
| 4778 | + | |
| 4779 | + | |
| 4780 | + | |
| 4781 | + | |
| 4782 | + | |
| 4783 | + | |
| 4784 | + | |
| 4785 | + | |
| 4786 | + | |
| 4787 | + | |
4788 | 4788 | | |
| 4789 | + | |
4789 | 4790 | | |
4790 | 4791 | | |
4791 | 4792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1172 | 1172 | | |
1173 | 1173 | | |
1174 | 1174 | | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
1175 | 1178 | | |
1176 | 1179 | | |
1177 | 1180 | | |
| |||
0 commit comments