Commit a878ed1
committed
[lldb][TypeSystemClang][NFC] Clean up TypeSystemClang::GetBitSize (llvm#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.
(cherry picked from commit 11a7ee5)1 parent 21406e9 commit a878ed1
1 file changed
+23
-58
lines changedLines changed: 23 additions & 58 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4956 | 4956 | | |
4957 | 4957 | | |
4958 | 4958 | | |
4959 | | - | |
4960 | | - | |
4961 | | - | |
4962 | | - | |
4963 | | - | |
4964 | | - | |
4965 | | - | |
4966 | | - | |
4967 | | - | |
4968 | | - | |
4969 | | - | |
4970 | | - | |
4971 | 4959 | | |
4972 | | - | |
4973 | | - | |
4974 | | - | |
4975 | | - | |
4976 | | - | |
4977 | | - | |
4978 | | - | |
4979 | | - | |
4980 | | - | |
4981 | | - | |
4982 | | - | |
4983 | | - | |
4984 | | - | |
4985 | | - | |
4986 | | - | |
4987 | | - | |
4988 | | - | |
4989 | | - | |
4990 | | - | |
4991 | | - | |
4992 | | - | |
4993 | | - | |
4994 | | - | |
4995 | | - | |
4996 | | - | |
4997 | | - | |
4998 | | - | |
4999 | | - | |
5000 | | - | |
5001 | | - | |
5002 | | - | |
5003 | | - | |
5004 | | - | |
5005 | | - | |
5006 | | - | |
5007 | | - | |
5008 | | - | |
5009 | | - | |
5010 | | - | |
5011 | | - | |
5012 | | - | |
5013 | | - | |
5014 | | - | |
5015 | | - | |
5016 | | - | |
5017 | | - | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
| 4963 | + | |
| 4964 | + | |
| 4965 | + | |
| 4966 | + | |
| 4967 | + | |
| 4968 | + | |
| 4969 | + | |
| 4970 | + | |
| 4971 | + | |
| 4972 | + | |
| 4973 | + | |
| 4974 | + | |
| 4975 | + | |
| 4976 | + | |
| 4977 | + | |
5018 | 4978 | | |
| 4979 | + | |
| 4980 | + | |
| 4981 | + | |
| 4982 | + | |
| 4983 | + | |
5019 | 4984 | | |
5020 | 4985 | | |
5021 | 4986 | | |
| |||
0 commit comments