[clang] [clang][bytecode] Implement __builtin_wmemchr (PR #132254)

2025-03-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132254 None >From d64d8d99a96d85b6048eff9130b29e5126ca9607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 20 Mar 2025 18:10:00 +0100 Subject: [PATCH] [clang][bytecode] Implement __builtin_wme

[clang] [clang][ExprConst] Check record base classes for valid structs (PR #132270)

2025-03-20 Thread Timm Baeder via cfe-commits
@@ -7385,8 +7385,13 @@ class APValueToBufferConverter { for (size_t I = 0, E = CXXRD->getNumBases(); I != E; ++I) { const CXXBaseSpecifier &BS = CXXRD->bases_begin()[I]; CXXRecordDecl *BaseDecl = BS.getType()->getAsCXXRecordDecl(); +const APValue &

[clang] [clang][bytecode] Fix zero-init of atomic floating point objects (PR #132782)

2025-03-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132782 We can't pass the AtomicType along to ASTContext::getFloatTypeSemantics. >From 88ce8a55d9e8fea57ff71989f6a5cd2fe9b505ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 24 Mar 2025 18:13

[clang] [clang][bytecode] Support composite arrays in memcpy op (PR #132775)

2025-03-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/132775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Support overlapping regions in __builtin_memmove (PR #132523)

2025-03-21 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132523 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode][NFC] Add assert to ptrauth_string_discriminator (PR #132527)

2025-03-21 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132527 As pointed out by @shafik, this confuses static analysis and most probably humans as well. Add an assertion to ensure the given array has at least one element. >From ed5dd8936d615c19f7b6d7d3ec607374f28ebf47 M

[clang] [Clang] Introduce __builtin_is_modifiable_lvalue() (PR #132524)

2025-03-21 Thread Timm Baeder via cfe-commits
@@ -964,6 +964,13 @@ def IsConstantEvaluated : LangBuiltin<"CXX_LANG"> { let Prototype = "bool()"; } +def IsLValue : Builtin { + let Spellings = ["__builtin_is_modifiable_lvalue"]; + let Attributes = [NoThrow, CustomTypeChecking, UnevaluatedArguments, +

[clang] [clang][bytecode] Fix __builtin_memmove type diagnostics (PR #132544)

2025-03-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Ignore overflow in unary operators if requested (PR #132557)

2025-03-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Introduce __builtin_is_modifiable_lvalue() (PR #132524)

2025-03-22 Thread Timm Baeder via cfe-commits
tbaederr wrote: > > It looks like this is similar to `__builtin_constant_p` - what is the > > proposed behavior wrt. side effects in the evaluated expression? gcc and > > clang disagree about this a lot currently: https://godbolt.org/z/rbneznT9z > > IIUC this intrinsic shouldn't be similar to

[clang] [clang][bytecode] Ignore overflow in unary operators if requested (PR #132557)

2025-03-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132557 Add PreInc and PreDec ops for this purpose and ignore the overflow if UnaryOperator::canOverflow() returns false. >From 06a6ab84ce28373731bd3750b876f951f849b129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20

[clang] [clang][bytecode][NFC] Use getElemType() in __builtin_memchr as well (PR #132550)

2025-03-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Support composite arrays memcpy op (PR #132775)

2025-03-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132775 See the attached test case. >From f6be93ee0f3c9bfed4de7e1add7c2df9015ef12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 24 Mar 2025 17:40:42 +0100 Subject: [PATCH] [clang][bytecode]

[clang] [clang][bytecode] Redo RUN lines in the builtin-functions test (PR #132762)

2025-03-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132762 Make sure we run each configuration once with the bytecode interpreter and once with the current one. Add a triple to the one that was previously without. >From 0c741db6a105d5ca85cb336d921e5b1c4fb277ec Mon Sep

[clang] [clang][bytecode] Redo RUN lines in the builtin-functions test (PR #132762)

2025-03-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/132762 >From a63d77380e9168a3637167aed365e4f8790aaa08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 24 Mar 2025 16:46:22 +0100 Subject: [PATCH] [clang][bytecode] Redo RUN lines in the builtin

[clang] [clang][bytecode] Redo RUN lines in the builtin-functions test (PR #132762)

2025-03-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/132762 >From 9aaf6643cb37ab1ebf0049b0ee4129b2c1daf6dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 24 Mar 2025 16:46:22 +0100 Subject: [PATCH] [clang][bytecode] Redo RUN lines in the builtin

[clang] [clang][bytecode] Implement __builtin_{wcscmp, wcsncmp} (PR #132723)

2025-03-24 Thread Timm Baeder via cfe-commits
tbaederr wrote: I saw, I hope https://github.com/llvm/llvm-project/pull/132762 fixes the builder https://github.com/llvm/llvm-project/pull/132723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang][bytecode] Redo RUN lines in the builtin-functions test (PR #132762)

2025-03-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/132762 >From 6d483b380bb0c7ffad8afee172dc251372a679e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 24 Mar 2025 16:46:22 +0100 Subject: [PATCH] [clang][bytecode] Redo RUN lines in the builtin

[clang] [clang][bytecode] Implement __builtin_{wcscmp, wcsncmp} (PR #132723)

2025-03-24 Thread Timm Baeder via cfe-commits
tbaederr wrote: If the target is the problem it should still work though, right? If all RUN lines have a triple set, the native triple doesn't matter, e.g. https://github.com/llvm/llvm-project/blob/main/clang/test/AST/ByteCode/builtin-bit-cast-bitfields.cpp does the same thing https://github.

[clang] [clang][bytecode] Redo RUN lines in the builtin-functions test (PR #132762)

2025-03-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode][NFC] use Field::isUnnamedBitField() directly (PR #132914)

2025-03-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Support composite arrays in memcpy op (PR #132775)

2025-03-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix base cast of nullptr without descriptor (PR #132909)

2025-03-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132909 The missing descriptor should only happen if the pointer is null pointer. >From ac98de068f55909a1b8bdd3070de561cd5d913e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 25 Mar 2025 11:1

[clang] [clang][bytecode] Fix base cast of nullptr without descriptor (PR #132909)

2025-03-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132909 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix zero-init of atomic floating point objects (PR #132782)

2025-03-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Check dtor instance pointers for active-ness (PR #128732)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/128732 >From cb69ae95a6134964744580da3ea751387ca9e659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 25 Feb 2025 17:14:36 +0100 Subject: [PATCH] [clang][bytecode] Check dtor instance pointers

[clang] [clang][bytecode] Compile most recent function decl (PR #131730)

2025-03-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/131730 >From 44b5dcaf35e3a0d4ea6ebdc8eacd530658b799d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 18 Mar 2025 05:50:57 +0100 Subject: [PATCH] [clang][bytecode] Compile most recent function

[clang] [clang][bytecode] Compile most recent function decl (PR #131730)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/131730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Compile most recent function decl (PR #131730)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/131730 We used to always do this because all calls went through the code path that calls getMostRecentDecl(). Do it now, too. >From eee0c1cb26452fa0ba96fa842eb7b343751d5baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ti

[clang] [clang][bytecode] Compile functions lazily (PR #131596)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/131596 Create the Function* handles for all functions we see, but delay the actual compilation until we really call the function. This speeds up compile times with the new interpreter a bit. >From e4d74e0e82092e4c46

[clang] [clang][NFC] Fix typo 'initializeation' (PR #131594)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/131594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Fix compound literals within function prototype (PR #132097)

2025-03-19 Thread Timm Baeder via cfe-commits
@@ -7141,7 +7141,13 @@ Sema::BuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo, return ExprError(); LiteralExpr = Result.get(); - bool isFileScope = !CurContext->isFunctionOrMethod(); + // We treat the compound literal as being at file scope if

[clang] [ByteCode] Avoid repeated hash lookups (NFC) (PR #132141)

2025-03-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/132141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

2025-03-19 Thread Timm Baeder via cfe-commits
@@ -1484,6 +1484,18 @@ def ElementwiseSubSat : Builtin { let Prototype = "void(...)"; } +def ElementwiseClz : Builtin { + let Spellings = ["__builtin_elementwise_clz"]; + let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr]; + let Prototype = "void(...)"; +} +

[clang] [clang][bytecode] Fix initialing array struct fields from an APValue (PR #131983)

2025-03-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/131983 We need to recurse once more here and move the array case into the bigger if chain. >From 7fa354a81378172ce3cd5488b457f129da883698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 19 Ma

[clang] [clang][bytecode] Fix initializing array struct fields from an APValue (PR #131983)

2025-03-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/131983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Implement __builtin_constant_p differently (PR #122099)

2025-04-05 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/122099 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Implement __builtin_{wcscmp, wcsncmp} (PR #132723)

2025-04-05 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix union copy/move operator active check (PR #132238)

2025-04-05 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132238 Don't call CheckActive for copy/move operators. They will activate the union member. >From 5729d5f04578ea5628f22bfb3cc71826bdacb9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 20 M

[clang] [clang][bytecode] Redo RUN lines in the builtin-functions test (PR #132762)

2025-04-05 Thread Timm Baeder via cfe-commits
tbaederr wrote: Let's merge this so we can check if the broken builders are fixed. https://github.com/llvm/llvm-project/pull/132762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[clang][bytecode] Implement __builtin_{wcscmp,wcsncmp} (#132… (PR #132963)

2025-03-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132963 …723)" This reverts commit 1e2ad6793ac205607e7c809283cf69e1cc36a69a. Fix the previous commit on big-endian hosts by _not_ falling through to the `uint8_t` code path. >From 0e0e60b041eea2e2561c072d62c5160ff

[clang] [clang][bytecode] Print more info in Block::dump() (PR #133062)

2025-03-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/133062 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fail on mutable reads from revisited variables (PR #133064)

2025-03-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/133064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[clang][bytecode] Implement __builtin_{wcscmp,wcsncmp} (#132… (PR #132963)

2025-03-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/132963 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Print more info in Block::dump() (PR #133062)

2025-03-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/133062 None >From 7a6c4284aa576e29e83b50a121ba2df4e8909079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 26 Mar 2025 10:49:02 +0100 Subject: [PATCH] [clang][bytecode] Print more info in Bloc

[clang] [clang][bytecode] Fail on mutable reads from revisited variables (PR #133064)

2025-03-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/133064 When revisiting a variable, we do that by simply calling visitDecl() for it, which means it will end up with the same EvalID as the rest of the evaluation - but this way we end up allowing reads from mutable v

[clang] [clang][bytecode] Fix various issues with multidimensional arrays (PR #134628)

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/134628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Clear inactive union fields when copying (PR #134982)

2025-04-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/134982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Classify function pointers as PT_Ptr (PR #135026)

2025-04-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/135026 The Pointer class already has the capability to be a function pointer, but we still classifed function pointers as PT_FnPtr/FunctionPointer. This means when converting from a Pointer to a FunctionPointer, we l

[clang] [clang][bytecode][NFC] Avoid implicit integer conversion (PR #134983)

2025-04-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/134983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Classify function pointers as PT_Ptr (PR #135026)

2025-04-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/135026 >From bdfb4c607d2bf7f5f8b83d35de9340be80274d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 9 Apr 2025 15:31:53 +0200 Subject: [PATCH] [clang][bytecode] Classify function pointers as

[clang] [clang] Check `std::initializer_list` more strictly (PR #133822)

2025-03-31 Thread Timm Baeder via cfe-commits
@@ -12071,6 +12071,37 @@ NamespaceDecl *Sema::getOrCreateStdNamespace() { return getStdNamespace(); } +/// Check that the template-head of this class template is acceptable for +/// a declaration of 'std::initializer_list', and optionally diagnose if +/// it is not. +/// \re

[clang] [clang] Check `std::initializer_list` more strictly (PR #133822)

2025-03-31 Thread Timm Baeder via cfe-commits
@@ -12071,6 +12071,37 @@ NamespaceDecl *Sema::getOrCreateStdNamespace() { return getStdNamespace(); } +/// Check that the template-head of this class template is acceptable for +/// a declaration of 'std::initializer_list', and optionally diagnose if +/// it is not. +/// \re

[clang] [clang] Check `std::initializer_list` more strictly (PR #133822)

2025-03-31 Thread Timm Baeder via cfe-commits
@@ -12071,6 +12071,37 @@ NamespaceDecl *Sema::getOrCreateStdNamespace() { return getStdNamespace(); } +/// Check that the template-head of this class template is acceptable for +/// a declaration of 'std::initializer_list', and optionally diagnose if +/// it is not. +/// \re

[clang] [clang][bytecode] Fix comparing the addresses of union members (PR #133852)

2025-04-01 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/133852 Union members get the same address, so we can't just use `Pointer::getByteOffset()`. >From fa0d8971671cb28df72d9a4712f6be951a367145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 1 Ap

[clang] disable unary, vector mask (PR #130400)

2025-03-15 Thread Timm Baeder via cfe-commits
tbaederr wrote: It sounds a little weird to allow the vector+int version only in codegen and not in constant evaluation. If we reject it, we should do that in Sema I think. git blame for `Sema::BuiltinShuffleVector` is all over the place, so pinging @AaronBallman @cor3ntin to see if this goes

[clang] [clang][bytecode] Check dtor instance pointers for active-ness (PR #128732)

2025-03-15 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/128732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Allow relational comparisons between unequal pointers to `void` in constant expressions (PR #89449)

2025-03-15 Thread Timm Baeder via cfe-commits
tbaederr wrote: Closing this since https://github.com/llvm/llvm-project/pull/93046 has been merged. https://github.com/llvm/llvm-project/pull/89449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [clang][bytecode] Fix builtin_memchr with non-0 start index (PR #131633)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/131633 None >From 72ace33d6a7035f193728607095493d1a5d575ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 17 Mar 2025 17:01:38 +0100 Subject: [PATCH] [clang][bytecode] Fix builtin_memchr with

[clang] [clang][bytecode] Check dtor instance pointers for active-ness (PR #128732)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/128732 >From 12b39425cf4eea776835e786de8e6a6975798d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 25 Feb 2025 17:14:36 +0100 Subject: [PATCH] [clang][bytecode] Check dtor instance pointers

[clang] [clang][bytecode] Compile functions lazily (PR #131596)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/131596 >From b6bb99087ad88f50e18610f92f4fb891e0b48d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 16 Mar 2025 09:17:39 +0100 Subject: [PATCH] [clang][bytecode] Compile functions lazily Cre

[clang] [clang][bytecode] Fix various issues with multidimensional arrays (PR #134628)

2025-04-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/134628 >From fff8b1346f0ad80db78be7abb7fa1bca151fc33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 6 Apr 2025 13:15:43 +0200 Subject: [PATCH] [clang][bytecode] Fix various issues with multid

[clang] [clang][bytecode] Fix various issues with multidimensional arrarys (PR #134628)

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/134628 >From 150ff13e9336aaeffa38804037ac99ea8ba71e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 6 Apr 2025 13:15:43 +0200 Subject: [PATCH] [clang][bytecode] Fix various issues with multid

[clang] [clang][bytecode] Fix various issues with multidimensional arrarys (PR #134628)

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/134628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix various issues with multidimensional arrarys (PR #134628)

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/134628 This issue is very convoluted, but in essence, in the new version: For a Pointer P that points to the root of a multidimensional, primitive array: `P.narrow()` does nothing. `P.atIndex(0)` points `P[0]` `P.atI

[clang] [clang][bytecode] Fix various issues with multidimensional arrays (PR #134628)

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/134628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix emitDestruction() for dummy descriptors (PR #134665)

2025-04-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/134665 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Clear inactive union fields when copying (PR #134982)

2025-04-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/134982 When copying unions, we need to only copy the active field of the source union, which we were already doing. However, we also need to zero out the (now) inactive fields, so we don't end up with dangling pointe

[clang] [clang][bytecode][NFC] Avoid implicit integer conversion (PR #134983)

2025-04-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/134983 See discussion in https://github.com/llvm/llvm-project/pull/134672 >From 365ca307b79b524e26ff91165617d23d46f075d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 9 Apr 2025 11:43:25 +02

[clang] [clang][ast]: Add DynamicAllocLValue and TypeInfoLValue support to APValue::dump(). (PR #135178)

2025-04-11 Thread Timm Baeder via cfe-commits
tbaederr wrote: I don't think we can test `DynamicAllocLValue` like this, since we can't save it in the `APValue` for an initialized global. You'll have to add a call to `dump()` e.g. like: ```diff diff --git i/clang/lib/AST/ExprConstant.cpp w/clang/lib/AST/ExprConstant.cpp index d1cc722fb794..

[clang] [clang][bytecode] Fix emitting dtors of zero-sized arrays (PR #134672)

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/134672 Desc->getNumElems() returning 0 made us underflow here. >From 276b187e1d988b26d357052cce239e7eccd0cb4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 7 Apr 2025 17:25:06 +0200 Subject:

[clang] [Clang] Use "syncscope" instead of "synchscope". NFC. (PR #134616)

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/134616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix emitDestruction() for dummy descriptors (PR #134665)

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/134665 This might happen if the referenced declaration is invalid and thus gets a dummy descriptor. We ran into an assertion later on. >From 9143c1118815f3b4a232a8d8029215ecbd2a3955 Mon Sep 17 00:00:00 2001 From: =?U

[clang] [clang][bytecode] Fix comparing zero-sized pointers (PR #135929)

2025-04-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/135929 Add the appropriate diagnostic and fix the d-d case. >From 685749dcf6fbbb4905922ce002180217947ca8f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 16 Apr 2025 08:37:23 +0200 Subject: [

[clang] [clang][bytecode] Reject constexpr-unknown values in CheckStore (PR #136279)

2025-04-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/136279 None >From 7cfafd2b9ee2bb357a6e2ff0f9cacde6f1c1725b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 18 Apr 2025 10:23:40 +0200 Subject: [PATCH] [clang][bytecode] Reject constexpr-unknow

[clang] [clang][bytecode] Reject constexpr-unknown values in CheckStore (PR #136279)

2025-04-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/136279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix an inconsistency with loop condition jumps (PR #135530)

2025-04-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/135530 When emitting the jump for e.g. a for loop condition, we used to jump out of the CondScope, leaving the scope initialized, because we skipped the corresponding Destroy opcode. If that loop was in a loop itself

[clang] [clang][bytecode] Fix an inconsistency with loop condition jumps (PR #135530)

2025-04-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/135530 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Reject constexpr-unknown pointers from Inc ops (PR #135548)

2025-04-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/135548 We used to accept c++ as a known value here, causing wrong codegen. >From a64e39a20719b89dd946f404e83d32026f8db377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 13 Apr 2025 16:25:28 +

[clang] [clang][bytecode] Reject constexpr-unknown pointers from Inc ops (PR #135548)

2025-04-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/135548 >From d26fc41fbfcb7c6c3159e3a7314d84c2ce2785b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 13 Apr 2025 16:25:28 +0200 Subject: [PATCH] [clang][bytecode] Reject constexpr-unknown poin

[clang] [clang][bytecode] Print jump lines in Function::dump() (PR #135482)

2025-04-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/135482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ast]: Add DynamicAllocLValue and TypeInfoLValue support to APValue::dump(). (PR #135178)

2025-04-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/135178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ast]: Add DynamicAllocLValue and TypeInfoLValue support to APValue::dump(). (PR #135178)

2025-04-15 Thread Timm Baeder via cfe-commits
tbaederr wrote: Can you merge this or do you need to someone else to do it for you? https://github.com/llvm/llvm-project/pull/135178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-16 Thread Timm Baeder via cfe-commits
@@ -5238,6 +5238,14 @@ inline bool IsEnumDeclScoped(EnumDecl *ED) { return ED->isScoped(); } +/// Return the integer type corresponding to the given decl. +/// +/// We use this function to break a cycle between the inline definitions in +/// Type.h and Decl.h. +inline QualTy

[clang] [clang][bytecode] Fix bos/bdos with non-zero offset applied (PR #136482)

2025-04-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/136482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add source range to 'use of undeclared identifier' diagnostics (PR #117671)

2025-04-17 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/117671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Check if operator delete calls are in the right frame (PR #136141)

2025-04-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/136141 This is only permitted in a std::allocator::deallocate frame. >From 4774ba70d70a33cde681ab8daba7f7429e131ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 17 Apr 2025 15:44:49 +0200 S

[clang] [clang] Add source range to 'use of undeclared identifier' diagnostics (PR #117671)

2025-04-17 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/117671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Check if operator delete calls are in the right frame (PR #136141)

2025-04-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/136141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-18 Thread Timm Baeder via cfe-commits
@@ -8623,6 +8624,13 @@ inline bool Type::isIntegralOrEnumerationType() const { inline bool Type::isBooleanType() const { if (const auto *BT = dyn_cast(CanonicalType)) return BT->getKind() == BuiltinType::Bool; + if (const EnumType *ET = dyn_cast(CanonicalType)) { ---

[clang] [clang][bytecode] Start implementing __builtin_{,dynamic}_object_size (PR #136478)

2025-04-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/136478 >From 8327fc0f0d06c39386b285b16902838b2dc0af0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 19 Apr 2025 17:29:16 +0200 Subject: [PATCH] [clang][bytecode] Start implementing __builtin

[clang] [clang][bytecode] Start implementing __builtin_{,dynamic}_object_size (PR #136478)

2025-04-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/136478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix bos/bdos with non-zero offset applied (PR #136482)

2025-04-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/136482 Compute the offset from the record layout. Unfortunately, not all the test cases from the current interpreter work. >From b12d6d5ca1bbea0f674b2bd136c1261cb15b6e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=2

[clang] [clang][bytecode] Start implementing __builtin_{,dynamic}_object_size (PR #136478)

2025-04-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/136478 None >From 7cb63cec52f7404c93cc578069cf7065d318248c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 19 Apr 2025 17:29:16 +0200 Subject: [PATCH] [clang][bytecode] Start implementing __b

[clang] [clang][bytecode] Diagnose failed MemberPtrPtr casts differently (PR #136407)

2025-04-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/136407 Return Invalid() here instead of just false to match the diagnostic output of the current interpreter. >From 1446ab0c9e4c6b32d330777221b2f5ebc63beb02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?

[clang] [clang][bytecode] Allow reinterpret casts from/to the same pointer type (PR #136692)

2025-04-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/136692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Allow casts from void* only in std::allocator calls (PR #136714)

2025-04-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/136714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Allow reinterpret casts from/to the same pointer type (PR #136692)

2025-04-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/136692 None >From dfd494236fd57172cfddfd0db6789321e1662ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 22 Apr 2025 14:17:42 +0200 Subject: [PATCH] [clang][bytecode] Allow reinterpret casts

[clang] [clang][bytecode] Fix two small builtin_constant_p cases (PR #137587)

2025-04-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/137587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix ia32_addcarry/subborrow (PR #137642)

2025-04-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/137642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    18   19   20   21   22   23   24   25   26   27   >