6 Commits

Author SHA1 Message Date
Chris B
28ddbd4a86
[NFC] Refactor ConstantArrayType size storage (#85716)
In PR #79382, I need to add a new type that derives from
ConstantArrayType. This means that ConstantArrayType can no longer use
`llvm::TrailingObjects` to store the trailing optional Expr*.

This change refactors ConstantArrayType to store a 60-bit integer and
4-bits for the integer size in bytes. This replaces the APInt field
previously in the type but preserves enough information to recreate it
where needed.

To reduce the number of places where the APInt is re-constructed I've
also added some helper methods to the ConstantArrayType to allow some
common use cases that operate on either the stored small integer or the
APInt as appropriate.

Resolves #85124.
2024-03-26 14:15:56 -05:00
Timm Bäder
183b6b56f2 [clang][Interp] Ignore unnamed bitfields when checking init
Unnamed bitfields need to be ignored here.
2024-02-27 17:29:19 +01:00
Timm Bäder
2e43ca49d0 [clang][Interp] Check variable initialization in Ret op
Just like we did with the l-to-r conversion, we need to do this
while the data is still alive.
2024-02-16 12:05:03 +01:00
Timm Bäder
60732c0fae [clang][Interp][NFC] Remove superfluous return statement 2024-02-05 13:05:52 +01:00
Timm Bäder
75c4339ef3 [clang][Interp][NFC] Implement dumping Invalid/Valid results
This was just an omission from an earlier commit, clearly
we can print them.
2024-02-02 09:25:54 +01:00
Timm Baeder
4e7cf1b1ed
[clang][Interp] Add an EvaluationResult class (#71315)
Add an `EvaluationResult` class. This contains the result either as a
`Pointer` or as a `APValue`.

This way, we can inspect the result of the evaluation and diagnose
problems with it (e.g. uninitialized fields in global initializers or
pointers pointing to things they shouldn't point to).
2024-01-19 10:08:03 +01:00