Timm Baeder
3b8a18c27a
[clang][bytecode] Fix contains check using llvm::find ( #149050 )
...
We need to compare to the end() interator.
2025-07-16 13:26:10 +02:00
Timm Baeder
b54e02a40b
[clang][bytecode] Check pointer data type for bitcast eligibility ( #146552 )
...
So we get the proper type for a heap-allocated value.
2025-07-01 20:37:09 +02:00
Timm Baeder
857ffa1915
[clang][bytecode] Recursively start lifetimes as well ( #141742 )
...
The constructor starts the lifetime of all the subobjects.
2025-05-28 16:16:00 +02:00
Timm Baeder
294643e4bd
[clang][bytecode] Check lifetime of all ptr bases in placement-new ( #141272 )
...
placement-new'ing an object with a dead base object is not allowed, so
we need to check all the pointer bases.
2025-05-24 14:17:26 +02:00
Timm Baeder
319feac43d
[clang][bytecode] Fix AccessKinds in placement new CheckStore() call ( #141123 )
...
CheckStore is for assignments, but we're constructing something here, so
pass AK_Construct instead. We already diagnosed the test case, but as an
assignment.
2025-05-23 13:00:57 +02:00
Timm Baeder
32805964fc
[clang][bytecode] Diagnose placement-new'ing to a temporary ( #141099 )
...
... that's been created in a different evaluation.
2025-05-23 08:17:22 +02: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
3b8f9a228c
[clang][bytecode] Loosen assertion This() for array elements ( #130399 )
...
getRecord() returns null on array elements, even for composite arrays.
The assertion here was overly restrictive and having an array element as
instance pointer should be fine otherwise.
2025-03-08 13:13:52 +01:00
Timm Baeder
ceaf6e912a
[clang][bytecode] Support ImplicitValueInitExpr for multi-dim arrays ( #117312 )
...
The attached test case from
https://github.com/llvm/llvm-project/issues/117294 used to cause an
assertion because we called classifPrim() on an array type.
The new result doesn't crash but isn't exactly perfect either. Since the
problem arises when evaluating an ImplicitValueInitExpr, we have no
proper source location to point to. Point to the caller instead.
2024-11-25 12:15:31 +01:00
Timm Baeder
87b6ec3be6
[clang][bytecode] Diagnose placement-new construction to inactive field ( #114047 )
...
We can reuse CheckActive() for this.
2024-10-29 15:08:41 +01:00
Timm Baeder
9d0616ce52
[clang][bytecode] Ignore explicit calls to trivial dtors ( #112841 )
...
This is what the current interpreter does as well.
2024-10-18 09:45:02 +02:00
Timm Baeder
5d08625347
[clang][bytecode] Activate pointers in Init{,Pop} ( #112832 )
2024-10-18 07:38:22 +02:00
Timm Baeder
03888a9046
[clang][bytecode] Handle non-arrays in initElem{,Pop} ( #112719 )
...
... provided the given index is 0. Skip the atIndex() in that case.
2024-10-17 19:07:47 +02:00
Timm Baeder
d9b377d8b1
[clang][bytecode] Don't produce a null type when checking new exprs ( #110252 )
...
getType() might give us the right type already, so use that instead of
calling getPointeeType() for all CXXNewExprs.
2024-09-27 17:48:43 +02:00
Timm Baeder
4bd3a62cd6
[clang][bytecode] Fix diagnosing std::construct_at with wrong type ( #109828 )
...
We can't make the assumption that types are always fine in std
functions.
2024-09-25 08:00:32 +02:00
Timm Baeder
4b96400240
[clang][bytecode] Allow placement-new in std functions pre-C++26 ( #109753 )
2024-09-24 10:28:54 +02:00
Timm Baeder
c712ab829b
[clang][bytecode] Implement placement-new ( #107033 )
...
If we have a placement-new destination already, use that instead of
allocating a new one.
Tests are partially based on
`test/SemaCXX/cxx2c-constexpr-placement-new.cpp`.
2024-09-23 13:26:49 +02:00