12 Commits

Author SHA1 Message Date
Timm Baeder
849e5ea94f
[clang][bytecode] Add Descriptor::getDataType() (#132681)
This returns the type of data in the Block, which might be different
than the type of the expression or declaration we created the block for.
This lets us remove some special cases from CheckNewDeleteForms() and
CheckNewTypeMismatch().
2025-03-24 09:47:52 +01:00
Timm Baeder
c51d396f4d
[clang][bytecode] Fix __builtin_memmove type diagnostics (#132544)
Set the source type when allocating primitives so we can later retrieve
it.
2025-03-22 14:58:32 +01:00
Timm Baeder
06fc7d68ff
[clang][bytecode] Don't error out on incomplete declarations (#129685)
Later operations on these are invalid, but the declaration is fine, if
extern.
2025-03-04 12:41:34 +01:00
Timm Baeder
4dd29ebb8d
[clang][bytecode][NFC] Move incorrect LLVM_PREFERRED_TYPE attribute (#128740)
Looks like this was accidentally added after the bitfield and thus
didn't work.
2025-03-03 19:37:22 +01:00
Timm Baeder
2c1e9f14be
[clang][bytecode] Explicit composite array descriptor types (#129376)
When creating descriptor for array element types, we only save the
original source, e.g. int[2][2][2]. So later calls to getType() of the
element descriptors will also return int[2][2][2], instead of e.g.
int[2][2] for the second dimension.
Fix this by explicitly tracking the array types.
The last attached test case used to have an lvalue offset of 32 instead
of 24.

We should do this for more desriptor types though and not just composite
array, but I'm leaving that to a later patch.
2025-03-02 09:40:56 +01:00
Timm Baeder
d64cf19983
[clang][bytecode] Add Descriptor::dumpFull (#127386)
This is useful to print all (or most) of the valid offsets into a block
of the given descriptor.
2025-02-16 12:15:43 +01:00
Timm Baeder
ee25a85ccc
[clang][bytecode] Handle CXXPseudoDestructorExprs (#125835)
Make lifetime management more explicit. We're only using this for
CXXPseudoDestructorExprs for now but we need this to handle
std::construct_at/placement-new after destructor calls later anyway.
2025-02-05 12:40:30 +01:00
Kazu Hirata
23fbaff9a3
[ByteCode] Migrate away from PointerUnion::{is,get,dyn_cast} (NFC) (#115809)
Note that PointerUnion::{is,get,dyn_cast} have been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>
2024-11-11 22:49:58 -08:00
Timm Baeder
800b07396f
[clang][bytecode] Change isArrayElement() for narrowed composite arrays (#111110)
Make isArrayElement() return true here, so we can know that such a
pointer is in fact an array element and handle it properly in
toAPValue().
2024-10-04 14:19:32 +02:00
Timm Baeder
3ea55d3cb0
[clang][bytecode] Add a source location to destructor calls (#110121)
The added test case is still diagnosed differently, but I'm not sure
which version is better.
2024-09-26 16:50:56 +02:00
Timm Baeder
a69ba0a5f9
[clang][bytecode][NFC] Get rid of const_casts in Move fns (#105698) 2024-08-23 09:16:22 +02:00
Timm Baeder
a07aba5d44
[clang] Rename all AST/Interp stuff to AST/ByteCode (#104552)
"Interp" clashes with the clang interpreter and people often confuse
this.
2024-08-16 17:13:12 +02:00