[clang] [clang][bytecode] Fix #55390 here as well (PR #106395)

2024-08-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/106395 Ignore the multiplication overflow but report the 0 denominator. >From 7b1cfea20ae76a7b04ae63bf6d6082488c17b2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 28 Aug 2024 15:50:10 +020

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-28 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,120 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [clang][bytecode] Diagnose array-to-pointer decays of dummy pointers (PR #106366)

2024-08-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/106366 We have type information for them now, so we can do this. >From 670598d602949cee9bc8cbfe563563aa699d8505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 28 Aug 2024 12:58:29 +0200 Subje

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-28 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,120 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-28 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,120 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

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

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr commented: Are these the only unary operators supported on vectors or are more to come? Since all (except for `+`, which doesn't do anything) cases call `prepareResult()` and `createTemp()` unconditionally, it would probably be cleaner to reject the unhandled cases

[clang] [NFC] Comment fix: "does specify state that" -> "does specify that" (PR #106338)

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

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-27 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-27 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [NFC][Clang][Interp] Rename `clang::interp::State::getCtx` to `clang::interp::State::getASTContext` (PR #106071)

2024-08-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. LGTM if the CI comes back green, but we use "[clang][bytecode]" (all lowercase) in the commit message now. https://github.com/llvm/llvm-project/pull/106071 ___ cfe-commits mailing list cfe-commit

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,149 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOp(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); + + if

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -139,6 +139,7 @@ class Compiler : public ConstStmtVisitor, bool>, bool VisitGNUNullExpr(const GNUNullExpr *E); bool VisitCXXThisExpr(const CXXThisExpr *E); bool VisitUnaryOperator(const UnaryOperator *E); + bool VisitVectorUnaryOp(const UnaryOperator *E); ---

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,88 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify tbaederr wrote: Why no RUN line for the current interpreter? https://github.com/llvm/llvm-project/pull/

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,149 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOp(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); + + if

[clang] [clang][bytecode][NFC] Add an additional assertion (PR #105927)

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

[clang] [clang][bytecode][NFC] Add an additional assertion (PR #105927)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105927 Since this must be true, add an assertion instead of just documenting it via the comment. >From 65ac59cb18b097251c7e6083f785562ba6278d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat,

[clang] [clang][bytecode] Fix IntegralAP::is{Positive, Negative} (PR #105924)

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

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

2024-08-23 Thread Timm Baeder via cfe-commits
tbaederr wrote: > > I guess it might make sense to create the `ConstantExpr` in any case, even > > for a `None` `APValue`? > > The comment above `ConstantFoldAttrArgs` seems to suggest that that’s what’s > supposed to happen if the expression isn’t dependent—I don’t know if there’s > any code

[clang] [clang][bytecode] Fix IntegralAP::is{Positive, Negative} (PR #105924)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105924 This depends on signed-ness. >From c773015150b8a93a37cd6121091a2072b6df5710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 24 Aug 2024 07:16:54 +0200 Subject: [PATCH] [clang][bytecode]

[clang] [clang][bytecode][NFC] Remove containsErrors check from visitInitializer (PR #105811)

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

[clang] [clang][bytecode][NFC] Remove containsErrors check from visitInitializer (PR #105811)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105811 None >From f3e08fd46b07c83eaae700301c2e0c59743c0d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 23 Aug 2024 12:43:50 +0200 Subject: [PATCH] [clang][bytecode][NFC] Remove containsErr

[clang] [clang][bytecode] Reject void InitListExpr differently (PR #105802)

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

[clang] [clang][bytecode][NFC] Remove containsErrors() check from delegate (PR #105804)

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

[clang] [clang][bytecode][NFC] Remove containsErrors() check from delegate (PR #105804)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105804 This check was removed a while ago from visit(), remove it from delegate() as well. >From 94a4986d8074bc2dbb4aa7ed11d4cf39cf963444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 23 Au

[clang] [clang][bytecode] Reject void InitListExpr differently (PR #105802)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105802 This reverts c79d1fa540390f6e37e1ea326153559eeadd0de6 and 125aa10b3d645bd26523a1bc321bb2e6b1cf04e1 Instead, use the previous approach but allow void-typed InitListExprs with 0 initializers. >From ea0509c618a

[clang] [clang][bytecode][NFC] Get rid of const_casts in Move fns (PR #105698)

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

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

2024-08-23 Thread Timm Baeder via cfe-commits
tbaederr wrote: I guess it might make sense to create the `ConstantExpr` in any case, even for a `None` `APValue`? Dumping the `ConstantExpr` didn't print any `APValue` though, so I was assuming that it ignores `None` anyway. https://github.com/llvm/llvm-project/pull/105789 ___

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

2024-08-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105789 Evaluating the attribute expression can be successful without resulting in a value. Namely, when the expression is of type void. >From 920eb8d753070b72b8ba0b2766333d7db9bed0a9 Mon Sep 17 00:00:00 2001 From:

[clang] [clang][bytecode] Reject void InitListExpr differently (PR #105697)

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

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

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

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-22 Thread Timm Baeder via cfe-commits
tbaederr wrote: No problem, I know how confusing this can be :) https://github.com/llvm/llvm-project/pull/104707 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode][NFC] Get rid of const_casts in Move fns (PR #105698)

2024-08-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105698 None >From a2fe95e451340d2065f626c8b736a46feb1caa84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 22 Aug 2024 15:32:53 +0200 Subject: [PATCH] [clang][bytecode][NFC] Get rid of const_c

[clang] [clang][bytecode] Reject void InitListExpr differently (PR #105697)

2024-08-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105697 This reverts c79d1fa540390f6e37e1ea326153559eeadd0de6 and 125aa10b3d645bd26523a1bc321bb2e6b1cf04e1 Instead, just only use emitInvalid() for void InitListExprs if we're not discarding them. >From 719be4236d30

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-22 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [clang][bytecode] Allow adding offsets to function pointers (PR #105641)

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

[clang] [clang][bytecode] Fix void unary * operators (PR #105640)

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

[clang] [clang][bytecode] Allow adding offsets to function pointers (PR #105641)

2024-08-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/105641 >From 7c9321e85febf0fa177736f425fe286d24951eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 21 Aug 2024 09:49:54 +0200 Subject: [PATCH] [clang][Interp] Allow adding offsets to functio

[clang] [clang][bytecode] Allow adding offsets to function pointers (PR #105641)

2024-08-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/105641 >From 4285763a4138661dac7a2d4abac4e2e1cec019ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 21 Aug 2024 09:49:54 +0200 Subject: [PATCH] [clang][Interp] Allow adding offsets to functio

[clang] [clang][bytecode] Fix void unary * operators (PR #105640)

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

[clang] [clang][bytecode] Allow adding offsets to function pointers (PR #105641)

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

[clang] [clang][Interp] Allow adding offsets to function pointers (PR #105641)

2024-08-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105641 Convert them to Pointers, do the offset calculation and then convert them back to function pointers. >From af18bbdf3440b3d13077dbcfd22a04fcf0b1564b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?=

[clang] [clang][Bytecode] Fix void unary * operators (PR #105640)

2024-08-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105640 Discard the subexpr. >From 811ce07c27a92a55642088f26560b4698e5bfc7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 22 Aug 2024 12:54:27 +0200 Subject: [PATCH] [clang][Bytecode] Fix voi

[clang] [clang][bytecode] Don't discard all void-typed expressions (PR #105625)

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

[clang] [clang][bytecode] Don't discard all void-typed expressions (PR #105625)

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

[clang] [clang][bytecode] Don't discard all void-types expressions (PR #105625)

2024-08-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105625 For void-types InitListExprs, we need to diagnose them as invalid. But only if we are _not_ discarding. >From 11c6e8da7bcdb2f4ad358fc346bf603f25cc62aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-21 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [clang][bytecode] Fix diagnostic in final ltor cast (PR #105292)

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

[clang] [clang][bytecode] Fix diagnostic in final ltor cast (PR #105292)

2024-08-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105292 Don't diagnose volatile reads but diagnose a few other accesses earlier. >From 8580230aad18c0955e92767e843344579dac1a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 20 Aug 2024 18:06

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-20 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

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

[clang] [clang][bytecode] Fix initializing base casts (PR #104901)

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

[clang] [clang][bytecode] Fix discarding CompoundLiteralExprs (PR #104909)

2024-08-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104909 None >From 6d45a286525465b4832e4ee01fa747db871f002e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 20 Aug 2024 11:02:25 +0200 Subject: [PATCH] [clang][bytecode] Fix discarding Compound

[clang] [clang][bytecode] Fix initializing base casts (PR #104901)

2024-08-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104901 Use delegate() there. To fix a follow-up problem, abort when a cast ends up on a valid Pointer that isn't a base class. >From cd2cc98cecc1f237da4a2aa30a9c07b07ae4c804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T

[clang] [clang][bytecode] Support ObjC blocks (PR #104551)

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

[clang] [clang][bytecode] Discard NullToPointer cast SubExpr (PR #104782)

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

[clang] [clang][bytecode] Support ObjC blocks (PR #104551)

2024-08-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104551 >From bc203f20b373246dcf1628ff856a5dd2055d64f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 15 Aug 2024 20:31:38 +0200 Subject: [PATCH] [clang][Interp] Support blocks --- clang/lib/

[clang] [clang][bytecode] Discard NullToPointer cast SubExpr (PR #104782)

2024-08-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104782 So we still properly abort if they fail. >From 0485b480347f69565c9d494365bce65c4f9a7a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 19 Aug 2024 16:13:04 +0200 Subject: [PATCH] [clan

[clang] [clang][bytecode] Fix member pointers to IndirectFieldDecls (PR #104756)

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

[clang] [clang][bytecode] Use first FieldDecl instead of asserting (PR #104760)

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

[clang] [clang][bytecode] Use first FieldDecl instead of asserting (PR #104760)

2024-08-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104760 This assertion fails sometimes. We use the first decl for lookup later, so let's use the first decl here as well. >From c0beba1e750249fa9a8c0051218d21d8921acdb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20

[clang] [clang][bytecode] Fix member pointers to IndirectFieldDecls (PR #104756)

2024-08-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104756 >From 7b6c5687ffa8c619240420882d5edb9aa2854d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 19 Aug 2024 11:31:10 +0200 Subject: [PATCH] [clang][bytecode] Fix member pointers to Indire

[clang] [clang][bytecode] Fix member pointers to IndirectFieldDecls (PR #104756)

2024-08-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104756 >From f6787843ec316df6505274d3bb312d9d44c0de67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 19 Aug 2024 11:31:10 +0200 Subject: [PATCH] [clang][bytecode] Fix member pointers to Indire

[clang] [clang][bytecode] Fix member pointers to IndirectFieldDecls (PR #104756)

2024-08-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104756 >From 8720865019f753747cc5441741a6c6eb80f7f0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 19 Aug 2024 11:31:10 +0200 Subject: [PATCH] [clang][bytecode] Fix member pointers to Indire

[clang] [clang][bytecode] Fix member pointers to IndirectFieldDecls (PR #104756)

2024-08-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104756 None >From d693d888ea030a67d4f55c46edecf4e413db77c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 19 Aug 2024 11:31:10 +0200 Subject: [PATCH] [clang][bytecode] Fix member pointers to

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104707 >From 30ea12f3a0841a532471c750204f13e5850d714c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 18 Aug 2024 15:40:05 +0200 Subject: [PATCH] [clang][bytecode] Fix 'if consteval' in non-con

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104707 The previous code made this a compile-time decision but it's not. >From ba9edf8e883d9ac976a79c4f8883d71625b6cbaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 18 Aug 2024 15:40:05 +02

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

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

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

2024-08-18 Thread Timm Baeder via cfe-commits
tbaederr wrote: > @tbaederr I've basically just copied over the tests from the other file. > There's no other quad-precision (`__float128`) tests so they were removed. Unfortunately that problem also exists with regular floating-point values (provided they heap-allocate memory). > Do these n

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread Timm Baeder via cfe-commits
tbaederr wrote: Yeah it's a well known problem. > Is there a different file that these tests should be added for? Like > AST/ByteCode/builtin-functions.cpp? That should work. I have sanitizers enabled locally so I can test the changes if you want. https://github.com/llvm/llvm-project/pull/94

[clang] [clang][bytecode] Support ObjC blocks (PR #104551)

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

[clang] [clang][bytecode] Fix shifting negative values (PR #104663)

2024-08-18 Thread Timm Baeder via cfe-commits
tbaederr wrote: This code is unused unless you're passing `-fexperimental-new-constant-interpreter`, is anyone using that in production code? https://github.com/llvm/llvm-project/pull/104663 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [clang][bytecode] IntPointer::atOffset() should append (PR #104686)

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

[clang] [clang][bytecode] IntPointer::atOffset() should append (PR #104686)

2024-08-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104686 ... to current offset. This breaks other tests which this commit also fixes. Namely, getIndex() should return the integer representation for non-block pointers. >From c85a03aa716aa2c3d23ed2567b1d81066b160dee

[clang] [clang][bytecode] Fix shifting negative values (PR #104663)

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

[clang] [clang][bytecode] Classify 1-bit unsigned integers as bool (PR #104662)

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

[clang] [clang][bytecode] Fix shifting negative values (PR #104663)

2024-08-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104663 None >From 3faff3df9ebadbc12e34d15c96742856020bf7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 17 Aug 2024 06:15:45 +0200 Subject: [PATCH] [clang][bytecode] Fix shifting negative v

[clang] [clang][bytecode] Classify 1-bit unsigned integers as bool (PR #104662)

2024-08-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104662 This happens for enum types with bool parent types. isBooleanType() returns false for them however. The previous version did the same thing by re-classifying the enum integer type, but that breaks with forwar

[clang] [clang][Interp] Support ObjC blocks (PR #104551)

2024-08-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104551 >From e4e5a35bf25f8f95ea39765692d0280b906dd625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 15 Aug 2024 20:31:38 +0200 Subject: [PATCH] [clang][Interp] Support blocks --- clang/lib/

[clang] [clang] Rename all AST/Interp stuff to AST/ByteCode (PR #104552)

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

[clang] [clang] Rename all AST/Interp stuff to AST/ByteCode (PR #104552)

2024-08-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104552 >From 28ff098c7627adc052f90d968f449afb8cb38d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 16 Aug 2024 08:42:16 +0200 Subject: [PATCH] [clang] Rename all AST/Interp stuff to AST/Byte

[clang] [clang][Interp] Fix classifying enum types (PR #104582)

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

[clang] [clang][Interp] Fix classifying enum types (PR #104582)

2024-08-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104582 We used to always return PT_IntAP(s) for them. >From b838d2c2c71868ef48b8357c744e5b8d41ba5d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 16 Aug 2024 13:48:44 +0200 Subject: [PATCH]

[clang] [clang][Interp] Support ObjC blocks (PR #104551)

2024-08-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104551 >From 24a00c98538038c5fd7f01789b8b819c3c562a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 15 Aug 2024 20:31:38 +0200 Subject: [PATCH] [clang][Interp] Support blocks --- clang/lib/

[clang] [clang] Rename all AST/Interp stuff to AST/ByteCode (PR #104552)

2024-08-16 Thread Timm Baeder via cfe-commits
tbaederr wrote: Code formatting is clean locally :shrug: https://github.com/llvm/llvm-project/pull/104552 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Rename all AST/Interp stuff to AST/ByteCode (PR #104552)

2024-08-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104552 >From 42c79911d0138d45c425e42cc19bef5e84a67e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 16 Aug 2024 08:42:16 +0200 Subject: [PATCH] [clang] Rename all AST/Interp stuff to AST/Byte

[clang] [clang][Interp] Support ObjC blocks (PR #104551)

2024-08-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104551 >From fdf77974e37a8b38d2ab3e184371417fdec1e952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 15 Aug 2024 20:31:38 +0200 Subject: [PATCH] [clang][Interp] Support blocks --- clang/lib/

[clang] [clang] Rename all AST/Interp stuff to AST/ByteCode (PR #104552)

2024-08-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104552 >From c140ef583e6bdff8c7ac829be1ede32460663564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 16 Aug 2024 08:42:16 +0200 Subject: [PATCH] [clang] Rename all AST/Interp stuff to AST/Byte

[clang] [clang] Rename all AST/Interp stuff to AST/ByteCode (PR #104552)

2024-08-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104552 "Interp" clashes with the clang interpreter and people often confuse this. >From a4a8254c45fa220d3a25e3951069106667f3a280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 16 Aug 2024 08:

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