[clang] [clang] Avoid evaluating the BitWidth expression over and over again (PR #66203)

2023-09-14 Thread Timm Baeder via cfe-commits
tbaederr wrote: @cor3ntin Looking at this again... while I'd also like to see the general solution, I'd probably apply this anyway since it makes it clearer that this function can actually be fast. Its name is terrible for what it does. It sounds like it's a simply getter but in reality it mig

[clang] [clang][doc] Add documentation for the ASTs used to represent C++ templates (PR #66436)

2023-09-15 Thread Timm Baeder via cfe-commits
tbaederr wrote: TBH, not sure if the UML diagrams would really help anyone understand what's going on. https://github.com/llvm/llvm-project/pull/66436 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang][Interp] Handle AttributedStmts (PR #66495)

2023-09-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/66495 Just ignore the attributes. >From c1c216058408cf54771bfdac71b0bcf28110f292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 15 Sep 2023 12:55:04 +0200 Subject: [PATCH] [clang][Interp] Han

[clang] [clang][Interp] Add IntegralAP for arbitrary-precision integers (PR #65844)

2023-09-15 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/65844 >From db98faff4cfc86657ee8f47dac0e1e2a441049b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 9 Sep 2023 10:34

[clang] [clang][Interp] Handle AttributedStmts (PR #66495)

2023-09-15 Thread Timm Baeder via cfe-commits
@@ -628,6 +630,12 @@ bool ByteCodeStmtGen::visitAsmStmt(const AsmStmt *S) { return this->emitInvalid(S); } +template +bool ByteCodeStmtGen::visitAttributedStmt(const AttributedStmt *S) { + // Ignore all attributes. tbaederr wrote: > Is this what we want

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

2023-09-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/66514 Add some primitive syntax highlighting to our code snippet output. Before: ![Screenshot from 2023-09-15 16-00-23](https://github.com/llvm/llvm-project/assets/49720664/8e43767a-d939-4c9f-ac2d-65e2df5de1f2) Af

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

2023-09-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/66514 >From 85e868765f37e09b922ff00869f1f1a7ff1ebd9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 15 Sep 2023 15:51:39 +0200 Subject: [PATCH] [clang][Diagnostics] Highlight code snippets Ad

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

2023-09-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/66514 >From 7ff6c1b8cb0fed5c4365f560f546b8f1c9d975c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 15 Sep 2023 15:51:39 +0200 Subject: [PATCH] [clang][Diagnostics] Highlight code snippets Ad

[clang] [clang][Interp] Handle AttributedStmts (PR #66495)

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

[clang] [clang][Interp] Three-way comparisons (PR #65901)

2023-09-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/65901 >From 1b76f3b46359c7a688bc5cefc15254253fb57e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 10 Sep 2023 17:02:22 +0200 Subject: [PATCH] [clang][Interp] Three-way comparisons --- clan

[clang] [clang][Interp] Add IntegralAP for arbitrary-precision integers (PR #65844)

2023-09-15 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , 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/65844 >From 1e61f47f0978446915cf250b017ea68b0e271d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Da

[clang] [clang][Interp] Three-way comparisons (PR #65901)

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

[clang] [clang][Interp] Add IntegralAP for arbitrary-precision integers (PR #65844)

2023-09-18 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?= Message-ID: In-Reply-To: tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/65844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [clang][Diagnostics] Fix wrong line number display (PR #65238)

2023-09-03 Thread Timm Baeder via cfe-commits
tbaederr wrote: In 8554a55d041f2c7de329adda538cadf7eeb6e8a8, this was added to fix a range with a lower begin source location than `Loc` is, so I think this change would break that? https://github.com/llvm/llvm-project/pull/65238 ___ cfe-commits mail

[clang] [Clang] Fix missing diagnostic for non-standard layout type in `offsetof` (PR #65246)

2023-09-04 Thread Timm Baeder via cfe-commits
tbaederr wrote: Okay, makes sense to me. Should probably also be backported to 17. https://github.com/llvm/llvm-project/pull/65246 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix missing diagnostic for non-standard layout type in `offsetof` (PR #65246)

2023-09-04 Thread Timm Baeder via cfe-commits
tbaederr wrote: @cor3ntin Yes, I wrote this in the wrong PR :facepalm: https://github.com/llvm/llvm-project/pull/65246 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Diagnostics] Fix wrong line number display (PR #65238)

2023-09-04 Thread Timm Baeder via cfe-commits
tbaederr wrote: Okay, makes sense to me. Should probably also be backported to 17. https://github.com/llvm/llvm-project/pull/65238 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][TSA] (PR #65462)

2023-09-06 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= https://github.com/tbaederr review_requested https://github.com/llvm/llvm-project/pull/65462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][TSA] (PR #65462)

2023-09-06 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= https://github.com/tbaederr review_requested https://github.com/llvm/llvm-project/pull/65462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][TSA] (PR #65462)

2023-09-06 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= https://github.com/tbaederr review_requested https://github.com/llvm/llvm-project/pull/65462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][TSA] (PR #65462)

2023-09-06 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/65462: None >From 20aa3e3225f6ea48df00ea05bcbfcc5cc2278af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 8 Aug 2023 14:11:33 +0200 Subject: [PATCH 1/2] [clang][CFG]

[clang] [clang][TSA] (PR #65462)

2023-09-06 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= https://github.com/tbaederr review_requested https://github.com/llvm/llvm-project/pull/65462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][TSA] (PR #65462)

2023-09-06 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= https://github.com/tbaederr review_requested https://github.com/llvm/llvm-project/pull/65462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][TSA] Consider cleanup functions for thread safety analysis (PR #65462)

2023-09-06 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/65462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [clang] e7f55bb - [clang][Interp][NFCI] Call* ops don't modify the PC

2023-04-08 Thread Timm Baeder via cfe-commits
On 08.04.23 14:25, Aaron Ballman wrote: On Sat, Apr 8, 2023 at 2:50 AM Timm Bäder via cfe-commits wrote: Author: Timm Bäder Date: 2023-04-08T08:49:22+02:00 New Revision: e7f55bbdb880eb0c096b05d915ee920fe1f2fb98 URL: https://github.com/llvm/llvm-project/commit/e7f55bbdb880eb0c096b05d915ee920

[clang] [clang][Interp] Do r-to-l conversion immediately when returning (PR #80662)

2024-02-14 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -119,12 +121,26 @@ template bool EvalEmitter::emitRet(const SourceInfo &Info) { template <> bool EvalEmitter::emitRet(const SourceInfo &Info) { if (!isActive()) return true; - EvalResult.set

[clang] [clang][Interp] Do r-to-l conversion immediately when returning (PR #80662)

2024-02-14 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/80662 >From c10713b9a6494aa052541c4ac3a296d83a890867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 14 Feb 2024 15:2

[clang] [llvm] [clang] Use separator for large numeric values in overflow diagnostic (PR #80939)

2024-02-14 Thread Timm Baeder via cfe-commits
@@ -2187,6 +2188,12 @@ void APInt::toString(SmallVectorImpl &Str, unsigned Radix, bool Signed, } } + // Number of digits in a group between separators. + unsigned Grouping = (Radix == 8 || Radix == 10) ? 3 : 4; + if (Radix == 8 || Radix == 10) { +Grouping = 3; +

[clang] [clang][Interp] Do r-to-l conversion immediately when returning (PR #80662)

2024-02-14 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/80662 >From b93916c9798ea09488e30b9b0aae9e54ef0b1956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 15 Feb 2024 07:03:58 +0100 Subject: [PATC

[clang] [clang][Interp] Do r-to-l conversion immediately when returning (PR #80662)

2024-02-15 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/80662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Emit const references for Float arguments (PR #79753)

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

[clang] [clang][Interp] Handle complex values in visitBool() (PR #79452)

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

[clang] [clang][NFC] Regroup declarations in `Sema` (PR #82217)

2024-02-19 Thread Timm Baeder via cfe-commits
tbaederr wrote: > 11,427 additions, 11,178 deletions not shown because the diff is too large. > Please use a local Git client to view these changes. Never seen that before, haha. https://github.com/llvm/llvm-project/pull/82217 ___ cfe-commits mailing

[clang] [clang][Interp] Handle complex values in visitBool() (PR #79452)

2024-02-19 Thread Timm Baeder via cfe-commits
@@ -125,3 +125,7 @@ struct XY { int before; struct XX xx, *xp; float* after; } xy[] = { 0, // all-warning {{initializer overrides prior initialization of this subobject}} &xy[2].xx.a, &xy[2].xx, &global_float }; + +const int A = ((_Complex double)1.0 ? 21 :

[clang] [clang][Interp] Handle complex values in visitBool() (PR #79452)

2024-02-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/79452 >From 720f2f869a11dd7c905f8d91180f3eb517ab9279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 25 Jan 2024 15:20:52 +0100 Subject: [PATCH] [clang][Interp] Handle complex values in visitBo

[clang] [clang][Interp] Handle complex values in visitBool() (PR #79452)

2024-02-19 Thread Timm Baeder via cfe-commits
@@ -2120,8 +2074,15 @@ bool ByteCodeExprGen::visitInitializer(const Expr *E) { template bool ByteCodeExprGen::visitBool(const Expr *E) { std::optional T = classify(E->getType()); - if (!T) + if (!T) { +// Convert complex values to bool. +if (E->getType()->isAnyCom

[clang] [clang][Interp] Handle complex values in visitBool() (PR #79452)

2024-02-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/79452 >From c1a7132cb9cf1773358c70a750af3b66213990d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 25 Jan 2024 15:20:52 +0100 Subject: [PATCH] [clang][Interp] Handle complex values in visitBo

[clang] [clang][Interp] Handle complex values in visitBool() (PR #79452)

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

[clang] [clang][Interp] Emit const references for Float arguments (PR #79753)

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

[clang] fix: constexpr bit_cast with empty base classes (PR #82383)

2024-02-22 Thread Timm Baeder via cfe-commits
tbaederr wrote: > This will need a release note. I'm curious why the removed code was there in > the first place. Any idea @tbaederr ? No idea, it's been there since the original commit introducing `__builtin_bit_cast`. Maybe just an optimization, or maybe something else in that loop used to

[clang] [clang] Implement CWG2759 "`[[no_unique_address]` and common initial sequence" (PR #82607)

2024-02-22 Thread Timm Baeder via cfe-commits
@@ -19033,6 +19033,11 @@ static bool isLayoutCompatible(ASTContext &C, FieldDecl *Field1, return false; } + if (Field1->hasAttr() || + Field2->hasAttr()) { +return false; + } + tbaederr wrote: ```suggestion if (Field1->hasAttr() ||

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-02-22 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping @cor3ntin @cjdb https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Docs] Simpler syntax for Github links. (PR #82746)

2024-02-23 Thread Timm Baeder via cfe-commits
tbaederr wrote: Love it, but I'm slightly worried about "Fixes #" vs. "see also #" etc. being the same now, since you removed the "Fixes" prefix. https://github.com/llvm/llvm-project/pull/82746 ___ cfe-commits mailing list cfe-commits@lists.l

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

2024-07-03 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/70306 >From a2213c595637d63b48658d2532e00b08fd05427f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 4 Jul 2024 07:26:27 +0200 Subject: [PATCH

[clang] [Parser][ObjC] Add -Wobjc-prefix-length warning option. (PR #97597)

2024-07-04 Thread Timm Baeder via cfe-commits
@@ -204,6 +204,89 @@ void Parser::CheckNestedObjCContexts(SourceLocation AtLoc) Diag(Decl->getBeginLoc(), diag::note_objc_container_start) << (int)ock; } +/// An Objective-C public name (a class name or protocol name) is +/// expected to have a prefix as all names are in a

[clang] Refactor clang::Linkage (PR #80063)

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

[clang] [clang-tools-extra] [compiler-rt] clang::Linkage #71049 (PR #80064)

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

[clang] [clang][bytecode] Allow continuing when discarded MemberExpr Base fails (PR #107231)

2024-09-04 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107231 We don't need the value in this case, since we're discarding it anyway. Allow continuing the interpretation but note the side effect. >From 696b77b7c85f79fddb2b88f04c78933acd769d12 Mon Sep 17 00:00:00 2001 Fro

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-09-04 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,118 @@ +// RUN: %clang_cc1 -std=c++23 -verify %s + +using size_t = decltype(sizeof(0)); + +namespace std { +struct type_info { + const char* name() const noexcept(true); +}; +} + +template +constexpr size_t array_size(T (&)[N]) { + return N; +} + +void use_array(int

[clang] [clang][bytecode] Implement comparsion operators for vector type (PR #107258)

2024-09-05 Thread Timm Baeder via cfe-commits
@@ -1222,6 +1224,117 @@ bool Compiler::VisitComplexBinOp(const BinaryOperator *E) { return true; } +template +bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { + assert(E->getType()->isVectorType()); + + // FIXME: Current only support comparison binary operator,

[clang] [clang][bytecode] Implement comparsion operators for vector type (PR #107258)

2024-09-05 Thread Timm Baeder via cfe-commits
@@ -1222,6 +1224,117 @@ bool Compiler::VisitComplexBinOp(const BinaryOperator *E) { return true; } +template +bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { + assert(E->getType()->isVectorType()); + + // FIXME: Current only support comparison binary operator,

[clang] [clang][bytecode] Implement comparsion operators for vector type (PR #107258)

2024-09-05 Thread Timm Baeder via cfe-commits
@@ -1222,6 +1224,117 @@ bool Compiler::VisitComplexBinOp(const BinaryOperator *E) { return true; } +template +bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { + assert(E->getType()->isVectorType()); tbaederr wrote: Add an assertion that both LH

[clang] [clang][bytecode] Implement comparsion operators for vector type (PR #107258)

2024-09-05 Thread Timm Baeder via cfe-commits
@@ -1222,6 +1224,105 @@ bool Compiler::VisitComplexBinOp(const BinaryOperator *E) { return true; } +template +bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { + assert(E->getType()->isVectorType()); + assert(E->getLHS()->getType()->isVectorType()); + assert(E-

[clang] [clang][bytecode] Fix reinterpret casts of two non-primitive types (PR #107564)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107564 We don't want to allow e.g. cast from a record to an array or the other way arround. >From dda02f67ba68beba4564bae52374849724fd19ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 5 Se

[clang] [clang][bytecode] Fix two-pointer-style std::initializer_lists (PR #107565)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107565 The first pointer needs to point to the first element of the underlying array. This requires some changes to how we handle array expansion >From 8968151c4773910e6f85d9273899432556376300 Mon Sep 17 00:00:00 200

[clang] [clang][bytecode] Implement comparsion operators for vector type (PR #107258)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/107258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Allow continuing when discarded MemberExpr Base fails (PR #107231)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/107231 >From 6bfbb1b280490a18d817d9ef0be0491925a0a9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 4 Sep 2024 14:32:32 +0200 Subject: [PATCH] [clang][bytecode] Allow continuing when discarde

[clang] [clang][bytecode] Allow continuing when discarded MemberExpr Base fails (PR #107231)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/107231 >From 44b14f24196f4ff407dfa020f441690b1203f847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 4 Sep 2024 14:32:32 +0200 Subject: [PATCH] [clang][bytecode] Allow continuing when discarde

[clang] [clang][ExprConst] Allow comparisons with string literals (PR #106733)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/106733 >From 73af678c4c405cff16d5baf668e78e736bb1d228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 30 Aug 2024 15:52:48 +0200 Subject: [PATCH] [clang][ExprConst] Allow comparisons with strin

[clang] [clang][ExprConst] Allow comparisons with string literals (PR #106733)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/106733 >From 7dbb01805663a6671c61330c5abc04c44146cc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 30 Aug 2024 15:52:48 +0200 Subject: [PATCH] [clang][ExprConst] Allow comparisons with strin

[clang] [clang][bytecode] Implement placement-new (PR #107033)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/107033 >From 19abb83b47cbbdfac84dd5a30ff01e3f55e2d4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Sep 2024 02:52:35 +0200 Subject: [PATCH] [clang][bytecode] Implement placement-new ---

[clang] [clang][bytecode] Only visit local variables if they have constant init (PR #107576)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107576 See the comment I added for why this is weird. We might want to have a different mechanism for this in the future. >From 7149533c281d2e7c9a3e669336645776bf03c9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=2

[clang] [clang][ExprConst] Allow comparisons with string literals (PR #106733)

2024-09-06 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/106733 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix reinterpret casts of two non-primitive types (PR #107564)

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

[clang] [clang][bytecode] Only visit local variables if they have constant init (PR #107576)

2024-09-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/107576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Only visit local variables if they have constant init (PR #107576)

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

[clang] [clang][bytecode] Implement __builtin_operator{new,delete} (PR #107672)

2024-09-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107672 None >From fbdde33e018a721bab026dcffb4af22987cc7366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 7 Sep 2024 09:10:00 +0200 Subject: [PATCH] [clang][bytecode] Implement __builtin_oper

[clang] [clang][bytecode] Allow continuing when discarded MemberExpr Base fails (PR #107231)

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

[clang] [clang][bytecode] Implement __builtin_operator{new,delete} (PR #107672)

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

[clang] [clang][bytecode] Implement using operator new/operator delete (PR #107679)

2024-09-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107679 Reuse the __builtin_operator_{new,delete} implementations. >From 654bc52d1e947d52942878a6a50c73053814d565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 7 Sep 2024 10:52:40 +0200 Subje

[clang] [clang][bytecode] Implement logical operators for vector type (PR #107678)

2024-09-07 Thread Timm Baeder via cfe-commits
@@ -1267,7 +1268,15 @@ bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { auto getElem = [=](unsigned Offset, unsigned Index) { if (!this->emitGetLocal(PT_Ptr, Offset, E)) return false; -return this->emitArrayElemPop(ElemT, Index, E); +if (!this->em

[clang] [clang][bytecode] Implement logical operators for vector type (PR #107678)

2024-09-07 Thread Timm Baeder via cfe-commits
@@ -1300,6 +1309,16 @@ bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { if (!this->emitGT(ElemT, E)) return false; break; +case BO_LAnd: + // a && b is equivalent to a!=0 & b!=0 tbaederr wrote: I was trying to prove this

[clang] [clang][bytecode] Implement logical operators for vector type (PR #107678)

2024-09-07 Thread Timm Baeder via cfe-commits
@@ -15,6 +15,7 @@ #include "PrimType.h" #include "Program.h" #include "clang/AST/Attr.h" +#include "clang/AST/OperationKinds.h" tbaederr wrote: What is this needed for? A call to `isLogicalOp()` was already in the file before. https://github.com/llvm/llvm-pr

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-09-07 Thread Timm Baeder via cfe-commits
tbaederr wrote: CC @AaronBallman for an opinion about the AST represenation https://github.com/llvm/llvm-project/pull/105789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Implement using operator new/operator delete (PR #107679)

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

[clang] [clang][bytecode] Fix two-pointer-style std::initializer_lists (PR #107682)

2024-09-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107682 The first pointer needs to point to the first element of the underlying array. This requires some changes to how we handle array expansion >From 4067ab666b9fbfb05b6a22c14de1eededebcb16f Mon Sep 17 00:00:00 200

[clang] [clang][bytecode] Fix two-pointer-style std::initializer_lists (PR #107682)

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

[clang] [clang][bytecode] Add InitLinkScope for temporary variables (PR #106552)

2024-09-07 Thread Timm Baeder via cfe-commits
tbaederr wrote: In this code: ```c++ namespace ExplicitThisInTemporary { struct B { B *p = this; }; constexpr bool g(B b) { return &b == b.p; } static_assert(g({}), ""); } ``` The AST for the `static_assert` expr is: ``` CallExpr 0x5219ed98 '_Bool' |-ImplicitCastExpr 0x5219ed78 '_Bo

[clang] [clang][bytecode] Implement logical operators for vector type (PR #107678)

2024-09-07 Thread Timm Baeder via cfe-commits
@@ -1300,6 +1309,16 @@ bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { if (!this->emitGT(ElemT, E)) return false; break; +case BO_LAnd: + // a && b is equivalent to a!=0 & b!=0 tbaederr wrote: Not sure how one would imp

[clang] [clang][bytecode] Implement logical operators for vector type (PR #107678)

2024-09-07 Thread Timm Baeder via cfe-commits
@@ -1267,7 +1268,15 @@ bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { auto getElem = [=](unsigned Offset, unsigned Index) { if (!this->emitGetLocal(PT_Ptr, Offset, E)) return false; -return this->emitArrayElemPop(ElemT, Index, E); +if (!this->em

[clang] [clang][bytecode] Implement logical operators for vector type (PR #107678)

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

[clang] [clang][bytecode] Fix a variable scope problem with continue/break jumps (PR #107738)

2024-09-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107738 Cleaning up _all_ the scopes is a little too much. Only clean up until the point here we started the scope relevant for the break/continue statement. >From 0de29f7ce0b2e2fd6e153de6c2bd4e7d44a74872 Mon Sep 17 0

[clang] [clang][bytecode] Fix a variable scope problem with continue/break jumps (PR #107738)

2024-09-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/107738 >From 17478ebc579cbbaceb9d54ad114b8633112f1f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 8 Sep 2024 07:30:40 +0200 Subject: [PATCH] [clang][bytecode] Fix a variable scope problem w

[clang] [clang][bytecode] Fix a variable scope problem with continue/break jumps (PR #107738)

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

[clang] [clang][bytecode] Fix local destructor order (PR #107951)

2024-09-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107951 Add appropriate scopes and use reverse-order iteration in LocalScope::emitDestructors(). >From 71688d27b5fc5a9af0218e42ed38847a2d07a7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue,

[clang] [clang][bytecode] Fix local destructor order (PR #107951)

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

[clang] [clang][bytecode] Fix lookup in source locations in implicit ctors (PR #107992)

2024-09-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107992 Implicit functions may still have a body. The !hasBody() check is enough. >From 336d735f9c40987b3c31d3422747d403dd6d6165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 10 Sep 2024 11:3

[clang] [clang][bytecode] Fix lookup in source locations in implicit ctors (PR #107992)

2024-09-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/107992 >From 8b5a1fbba508c4e88fd00f2ee6b310dae762855e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 10 Sep 2024 11:39:38 +0200 Subject: [PATCH] [clang][bytecode] Fix lookup in source location

[clang] [clang][bytecode] Fix lookup of source locations in implicit ctors (PR #107992)

2024-09-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/107992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix lookup of source locations in implicit ctors (PR #107992)

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

[clang] [clang][bytecode] Check for Pointer dereference in EvaluationResult (PR #108207)

2024-09-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/108207 We will deref<>() it later, so this is the right check. >From 7f27917b46e254bacc7214ef40d6a61f0db0e92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 11 Sep 2024 14:16:58 +0200 Subject

[clang] [clang][bytecode] Check for Pointer dereference in EvaluationResult (PR #108207)

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

[clang] [Clang][Interp] Fix display of syntactically-invalid note for member function calls (PR #102170)

2024-08-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/102170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Start implementing unions and changing the active member (PR #102723)

2024-08-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102723 None >From 5d00cf049b64bf31a6039c1c4761dca64483a4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 9 Aug 2024 15:30:30 +0200 Subject: [PATCH] [clang][Interp] Start implementing unions

[clang] [clang][Interp] Start implementing unions and changing the active member (PR #102723)

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

[clang] [clang][Interp] Improve "in call to" call argument printing (PR #102735)

2024-08-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102735 Always go through toAPValue() first and pretty-print that. In the future, I think we could get rid of the individual toDiagnosticString() implementations. This way we also get the correct printing for floats.

[clang] [clang][Interp] Improve "in call to" call argument printing (PR #102735)

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

[clang] [clang][Interp] Do not call dtors of union members (PR #102739)

2024-08-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102739 None >From f4ccc8a5d705bcc0eb6a573f24b0bc3e80aa7b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 10 Aug 2024 11:21:25 +0200 Subject: [PATCH] [clang][Interp] Do not call dtors of unio

[clang] [clang][Interp] Do not call dtors of union members (PR #102739)

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

[clang] [clang][Interp] Handle nested unions (PR #102743)

2024-08-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102743 None >From 8d950c9e1a98bc5dd7134b6bd476cca96916c621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 10 Aug 2024 12:47:38 +0200 Subject: [PATCH] [clang][Interp] Handle nested unions ---

<    5   6   7   8   9   10   11   12   13   14   >