[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-12-12 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?=

[clang] [clang][Interp] Implement IntegralAP::{div, rem} (PR #72614)

2023-12-11 Thread Timm Baeder via cfe-commits
@@ -44,6 +44,24 @@ static_assert(MulA * MulB == 50, ""); // ref-error {{not an integral constant ex static_assert(MulA * 5 == 25, ""); static_assert(-1 * MulB == -7, ""); + +constexpr _BitInt(4) DivA = 2; +constexpr _BitInt(2) DivB = 1; +static_assert(DivA / DivB == 2, "");

[clang] [clang][Interp] Diagnose reads from non-const global variables (PR #71919)

2023-12-11 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -1005,12 +1008,23 @@ bool SetThisField(InterpState , CodePtr OpPC, uint32_t I) { template ::T> bool GetGlobal(InterpState , CodePtr OpPC, uint32_t I) { const Block *B = S.P.getGlobal(I); + + if (!CheckConstant(S, OpPC,

[clang] [clang][Interp] Reject static lambdas with captures (PR #74718)

2023-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/74718 >From cb0cb30f9caea7d73a2bb09068f7187ac3b94408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 7 Dec 2023 14:19:52 +0100 Subject: [PATCH] [clang][Interp] Reject static lambdas with

[clang] [clang][Interp] Implement inc/dec for IntegralAP (PR #69597)

2023-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/69597 >From d97047b5ac828e8ed3cfbe606ed4c3616dc5ee44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 18 Oct 2023 15:36:13 +0200 Subject: [PATCH] [clang][Interp] Implement inc/dec for

[clang] [clang] Crash when referencing capture in static lambda (PR #74661)

2023-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/74661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement __builtin_rotate{right, left} (PR #72984)

2023-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/72984 >From 1a2bda9e9b28a4f99e723bf6265cb769e048a315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 21 Nov 2023 13:44:07 +0100 Subject: [PATCH] [clang][Interp] Implement

[clang] [clang][Interp] Implement __builtin_rotate{right, left} (PR #72984)

2023-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/72984 >From d728e5a0a38ee24040b360c3aa53ba9575d5c897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 21 Nov 2023 13:44:07 +0100 Subject: [PATCH] [clang][Interp] Implement

[clang] [clang][Interp] Decay arrays to the first element (PR #72660)

2023-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/72660 >From b7277a29fe5bee1197e7ef93730265a9152e36c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 17 Nov 2023 15:54:02 +0100 Subject: [PATCH] [clang][Interp] Decay pointers to the first

[clang] [clang][Interp] Fix float->int casts overflowing (PR #72658)

2023-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/72658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Don't diagnose undefined functions when checking... (PR #75051)

2023-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/75051 ... for a potential constant expression. They are not defined now, but might be defined later when the function is actually called. >From 74d11ff5c8bd2dbc641e2d602cd3d463f02f59f6 Mon Sep 17 00:00:00 2001 From:

[clang] [clang][Interp] Implement __builtin_rotate{right, left} (PR #72984)

2023-12-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/72984 >From 71ee39aaf9e962701168290394333654a22ed918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 21 Nov 2023 13:44:07 +0100 Subject: [PATCH] [clang][Interp] Implement

[clang] [clang][Interp] IndirectMember initializers (PR #69900)

2023-12-08 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/69900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Use array filler expression (PR #72865)

2023-12-08 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Handle std::move etc. builtins (PR #70772)

2023-12-08 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/70772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Decay arrays to the first element (PR #72660)

2023-12-08 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72660 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement inc/dec for IntegralAP (PR #69597)

2023-12-08 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/69597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Fix float->int casts overflowing (PR #72658)

2023-12-08 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add an EvaluationResult class (PR #71315)

2023-12-08 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/71315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Diagnose reads from non-const global variables (PR #71919)

2023-12-08 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/71919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement IntegralAP::{div, rem} (PR #72614)

2023-12-08 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72614 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add inline descriptor to global variables (PR #72892)

2023-12-08 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72892 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Interp] Implement __builtin_rotate{right, left} (PR #72984)

2023-12-08 Thread Timm Baeder via cfe-commits
@@ -331,3 +331,17 @@ namespace bitreverse { char bitreverse3[__builtin_bitreverse32(0x12345678) == 0x1E6A2C48 ? 1 : -1]; char bitreverse4[__builtin_bitreverse64(0x0123456789ABCDEFULL) == 0xF7B3D591E6A2C480 ? 1 : -1]; } + +namespace rotateleft { + char

[clang] [clang][Interp] Implement builtin_expect (PR #69713)

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

[clang] [Clang][C++20] Implement constexpr std::bit_cast for bit-fields (& [Sema] Print more static_assert exprs) (PR #74775)

2023-12-08 Thread Timm Baeder via cfe-commits
tbaederr wrote: I don't have the capacity to review this properly, but the changes to the `static_assert` diagnostics should be split out IMO. https://github.com/llvm/llvm-project/pull/74775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-12-07 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?=

[clang] [clang][Interp] Reject static lambdas with captures (PR #74718)

2023-12-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/74718 A version of #74661 for the new interpreter. It didn't crash before, but we did emit a few non-sensical diagnostics. >From 6ac52b644cbd5e12ad13e6c3c2bf84b96ec5f3b8 Mon Sep 17 00:00:00 2001 From:

[clang] [clang] Crash when referencing capture in static lambda (PR #74661)

2023-12-07 Thread Timm Baeder via cfe-commits
@@ -8492,14 +8492,24 @@ bool LValueExprEvaluator::VisitVarDecl(const Expr *E, const VarDecl *VD) { return false; if (auto *FD = Info.CurrentCall->LambdaCaptureFields.lookup(VD)) { + auto *MD = cast(Info.CurrentCall->Callee); tbaederr wrote:

[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

2023-12-06 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -1894,6 +1894,8 @@ void TypePrinter::printAttributedAfter(const AttributedType *T, case attr::ArmMveStrictPolymorphism:

[clang] [clang] Use current rounding mode for float inc/dec (PR #73770)

2023-11-30 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/73770 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use current rounding mode for float inc/dec (PR #73770)

2023-11-29 Thread Timm Baeder via cfe-commits
@@ -4623,10 +4623,12 @@ struct IncDecSubobjectHandler { if (Old) *Old = APValue(Value); APFloat One(Value.getSemantics(), 1); +llvm::RoundingMode RM = +E->getFPFeaturesInEffect(Info.Ctx.getLangOpts()).getRoundingMode(); tbaederr wrote:

[clang] [clang] fix typo (PR #73644)

2023-11-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/73644 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement builtin_expect (PR #69713)

2023-11-27 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/69713 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement __builtin_ffs (PR #72988)

2023-11-27 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/72988 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement __builtin_rotate{right, left} (PR #72984)

2023-11-27 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Use array filler expression (PR #72865)

2023-11-27 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] IndirectMember initializers (PR #69900)

2023-11-27 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/69900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Handle std::move etc. builtins (PR #70772)

2023-11-27 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/70772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Fix float->int casts overflowing (PR #72658)

2023-11-27 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Decay arrays to the first element (PR #72660)

2023-11-27 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72660 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement __builtin_bit_cast (PR #68288)

2023-11-27 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?=

[clang] [Clang] Eagerly instantiate used constexpr function upon definition. (PR #73463)

2023-11-27 Thread Timm Baeder via cfe-commits
tbaederr wrote: Does this have any compile-time impact? https://github.com/llvm/llvm-project/pull/73463 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add an EvaluationResult class (PR #71315)

2023-11-27 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/71315 >From 047249032d70e486380e8790915a8edeb70add56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 27 Nov 2023 12:10:48 +0100 Subject:

[clang] [clang][Interp] Implement inc/dec for IntegralAP (PR #69597)

2023-11-27 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/69597 >From 047249032d70e486380e8790915a8edeb70add56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 27 Nov 2023 12:10:48 +0100 Subject:

[clang] [clang][Interp] Diagnose reads from non-const global variables (PR #71919)

2023-11-27 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/71919 >From 047249032d70e486380e8790915a8edeb70add56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 27 Nov 2023 12:10:48 +0100 Subject:

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-11-27 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?=

[clang] [clang] Print static_assert values of arithmetic binary operators (PR #71671)

2023-11-27 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/71671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Interp] Implement __builtin_bit_cast (PR #68288)

2023-11-27 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -0,0 +1,455 @@ +//===--- InterpBitcast.cpp - Interpreter for the constexpr

[clang] [clang] Classify vector types in __builtin_classify_type (PR #73299)

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

[clang] [clang] Print static_assert values of arithmetic binary operators (PR #71671)

2023-11-24 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/71671 >From 0724e6cdf2cc532a7b29eff9162265b6845ffef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 8 Nov 2023

[clang] [clang] Classify vector types in __builtin_classify_type (PR #73299)

2023-11-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/73299 None >From 6cfc5a63c2f8c3346fa3272c826074fa74da5e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 24 Nov 2023 10:09:12 +0100 Subject: [PATCH] [clang] Classify vector types in

[clang] [clang] Print static_assert values of arithmetic binary operators (PR #71671)

2023-11-23 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/71671 >From a4db205a672220282735af1c7fcee1b47b334dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 8 Nov 2023 13:32:41 +0100 Subject:

[clang] [clang] Print static_assert values of arithmetic binary operators (PR #71671)

2023-11-23 Thread Timm Baeder via cfe-commits
@@ -17219,10 +17219,10 @@ static bool UsefulToPrintExpr(const Expr *E) { if (const auto *UnaryOp = dyn_cast(E)) return UsefulToPrintExpr(UnaryOp->getSubExpr()); - // Ignore nested binary operators. This could be a FIXME for improvements - // to the diagnostics in the

[clang] [clang] Print static_assert values of arithmetic binary operators (PR #71671)

2023-11-23 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/71671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement dynamic memory allocation handling (PR #70306)

2023-11-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/70306 >From 29270191a209af2d8bcf270c84a87d6fa456fa0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 25 Oct 2023 08:33:30 +0200 Subject: [PATCH] [clang][Interp] Implement dynamic memory

[clang] [clang][Interp] Diagnose reads from non-const global variables (PR #71919)

2023-11-23 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/71919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement IntegralAP::{div, rem} (PR #72614)

2023-11-23 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/72614 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add inline descriptor to global variables (PR #72892)

2023-11-23 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/72892 >From b5360dd44bd5d8f10287e0a3641b0846e051a5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 20 Nov 2023

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2023-11-22 Thread Timm Baeder via cfe-commits
@@ -2231,6 +2231,13 @@ static bool CheckLValueConstantExpression(EvalInfo , SourceLocation Loc, return false; } + if (Info.getLangOpts().C23) { +auto *VarD = dyn_cast_or_null(BaseVD); +if (VarD && VarD->isConstexpr() && !LVal.isNullPointer()) { +

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2023-11-22 Thread Timm Baeder via cfe-commits
@@ -8605,6 +8620,27 @@ static bool checkForConflictWithNonVisibleExternC(Sema , const T *ND, return false; } +static bool CheckC23ConstexprVarTypeQualifiers(Sema , +SourceLocation VarLoc, QualType T) { + if (const auto *A =

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2023-11-22 Thread Timm Baeder via cfe-commits
@@ -4110,6 +4117,10 @@ static CompleteObject findCompleteObject(EvalInfo , const Expr *E, } bool IsConstant = BaseType.isConstant(Info.Ctx); +bool ConstexprVar = false; +if (const auto *VD = dyn_cast_or_null( tbaederr wrote: ```suggestion

[clang] [clang][Interp] Implement builtin_expect (PR #69713)

2023-11-21 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/69713 >From 64dbeb52f05dd9c5b9559ed3de571cb87959f63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 20 Oct 2023 14:16:22 +0200 Subject: [PATCH] [clang][Interp] Implement builtin_expect ---

[clang] [clang][Interp] Implement __builtin_ffs (PR #72988)

2023-11-21 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/72988 None >From efd400e2f928cfa2bd062c549a02bcbed5c8f95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 21 Nov 2023 13:44:07 +0100

[clang] [clang][Interp] Implement __builtin_rotate{right, left} (PR #72984)

2023-11-21 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/72984 Tests are from test/Sema/constant-builtins-2.c again. >From efd400e2f928cfa2bd062c549a02bcbed5c8f95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 21 Nov 2023 13:44:07 +0100 Subject:

[clang] [clang][Interp] Add inline descriptor to global variables (PR #72892)

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

[clang] [clang][Interp] Add inline descriptor to global variables (PR #72892)

2023-11-21 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/72892 >From b5360dd44bd5d8f10287e0a3641b0846e051a5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 20 Nov 2023 11:53:40 +0100 Subject:

[clang] [clang][Interp] Add inline descriptor to global variables (PR #72892)

2023-11-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/72892 Some time ago, I did a similar patch for local variables. Initializing global variables can fail as well: ```c++ constexpr int a = 1/0; static_assert(a == 0); ``` ... would succeed in the new interpreter,

[clang] [clang][Interp] Use array filler expression (PR #72865)

2023-11-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/72865 This is obviously not what we should ideally do, but the current state is also broken. We are just leaving the other elements uninitialized and rely on them being zero-ed. >From

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-11-20 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?=

[clang] [clang][Interp] IndirectMember initializers (PR #69900)

2023-11-19 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/69900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add an EvaluationResult class (PR #71315)

2023-11-19 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/71315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement inc/dec for IntegralAP (PR #69597)

2023-11-19 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/69597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Handle std::move etc. builtins (PR #70772)

2023-11-17 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/70772 >From 5436d89e4ca3fbb1d53f27f8d5347f3eff100dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 31 Oct 2023 07:17:16 +0100 Subject:

[clang] [clang][Interp] Implement __builtin_classify_type (PR #71972)

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

[clang] [clang][Interp] Decay arrays to the first element (PR #72660)

2023-11-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/72660 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Decay pointers to the first element (PR #72660)

2023-11-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/72660 I _think_ this makes sense to do here. This way we have a pointer to the first element on the stack. >From 7ea07d2aa8be337e1ff4ff2e28ae407c57a382fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?=

[clang] [clang][Interp] Fix float->int casts overflowing (PR #72658)

2023-11-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/72658 If S.noteUndefinedBehavior() returns true, we will continue evaluation and need a value on the stack. >From 070102561f8af1916b860225c79f07009cf368b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?=

[clang] [clang][Interp] Implement builtin_expect (PR #69713)

2023-11-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/69713 >From e11a956d0389b1c0ed4ed54a908c3498dba2aba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 20 Oct 2023 14:16:22 +0200 Subject: [PATCH] [clang][Interp] Implement builtin_expect ---

[clang] [clang][Interp] Implement __builtin_classify_type (PR #71972)

2023-11-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/71972 >From 2aedc41694c554900c87993f77cbc87ae6ed52ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 10 Nov 2023 19:33:21 +0100 Subject: [PATCH] [clang][Interp] Implement

[clang] [clang] Add bitint classification for __builtin_classify_type (PR #72036)

2023-11-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/72036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Print static_assert values of arithmetic binary operators (PR #71671)

2023-11-16 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/71671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement __builtin_bitreverse (PR #71687)

2023-11-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/71687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement IntegralAP::{div, rem} (PR #72614)

2023-11-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/72614 None >From 5fe32770c2c95cb8c7604983edc264f16edf5821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 16 Nov 2023 18:05:17 +0100 Subject: [PATCH] [clang][Interp] Implement

[clang] [clang][Interp] Implement IntegralAP::mul() (PR #72491)

2023-11-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/72491 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

2023-11-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/72015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add bitint classification for __builtin_classify_type (PR #72036)

2023-11-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/72036 >From ed41b0889b6da62fa30757ce185f516f3af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 11 Nov 2023 18:44:13 +0100 Subject: [PATCH] [clang] Add bitint classification for

[clang] [clang][Interp] Diagnose reads from non-const global variables (PR #71919)

2023-11-16 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/71919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement bitwise operations for IntegralAP (PR #71807)

2023-11-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/71807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement IntegralAP::mul() (PR #72491)

2023-11-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/72491 None >From 9d97134dc0d1b93ac5368f5014bf180317725175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 16 Nov 2023 09:26:27 +0100 Subject: [PATCH] [clang][Interp] Implement

[clang] [clang][Interp] Implement __builtin_classify_type (PR #71972)

2023-11-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/71972 >From b4a4ce956f4aa6c084d112d519fe98eb9f585559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 10 Nov 2023 19:33:21 +0100 Subject: [PATCH] [clang][Interp] Implement

[clang] [clang][Interp] Implement __builtin_classify_type (PR #71972)

2023-11-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/71972 >From ddda59905a49415c9c5387d7a05ed4cf768cb74b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 10 Nov 2023 19:33:21 +0100 Subject: [PATCH] [clang][Interp] Implement

[clang] [clang][Interp] Implement __builtin_bitreverse (PR #71687)

2023-11-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/71687 >From f10454ffa4337726e6f3b324a38ffc1fd381b54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 8 Nov 2023 15:51:44 +0100 Subject: [PATCH] [clang][Interp] Implement __builtin_bitreverse

[clang] [clang][Interp] Implement __builtin_clrsb (PR #72243)

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

[clang] [clang] Add bitint classification for __builtin_classify_type (PR #72036)

2023-11-15 Thread Timm Baeder via cfe-commits
@@ -217,6 +217,8 @@ Non-comprehensive list of changes in this release (e.g., ``uint16x8_t``), this returns the constant number of elements at compile-time. For scalable vectors, e.g., SVE or RISC-V V, the number of elements is not known at compile-time and is

[clang] [clang][Interp] Implement __builtin_clrsb (PR #72243)

2023-11-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/72243 >From 03dfcf6bc645aaadda0d25358871dca811d5bd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 14 Nov 2023 12:42:03 +0100 Subject: [PATCH] [clang][Interp] Implement __builtin_clrsb ---

[clang] [clang][Interp] Implement __builtin_parity (PR #71662)

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

[clang] [clang][Interp] Implement __builtin_bitreverse (PR #71687)

2023-11-15 Thread Timm Baeder via cfe-commits
@@ -59,13 +59,54 @@ static void pushInt(InterpState , int32_t Val) { llvm_unreachable("Int isn't 16 or 32 bit?"); } -static bool retInt(InterpState , CodePtr OpPC, APValue ) { - PrimType IntType = getIntPrimType(S); - if (IntType == PT_Sint32) -return Ret(S, OpPC,

[clang] [clang][Interp] Implement IntegralAP subtraction (PR #71648)

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

[clang] [clang][Interp] Implement bitwise operations for IntegralAP (PR #71807)

2023-11-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/71807 >From 72b46d891d34e7c0810bec335221a109cf4fb3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 9 Nov 2023 14:29:51 +0100 Subject: [PATCH] [clang][Interp] Implement bitwise operations for

[clang] [clang][Interp] Implement inc/dec for IntegralAP (PR #69597)

2023-11-14 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/69597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   6   7   8   9   10   >