aboutsummaryrefslogtreecommitdiff
path: root/clang/test/AST/ByteCode
AgeCommit message (Collapse)AuthorFilesLines
3 days[clang][bytecode] Diagnose volatile writes (#160350)Timm Baeder2-5/+58
7 days[clang][bytecode] Don't crash on a null Descriptor (#160506)Timm Baeder1-0/+13
... for dynamic memory allocation. This happens when the requested array size is too large. Fixes #152951
7 days[clang][bytecode][test] Disable a bitcast test on s390x (#160452)Timm Baeder1-0/+3
Fixes #160374
8 days[clang][bytecode] Fix unknown size arrays crash in clang bytecode (#160015)Osama Abdelkader1-0/+13
Fixes #153948 Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
8 days[clang][bytecode] Remove bogus Initializing special case (#159933)Timm Baeder1-0/+6
This doesn't seem to be needed anymore and causes problems. Fixes #159787
8 days[clang][bytecode] Only block pointers can be partially initialized (#160075)Timm Baeder1-4/+11
So ignore the rest in `checkFullyInitialized()`. Fixes #160071
8 days[clang][bytecode] Load value of non-lvalue ArraySubscriptExpr (#160024)Timm Baeder1-0/+4
As happens in C. Fixes #158482
9 days[clang][bytecode][test] Enable a few tests in const-eval.c (#160034)Timm Baeder1-11/+1
They didn't use to work but do now.
12 days[clang][bytecode] Typecheck called function pointers more thorougly (#159757)Timm Baeder1-10/+8
Fix two older FIXME items from the `functions.cpp` test.
2025-09-16[clang][bytecode] Improve error detection in BitCastPrim op (#158575)Timm Baeder1-1/+16
Reject bitcasts to pointer types unless it's to `nullptr_t` and always reject bitcasts to member pointer types. Fixes #156174
2025-09-15[Clang] [Sema] Make `-Wincompatible-pointer-types` an error by default (#157364)Sirraide2-3/+3
GCC 14 also made this an error by default, so we’re following suit. Fixes #74605
2025-09-15[clang][bytecode] Disable int128 test if unsupportedTimm Bäder1-1/+3
This broke the armv8-quick builder: https://lab.llvm.org/buildbot/#/builders/154/builds/21492
2025-09-15[clang][bytecode] Check for dummy pointers in CopyArray op (#158543)Timm Baeder1-0/+12
They can't be written to or read from. Fixes #158535
2025-09-15[clang][bytecode] Fix bit casts to IntAP types (#158509)Timm Baeder1-0/+41
They were left out. Fixes #153920
2025-09-11[offload][OpenMP] Remove device code for num_threads strict (#157893)Robert Imschweiler1-3/+3
Due to potential performance issues, this commit temporarily removes support for the num_threads 'strict' modifier and its corresponding message and severity clauses on the device.
2025-09-11[clang][bytecode] Check builtin carryops for dummy pointers (#157490)Timm Baeder1-0/+7
Fixes #157422
2025-09-11[clang][bytecode] Check reads for null block pointers (#157695)Timm Baeder1-1/+17
All pointer types can be null, so check that independently from the pointer type. Fixes #157650
2025-09-11[clang][bytecode] Check strlen impl for primitive arrays (#157494)Timm Baeder1-0/+19
Fixes #157428
2025-09-04[clang][bytecode] Create implicit variables for wider base types (#156658)Timm Baeder1-0/+11
If we create an implicit local variable for a derived-to-base cast, we still should allocate enough space for the entire derived type. Fixes #156219
2025-09-04[clang][bytecode] Reject null pointers in CheckStore() (#156645)Timm Baeder1-0/+5
In the attached test case, the global variable later only points to gargbage, because the MaterializeTemporaryExpr used to initialize it is a local variable, which is gone by the time we try to evaluate the store. Fixes #156223
2025-09-04[clang][bytecode] Reject final ltor casts on string literals (#156669)Timm Baeder1-2/+18
Similar to what the current interpreter does.
2025-08-30Fixup test added in #155573 to work when the compiler defaults to C++20. ↵dyung1-4/+4
(#156166) The test added in #155573 assumes the compiler defaults to the current default of C++17. If the compiler is changed to default to C++20, the test fails because the expected warnings about a construct being a C++20 extension are no longer emitted. This change fixes up the test to work in either C++17 or C++20 mode by disabling the warning and removing the check for it as this is not what is being tested here.
2025-08-30[clang][bytecode] Fix ignoring comparisons in C (#156180)Timm Baeder1-0/+6
Our comparison ops always return bool, and we do the pop before the conversion to in in C. Fixes #156178
2025-08-29[clang][bytecode] Handle negative array sizes in constexpr `new` instead of ↵Samarth Narang1-0/+22
asserting (#155737) This patch fixes a crash in the constexpr interpreter when evaluating `new T[n]` with a negative element count. Fixes https://github.com/llvm/llvm-project/issues/152904
2025-08-27[clang][bytecode] Reject dependent RequiresExprs (#155230)Timm Baeder1-0/+14
Fixes #152899
2025-08-27[clang][bytecode] Handle vector assignments (#155573)Timm Baeder1-0/+25
2025-08-26[Clang] Support generic bit counting builtins on fixed boolean vectors (#154203)Joseph Huber1-0/+4
Summary: Boolean vectors as implemented in clang can be bit-casted to an integer that is rounded up to the next primitive sized integer. Users can do this themselves, but since the counting bits are very likely to be used with bitmasks like this and the generic forms are expected to be generic it seems reasonable that we handle this case directly.
2025-08-26[clang][bytecode] Don't call getIndex() on one-past-end pointers (#155173)Timm Baeder1-0/+2
That doesn't work. Fixes #152903
2025-08-26[clang][bytecode] Error if calls have fewer arguments than parameters (#155151)Timm Baeder1-0/+11
Shouldn't happen, but does. Fixes #155147
2025-08-26[clang][bytecode] Check that a ltor cast to a complex value is possible ↵Timm Baeder1-0/+4
(#155152) When we get to this point, the pointer might _not_ be backed by a primitive array, so the later code will fail. Fixes #155144
2025-08-26Reapply "[clang][bytecode] Fix incorrect offset in elem() (#155157)" (#155276)Timm Baeder1-0/+8
This reverts commit 9642aadf7064192164d1687378d28d6bda1978c9. Since elem() only works on primitive arrays anyway, we don't have to do the isArrayRoot() check at all.
2025-08-25Revert "[clang][bytecode] Fix incorrect offset in elem() (#155157)"Timm Bäder1-8/+0
This reverts commit 0f4db1a7955e511844d7a685103aa32617fc279d. This breaks the armv8-quick builder: https://lab.llvm.org/buildbot/#/builders/154/builds/20676
2025-08-25[clang][bytecode] Fix incorrect offset in elem() (#155157)Timm Baeder1-0/+8
We need to use the base offset in both cases. Also, add additional assertions to make sure we don't miss this case again. Fixes #155132
2025-08-21[Clang] Fix incorrect return type for `__builtin_shufflevector` (#154817)Joseph Huber1-1/+6
Summary: The `__builtin_shufflevector` call would return a GCC vector in all cases where the vector type was increased. Change this to preserve whether or not this was an extended vector. Fixes: https://github.com/llvm/llvm-project/issues/107981
2025-08-21[clang][bytecode] Implement Pointer::getType() for function pointers (#154788)Timm Baeder1-0/+5
Fixes #152920
2025-08-21[clang][bytecode] Guard strcmp against differing element types (#154777)Timm Baeder1-0/+9
This can happen when casts are involved. Fixes #154006
2025-08-21[clang][bytecode] Fix a crash in Destroy op (#154695)Timm Baeder1-0/+12
The local we're destroying might've been created for an expression, in which case asDecl() on the DeclDesc returns nullptr. Fixes #152958
2025-08-21[clang][bytecode] Fix a crash with typeid pointers (#154692)Timm Baeder1-1/+13
That code is from a time when typeid pointers didn't exist. We can get there for non-block, non-integral pointers, but we can't meaningfully handle that case. Just return false. Fixes #153712
2025-08-21[clang][bytecode] Check for unknown size array pointers in InitField* (#154689)Timm Baeder1-0/+20
This can happen when the base pointer is an unknown size array, where !isOnePastEnd(), but isPastEnd(). Fixes #153990
2025-08-21[clang][bytecode] Call CheckFinalLoad in all language modes (#154496)Timm Baeder1-4/+20
Fixes #153997
2025-08-20[clang][bytecode] Diagnose one-past-end reads from global arrays (#154484)Timm Baeder1-0/+4
Fixes #154312
2025-08-20[clang][bytecode] Fix comparing pointers to union members (#154342)Timm Baeder1-0/+12
If one of them is a one-past-end pointer.
2025-08-19[clang][bytecode] Move pointers from extern globals to new decls (#154273)Timm Baeder1-0/+7
2025-08-19[clang][bytecode] Create temporary before discarding CXXConstructExpr (#154280)Timm Baeder2-8/+24
Fixes #154110
2025-08-19[clang][bytecode][NFC] use both-note in literals test (#154277)Timm Baeder1-8/+6
And harmonize the RUN lines.
2025-08-19[clang][bytecode] Save a per-block dynamic allocation ID (#154094)Timm Baeder1-4/+2
This fixes an old todo item about wrong allocation counting and some diagnostic differences.
2025-08-18[clang][bytecode] Always track item types in InterpStack (#151088)Timm Baeder1-0/+9
This has been a long-standing problem, but we didn't use to call the destructors of items on the stack unless we explicitly `pop()` or `discard()` them. When interpretation was interrupted midway-through (because something failed), we left `Pointer`s on the stack. Since all `Block`s track what `Pointer`s point to them (via a doubly-linked list in the `Pointer`), that meant we potentially leave deallocated pointers in that list. We used to work around this by removing the `Pointer` from the list before deallocating the block. However, we now want to track pointers to global blocks as well, which poses a problem since the blocks are never deallocated and thus those pointers are always left dangling. I've tried a few different approaches to fixing this but in the end I just gave up on the idea of never knowing what items are in the stack. We already have an `ItemTypes` vector that we use for debugging assertions. This patch simply enables this vector unconditionally and uses it in the abort case to properly `discard()` all elements from the stack. That's a little sad IMO but I don't know of another way of solving this problem. As expected, this is a slight hit to compile times: https://llvm-compile-time-tracker.com/compare.php?from=574d0a92060bf4808776b7a0239ffe91a092b15d&to=0317105f559093cfb909bfb01857a6b837991940&stat=instructions:u
2025-08-18[clang][bytecode] Disable EndLifetime op for array elements (#154119)Timm Baeder2-7/+26
This breaks a ton of libc++ tests otherwise, since calling std::destroy_at will currently end the lifetime of the entire array not just the given element. See https://github.com/llvm/llvm-project/issues/147528
2025-08-18[clang][bytecode] Improve __builtin_{,dynamic_}object_size implementation ↵Timm Baeder1-0/+87
(#153601)
2025-08-17[clang][bytecode] Fix pseudo dtor calls on non-pointers (#153970)Timm Baeder1-0/+43
The isGLValue() check made us ignore expressions we shouldn't ignore.