[clang] [clang][Interp] Remove GlobalDecl flag (PR #101995)

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

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #101126)

2024-08-05 Thread Timm Baeder via cfe-commits
@@ -3,40 +3,39 @@ typedef int __attribute__((vector_size(16))) VI4; constexpr VI4 A = {1,2,3,4}; -static_assert(A[0] == 1, ""); // ref-error {{not an integral constant expression}} -static_assert(A[1] == 2, ""); // ref-error {{not an integral constant expression}} -static_as

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #101126)

2024-08-05 Thread Timm Baeder via cfe-commits
tbaederr wrote: If nobody else still has concerns, this LGTM from my end. https://github.com/llvm/llvm-project/pull/101126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Point 'declared here' note of invalid fns to definition (PR #102031)

2024-08-05 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102031 None >From 23cad192584b903bfcd3c3ea0a6c0bfeb6951afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 5 Aug 2024 20:14:19 +0200 Subject: [PATCH] [clang][Interp] Point 'declared here' note

[clang] [clang][Interp] Point 'declared here' note of invalid fns to definition (PR #102031)

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

[clang] [clang][Interp] Fix getField() for integral pointers (PR #102120)

2024-08-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102120 Instead of just adding the Record::Field offset, instead get the FieldDecl offset in the RecordLayout. Unfortunately, the offset we pass to the ops here is not made to easily go back to a FieldDecl, so we hav

[clang] [clang][Interp] Fix getField() for integral pointers (PR #102120)

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

[clang] [clang][Interp] Ignore ObjCBoxedExpr subexpr... (PR #102136)

2024-08-06 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102136 ... if it can't be expressed as a constant initializer. >From 741c0bb89bc50a2a1bf270a2ac3717eb5c7f4666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 6 Aug 2024 15:04:13 +0200 Subject:

[clang] [clang][Interp] Ignore ObjCBoxedExpr subexpr... (PR #102136)

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

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #101126)

2024-08-07 Thread Timm Baeder via cfe-commits
tbaederr wrote: @vikramRH Do you need someone else to merge this for you? https://github.com/llvm/llvm-project/pull/101126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Fix BooleanToSignedIntegral casts for IntAP(S) (PR #102302)

2024-08-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102302 We were not doing the final Neg here. >From 0b1a9b49382802a06fad9ac149e2f2a20539429e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 7 Aug 2024 12:25:06 +0200 Subject: [PATCH] [clang][I

[clang] [clang][Interp] Fix BooleanToSignedIntegral casts for IntAP(S) (PR #102302)

2024-08-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/102302 >From 6de1136c9806d3b545b586d91ee56a934cff1669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 7 Aug 2024 12:25:06 +0200 Subject: [PATCH] [clang][Interp] Fix BooleanToSignedIntegral cast

[clang] [clang][Interp] Fix BooleanToSignedIntegral casts for IntAP(S) (PR #102302)

2024-08-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/102302 ___ 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-07 Thread Timm Baeder via cfe-commits
@@ -335,7 +335,7 @@ namespace InitializerTemporaries { constexpr int f() { S{}; // ref-note {{in call to 'S{}.~S()'}} \ - // expected-note {{in call to '&S{}->~S()'}} + // expected-note {{in call to '~S()'}} tbaederr wrote: This looks wr

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

2024-08-07 Thread Timm Baeder via cfe-commits
@@ -198,11 +198,11 @@ def NoRet : Opcode {} def Call : Opcode { - let Args = [ArgFunction, ArgUint32]; + let Args = [ArgFunction, ArgUint32, ArgExpr]; tbaederr wrote: Can we not get by without this? When emitting the diagnostic, the `CallExpr` should be o

[clang] [clang][Interp] Properly abort on reads from non-const variables (PR #102426)

2024-08-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/102426 >From fb78d6e1b2b546b0901a4b1ca97ff8eae3cc95cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 8 Aug 2024 08:01:18 +0200 Subject: [PATCH] [clang][Interp] Properly abort on reads from non

[clang] [clang][Interp] Properly abort on reads from non-const variables (PR #102426)

2024-08-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/102426 ___ 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 indexing arrays with index 0 (PR #102454)

2024-08-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102454 Even if the array is of unknown bounds, index 0 is fine. >From cd0c548bda43321089d2fc4a6c7853a18b932690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 8 Aug 2024 14:19:25 +0200 Subject

[clang] [clang][Interp] Don't diagnose indexing arrays with index 0 (PR #102454)

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

[clang] [clang][Interp] Fall back to dummy pointers if createGlobal() fails (PR #102464)

2024-08-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/102464 createGlobal fails e.g. if the type isn't complete. >From b945bf23c12fc54c6a256507c815fee19fbac655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 8 Aug 2024 15:08:46 +0200 Subject: [PA

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -198,11 +198,11 @@ def NoRet : Opcode {} def Call : Opcode { - let Args = [ArgFunction, ArgUint32]; + let Args = [ArgFunction, ArgUint32, ArgExpr]; tbaederr wrote: As you can see in the snippet I posted, you get an `Expr*` anyway, so you can check for

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -67,15 +68,19 @@ struct Bar { template constexpr int fail2() const { return 1 / 0; } // expected-warning {{division by zero}} \ // expected-note {{division by zero}} +#ifndef NEW_CONST_INTERP template constexpr in

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -67,15 +68,19 @@ struct Bar { template constexpr int fail2() const { return 1 / 0; } // expected-warning {{division by zero}} \ // expected-note {{division by zero}} +#ifndef NEW_CONST_INTERP template constexpr in

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -67,15 +68,19 @@ struct Bar { template constexpr int fail2() const { return 1 / 0; } // expected-warning {{division by zero}} \ // expected-note {{division by zero}} +#ifndef NEW_CONST_INTERP template constexpr in

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -198,11 +198,11 @@ def NoRet : Opcode {} def Call : Opcode { - let Args = [ArgFunction, ArgUint32]; + let Args = [ArgFunction, ArgUint32, ArgExpr]; tbaederr wrote: You forgot the `This && IsMemberCall` check from the current interpreter. Consider these

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -198,11 +198,11 @@ def NoRet : Opcode {} def Call : Opcode { - let Args = [ArgFunction, ArgUint32]; + let Args = [ArgFunction, ArgUint32, ArgExpr]; tbaederr wrote: The `assert(MyCE == CallExpr);` needs to go, but other than that, `test/AST/Interp` work

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -599,7 +599,7 @@ namespace Destructors { }; constexpr int testS() { S{}; // ref-note {{in call to 'S{}.~S()'}} \ - // expected-note {{in call to '&S{}->~S()'}} + // expected-note {{in call to 'S{}.~S()'}} tbaederr wrote: ```suggestio

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,87 @@ +// RUN: %clang_cc1 -DNEW_CONST_INTERP -std=c++20 -fexperimental-new-constant-interpreter -fsyntax-only -verify %s tbaederr wrote: ```suggestion // RUN: %clang_cc1 -std=c++20 -fexperimental-new-constant-interpreter -fsyntax-only -verify %s ```

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -169,11 +170,32 @@ void InterpFrame::describe(llvm::raw_ostream &OS) const { F && (F->isBuiltin() || F->isLambdaStaticInvoker())) return; + const Expr *CallExpr = Caller->getExpr(getRetPC()); const FunctionDecl *F = getCallee(); - if (const auto *M = dyn_cast

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

2024-08-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. LGTM otherwise. The CI currently fails on Windows, but that looks like it's using an old version of the test? https://github.com/llvm/llvm-project/pull/102170 ___ cfe-commits mailing list cfe-com

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

2024-08-08 Thread Timm Baeder via cfe-commits
@@ -46,7 +46,7 @@ constexpr int div(int a, int b) { return a / b; // both-note {{division by zero}} }; - return f(); // expected-note {{in call to '&f->operator()()'}} \ + return f(); // expected-note {{in call to 'f.operator()()'}} \ tbaederr wrote:

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

2024-08-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited 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] Fix display of syntactically-invalid note for member function calls (PR #102170)

2024-08-08 Thread Timm Baeder via cfe-commits
tbaederr wrote: And FYI, no additional regressions reported: ![Screenshot from 2024-08-08 21-24-55](https://github.com/user-attachments/assets/ea9af278-a428-41f2-835c-22780859ef88) https://github.com/llvm/llvm-project/pull/102170 ___ cfe-commits mai

[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][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-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-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] 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] 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] 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] 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] `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][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][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][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][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
@@ -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 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 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 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 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] 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] 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] 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] 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] 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 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 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] 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] 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 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][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 '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][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 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 '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] 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] 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-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] 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][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] 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][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 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] 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] 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 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 '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] 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][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] 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] 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] 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] 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] 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][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][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] 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][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] 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 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][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] 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] 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 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][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][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

<    9   10   11   12   13   14   15   16   17   18   >