[clang] [clang][bytecode][NFC] Simplify visitDeclRef (PR #123380)

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

[clang] [clang][bytecode][NFC] Simplify visitDeclRef (PR #123380)

2025-01-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/123380 Try to reduce indentation here. >From bcfd68e379df916d1e97ad2411c74096969d3621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 17 Jan 2025 16:35:23 +0100 Subject: [PATCH] [clang][byteco

[clang] [clang][bytecode] Revisit global variables separately (PR #123358)

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

[clang] [clang][bytecode] Revisit global variables separately (PR #123358)

2025-01-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/123358 Call `EvaluateAsInitializer()` explicitly here, so we don't abort the evaluation of the `DeflRefExpr` just because the initializer of that global variable failed. >From 8dac131d58f4c6dc4ddb58c3933e7726d65f9d3

[clang] [clang][bytecode] Fix rejecting invalid sizeof expressions (PR #123332)

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

[clang] [clang][bytecode] Fix rejecting invalid sizeof expressions (PR #123332)

2025-01-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/123332 >From bcb3faf64f933ce4c9f1040af8eaec4d4957c09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 17 Jan 2025 14:11:08 +0100 Subject: [PATCH] [clang][bytecode] Fix rejecting invalid sizeof

[clang] [clang][bytecode] Fix rejecting invalid sizeof expressions (PR #123332)

2025-01-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/123332 Emit the invalid note instead of nothing. >From 3b04b61f352684331c919e716eb1a3589f855125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 17 Jan 2025 14:11:08 +0100 Subject: [PATCH] [cla

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

2025-01-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/105789 >From 62c8614cd64e0b97b62eb5700ff39dd290bbeebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 23 Aug 2024 08:54:12 +0200 Subject: [PATCH] [clang] Remove an incorrect assertion in Consta

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

2025-01-17 Thread Timm Baeder via cfe-commits
tbaederr wrote: For ```c++ void f() { [[clang::annotate("B", (void)1, (void)2, 7)]] int j = 0; } ``` The IR is: ```llvm @.str = private unnamed_addr constant [2 x i8] c"B\00", section "llvm.metadata" @.str.1 = private unnamed_addr constant [10 x i8] c"array.cpp\00", section "llvm.metadata" @.

[clang] [clang][bytecode] Add InitLinkScope for toplevel Expr temporary (PR #123319)

2025-01-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/123319 ___ 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 toplevel Expr temporary (PR #123319)

2025-01-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/123319 None >From d20a37fcaebf999167ffceeb417e0369ef8a9936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 17 Jan 2025 11:49:35 +0100 Subject: [PATCH] [clang][bytecode] Add InitLinkScope for t

[clang] [clang][bytecode][NFC] Simplify VisitCXXDefaultArgExpr (PR #123024)

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

[clang] [clang][bytecode][NFC] Simplify VisitCXXDefaultArgExpr (PR #123024)

2025-01-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/123024 We have `discard()` these days. >From b6da1ccfe8f0ff9ff25e226dc01b781291892c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 15 Jan 2025 08:50:52 +0100 Subject: [PATCH] [clang][byteco

[clang] [clang][bytecode] Handle UETT_PtrAuthTypeDiscriminator (PR #122941)

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

[clang] [clang][bytecode] Handle UETT_PtrAuthTypeDiscriminator (PR #122941)

2025-01-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/122941 None >From 4bef28263ea3947b3bc80835fde340c776d0aad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 14 Jan 2025 18:36:30 +0100 Subject: [PATCH] [clang][bytecode] Handle UETT_PtrAuthType

[clang] [clang][NFC] Make ASTContext::getPointerAuthTypeDiscriminator const (PR #122931)

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

[clang] [clang][NFC] Make ASTContext::getPointerAuthTypeDiscriminator const (PR #122931)

2025-01-14 Thread Timm Baeder via cfe-commits
tbaederr wrote: This sucks, but mangling needs a mutable `ASTContext`. https://github.com/llvm/llvm-project/pull/122931 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Make ASTContext::getPointerAuthTypeDiscriminator const (PR #122931)

2025-01-14 Thread Timm Baeder via cfe-commits
tbaederr wrote: Not that easy I guess. https://github.com/llvm/llvm-project/pull/122931 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Make ASTContext::getPointerAuthTypeDiscriminator const (PR #122931)

2025-01-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/122931 Can be const, should be const. >From a0b0ae9f99527d6b9a61bece67fee96b696c0eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 14 Jan 2025 17:34:02 +0100 Subject: [PATCH] [clang][NFC] Ma

[clang] [clang][bytecode] Add init link for the RVO ptr (PR #122904)

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

[clang] [clang][bytecode] Add init link for the RVO ptr (PR #122904)

2025-01-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/122904 None >From 24b323b514d130b12898eaeb63da05f6456e2f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 14 Jan 2025 15:09:50 +0100 Subject: [PATCH] [clang][bytecode] Add init link for the R

[clang] [clang][bytecode] Mark global decls with diagnostics invalid (PR #122895)

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

[clang] [clang][bytecode] Mark global decls with diagnostics invalid (PR #122895)

2025-01-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/122895 Even if their evaluation succeeds, mark them as invalid. This fixes some long standing differences to the ast walker interpeter. >From 66c1a54bf96661aa0e5b60cf121b03776a8dcbbe Mon Sep 17 00:00:00 2001 From: =?

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

2025-01-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/106552 ___ 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)

2025-01-14 Thread Timm Baeder via cfe-commits
tbaederr wrote: Fixed differently by https://github.com/llvm/llvm-project/pull/122871 https://github.com/llvm/llvm-project/pull/106552 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Change the way we do init chains (PR #122871)

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

[clang] [clang][bytecode] Change the way we do init chains (PR #122871)

2025-01-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/122871 >From d1de505faaebb9f59c45a2951f106a86ed296e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 14 Jan 2025 09:19:27 +0100 Subject: [PATCH] [clang][bytecode] Change the way we do init cha

[clang] [clang][bytecode] Change the way we do init chains (PR #122871)

2025-01-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/122871 See the comment in Compiler<>::VisitCXXThisExpr. We need to mark the InitList explicitly, so we later know what to refer to when the init chain is active. >From 7fec8f1137b7aea844400030a32d46b37b1a99e1 Mon Sep

[clang] [clang-tools-extra] [lldb] Reapply "[clang] Avoid re-evaluating field bitwidth" (PR #122289)

2025-01-10 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/122289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] Reapply "[clang] Avoid re-evaluating field bitwidth" (PR #122289)

2025-01-10 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/122289 >From 59abbcc54700d5a8ba31ecd3b37431ffe86f7d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 9 Jan 2025 16:01:59 +0100 Subject: [PATC

[clang] [clang-tools-extra] [lldb] Reapply "[clang] Avoid re-evaluating field bitwidth" (PR #122289)

2025-01-10 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/122289 >From 59abbcc54700d5a8ba31ecd3b37431ffe86f7d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 9 Jan 2025 16:01:59 +0100 Subject: [PATC

[clang] [clang] Evaluate constant initializers in C as well (PR #121950)

2025-01-09 Thread Timm Baeder via cfe-commits
tbaederr wrote: This makes no sense, we're already checking for unversioned c++ above. https://github.com/llvm/llvm-project/pull/121950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Evaluate constant initializers in C as well (PR #121950)

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

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-09 Thread Timm Baeder via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: tbaederr wrote: Unfortunately we currently have two constant

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

2025-01-09 Thread Timm Baeder via cfe-commits
tbaederr wrote: >- We check whether two pointers are in the same range > > Is that possible to implement in the interpreter without going back to AST > visitors? I take "in the same range" meaning as "can be compared at compile time at all" here, so yes, that would be rather trivial (we ha

[clang] [clang-tools-extra] [lldb] Reapply "[clang] Avoid re-evaluating field bitwidth" (PR #122289)

2025-01-09 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: tbaederr wrote: @JDevlieghere The previous attempt made some lldb build bots fail. I've now changed `TypeSystemClang.cpp` to create `ConstantExpr`s for the bitwidth values and adapted one of the tests. Please review. https://github.com/llvm/ll

[clang] [clang-tools-extra] [lldb] Reapply "[clang] Avoid re-evaluating field bitwidth" (PR #122289)

2025-01-09 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/122289 >From 813b4bee5bddfbbc3eec8a7047c51cfde825bcee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 9 Jan 2025 16:01:59 +0100 Subject: [PATC

[clang] [clang-tools-extra] [lldb] Reapply "[clang] Avoid re-evaluating field bitwidth" (PR #122289)

2025-01-09 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/122289 None >From 813b4bee5bddfbbc3eec8a7047c51cfde825bcee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 9 Jan 2025 16:01:59 +0100 Subject:

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

2025-01-09 Thread Timm Baeder via cfe-commits
tbaederr wrote: > We check which one is the currently active member of a union, and This is `__builtin_is_within_lifetime`, isn't it? https://github.com/llvm/llvm-project/pull/122099 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2025-01-09 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 closed https://github.com/llvm/llvm-project/pull/118475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2025-01-09 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/118475 >From 0d631c57d3ad2e16e1485dcd39f3a9c6d0aaa07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= D

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

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

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2025-01-08 Thread Timm Baeder via cfe-commits
tbaederr wrote: Python binding tests fail for unrelated reasons: ``` curl: (23) Failure writing output to destination Error: Restoring cache failed: Error: The process '/usr/bin/sh' failed with exit code 2 ``` https://github.com/llvm/llvm-project/pull/117732

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2025-01-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From 953ee08b6e8ae9c0b16916e7f31cb9d2f3d5dd8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 27 Nov 2024 08:54:51 +0100 Subject: [PATCH] Save FieldDecl BitWidth as a ConstantExpr ---

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

2025-01-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/122099 See the comment at the beginning of `InterpBuiltinConstantP.h` for an explanation. >From 7fe5944ed5f072c0e74202fd01aa65d87aea3787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 7 Jan

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-01-07 Thread Timm Baeder via cfe-commits
@@ -839,6 +839,12 @@ def BuiltinAssumeAligned : Builtin { let Prototype = "void*(void const*, size_t, ...)"; } +def BuiltinAssumeDereferenceable : Builtin { + let Spellings = ["__builtin_assume_dereferenceable"]; + let Attributes = [NoThrow, Const, Constexpr];

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2025-01-07 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/118475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [clang] Evaluate constant initializers in C as well (PR #121950)

2025-01-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121950 None >From 87176299fcd501ec6f440e61e224b30854920e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 7 Jan 2025 16:18:56 +0100 Subject: [PATCH] [clang] Evaluate constant initializers in

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2025-01-07 Thread Timm Baeder via cfe-commits
tbaederr wrote: Yep, that's what I was pinging for :) https://github.com/llvm/llvm-project/pull/117732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [NFC] Refactor more AST visitors (PR #116823)

2025-01-06 Thread Timm Baeder via cfe-commits
@@ -427,42 +423,53 @@ class ParentMapContext::ParentMap::ASTVisitor return Result; } - bool TraverseDecl(Decl *DeclNode) { + bool TraverseDecl(Decl *DeclNode) override { return TraverseNode( -DeclNode, DeclNode, [&] { return VisitorBase::TraverseDecl(DeclN

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-06 Thread Timm Baeder via cfe-commits
@@ -17893,4 +17996,441 @@ std::optional EvaluateBuiltinIsWithinLifetime(IntExprEvaluator &IEE, IsWithinLifetimeHandler handler{Info}; return findSubobject(Info, E, CO, Val.getLValueDesignator(), handler); } + } // namespace + +static bool EvaluateAtomicOrder(const AtomicE

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-06 Thread Timm Baeder via cfe-commits
@@ -1921,6 +1921,22 @@ static bool EvaluateFixedPointOrInteger(const Expr *E, APFixedPoint &Result, static bool EvaluateFixedPoint(const Expr *E, APFixedPoint &Result, EvalInfo &Info); +/// Support for atomic builtins +static bool EvaluateAtomic

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-06 Thread Timm Baeder via cfe-commits
@@ -1921,6 +1921,22 @@ static bool EvaluateFixedPointOrInteger(const Expr *E, APFixedPoint &Result, static bool EvaluateFixedPoint(const Expr *E, APFixedPoint &Result, EvalInfo &Info); +/// Support for atomic builtins tbaederr w

[clang] [clang][bytecode] Always return false for invalid bcp results (PR #121467)

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

[clang] [clang][bytecode] Always return false for invalid bcp results (PR #121467)

2025-01-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121467 None >From 64b56760ef4d701f36204588ea82c0ecc24579f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 2 Jan 2025 12:08:17 +0100 Subject: [PATCH] [clang][bytecode] Always return false for

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

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

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

2025-01-02 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= ,

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

2025-01-02 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,

[clang] [clang][bytecode] Consider unknown-size arrays in memcpy/memcmp (PR #121462)

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

[clang] [clang][bytecode] Consider unknown-size arrays in memcpy/memcmp (PR #121462)

2025-01-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121462 When emitting diagnostics for the number of elements. >From 26b2225c92cf30d75e91a1a43bdf55e6e624da5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 2 Jan 2025 10:27:30 +0100 Subject: [

[clang] [clang][bytecode] Consider start index when copying composite array (PR #121461)

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

[clang] [clang][bytecode] Consider start index when copying composite array (PR #121461)

2025-01-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121461 ... elements. >From 18b6ce8cbff25c647fcb8a3511c4366b5118dc69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 2 Jan 2025 10:05:21 +0100 Subject: [PATCH] [clang][bytecode] Consider start

[clang] [clang][bytecode] Check for memcpy/memmove dummy pointers earlier (PR #121453)

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

[clang] [clang][bytecode] Check for memcpy/memmove dummy pointers earlier (PR #121453)

2025-01-01 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121453 None >From 9aeae2efcfb038af30f01a07eb8960a4a59929f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 2 Jan 2025 06:28:08 +0100 Subject: [PATCH] [clang][bytecode] Check for memcpy/memmove

[clang] [clang][bytecode] Check memove/memcpy for available elements (PR #121383)

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

[clang] [clang][bytecode] Check memove/memcpy for available elements (PR #121383)

2024-12-31 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121383 Both destination and source pointer need to have at least as many elements as requested. >From 129aa7348398123685a39555dd12c11f7da6d15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue,

[clang] [Clang] Add GCC's __builtin_stack_address() to Clang. (PR #121332)

2024-12-31 Thread Timm Baeder via cfe-commits
@@ -4782,6 +4782,30 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, Function *F = CGM.getIntrinsic(Intrinsic::frameaddress, AllocaInt8PtrTy); return RValue::get(Builder.CreateCall(F, Depth)); } + case Builtin::BI__builtin_stack_ad

[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

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

[clang] [clang][bytecode] Move a local variable to a later point (PR #121250)

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

[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-27 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/121251 >From af5d2292249514be8f2d13e92f98eb0df1d7eb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 26 Dec 2024 08:54:48 +0100 Subject: [PATCH] [clang][bytecode] Add support for typeid pointe

[clang] [clang][bytecode] Move a local variable to a later point (PR #121250)

2024-12-27 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121250 We don't need `E` before. >From 3ecbfa862eee6b6c1f009dfcf6b9791e77af97b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 28 Dec 2024 06:38:52 +0100 Subject: [PATCH] [clang][bytecode] Mo

[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-27 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121251 Add it as another kind of pointer, saving both a `Type*` for the result of the typeid() expression as well as one for the type of the typeid expression. >From aad3e96d970be36964faceec8d0a6df3dd27e5ff Mon Sep 1

[clang] [clang][bytecode] Create local scopes for if then/else statements (PR #120852)

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

[clang] [clang][bytecode] Create local scopes for if then/else statements (PR #120852)

2024-12-21 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/120852 In case those aren't compound statements. >From a2cf825d002c867804bb65e6f156a87c8da6b07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 21 Dec 2024 20:04:44 +0100 Subject: [PATCH] [cla

[clang] Fix double-quotes in diagnostic when attempting to access a ext_vector of bools (PR #118186)

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

[clang] Fix double-quotes in diagnostic when attempting to access a ext_vector of bools (PR #118186)

2024-12-20 Thread Timm Baeder via cfe-commits
tbaederr wrote: Do you need someone to push this? https://github.com/llvm/llvm-project/pull/118186 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Support pointers in __builtin_mem{move, cpy} (PR #120560)

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

[clang] [clang][bytecode] Support pointers in __builtin_mem{move, cpy} (PR #120560)

2024-12-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/120560 Unfortunately, that means we can't use the __builtin_bit_cast implementation for this. >From 1fe4940ad01bae6ab75cdf8bd1ea9812929e716d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 19

[clang] [Sema] Diagnose tautological bounds checks (PR #120222)

2024-12-17 Thread Timm Baeder via cfe-commits
@@ -11786,6 +11786,49 @@ static bool checkForArray(const Expr *E) { return D->getType()->isArrayType() && !D->isWeak(); } +/// Detect patterns ptr + size >= ptr and ptr + size < ptr, where ptr is a +/// pointer and size is an unsigned integer. Return whether the result is +/

[clang] [clang][bytecode] Remove a bitcast nullptr_t special case (PR #120188)

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

[clang] [clang][bytecode] Remove a bitcast nullptr_t special case (PR #120188)

2024-12-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/120188 >From 6333abaec04c0b3f9bad9239fab73dc08fa77f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 17 Dec 2024 06:21:58 +0100 Subject: [PATCH] [clang][bytecode] Remove a bitcast nullptr_t sp

[clang] [clang][bytecode] Remove a bitcast nullptr_t special case (PR #120188)

2024-12-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/120188 We still need to check the input pointer, so let this go through BitCastPrim. >From 98b30005491d5082e035bdf966e12ae7f2f205f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 17 Dec 2024

[clang] [clang][bytecode] Don't check returned pointers for liveness (PR #120107)

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

[clang] [clang][bytecode] Don't check returned pointers for liveness (PR #120107)

2024-12-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/120107 We're supposed to let them through and then later diagnose reading from them, but returning dead pointers is fine. >From 18b850cd8e6dfce416f7ab40feff3aad9c21a5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=2

[clang] [clang][bytecode] Handle builtin_wmemcmp (PR #120070)

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

[clang] [clang][bytecode] Handle builtin_wmemcmp (PR #120070)

2024-12-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/120070 None >From c00d8f36bffc9819bfa294789e801360ed1f434d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 16 Dec 2024 12:12:03 +0100 Subject: [PATCH] [clang][bytecode] Handle builtin_wmemcmp

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

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

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2024-12-16 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/118475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [clang][bytecode] Fix some shift edge cases (PR #119895)

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

[clang] [clang][bytecode] Fix some shift edge cases (PR #119895)

2024-12-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/119895 Around shifting negative values. >From f72e8e1a6a63b4a6e0f4095f20f551703a037c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 13 Dec 2024 17:02:22 +0100 Subject: [PATCH] [clang][bytec

[clang] [clang][bytecode] Fix memcmp/bcmp failures on big-endian hosts (PR #119851)

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

[clang] [clang][bytecode] Handle __builtin_memcmp (PR #119544)

2024-12-13 Thread Timm Baeder via cfe-commits
tbaederr wrote: Yup, see https://github.com/llvm/llvm-project/pull/119851 https://github.com/llvm/llvm-project/pull/119544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix memcmp/bcmp failures on big-endian hosts (PR #119851)

2024-12-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/119851 See the discussion in https://github.com/llvm/llvm-project/pull/119678#issuecomment-2539680746 and https://github.com/llvm/llvm-project/pull/119544#issuecomment-2539678561 >From 0cf9d2b6bb83de7db94411a5a325ba4c

[clang] [clang][bytecode] Handle __builtin_bcmp (PR #119678)

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

[clang] [clang][bytecode] Handle __builtin_bcmp (PR #119678)

2024-12-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/119678 ... the same as `__builtin_memcmp`. Also fix a bug we still had when we couldn't find a difference in the two inputs after `Size` bytes. >From 3a480676781925badff8b88c3833f083fdc3dcbd Mon Sep 17 00:00:00 2001

[clang] [clang][bytecode] Handle __builtin_memcmp (PR #119544)

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

[clang] [clang][bytecode] Handle __builtin_memcmp (PR #119544)

2024-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/119544 >From 060f96d813f31ccf4f3e68e8bbc826a7c263f680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 11 Dec 2024 12:35:29 +0100 Subject: [PATCH] [clang][bytecode] Handle __builtin_memcmp ---

[clang] [clang][bytecode] Handle __builtin_memcmp (PR #119544)

2024-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/119544 >From 3e5ca2bbefddab626003fe10d0b80709f7c96ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 11 Dec 2024 12:35:29 +0100 Subject: [PATCH] [clang][bytecode] Handle __builtin_memcmp ---

[clang] [clang][bytecode] Handle __builtin_memcmp (PR #119544)

2024-12-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/119544 >From d4518ea52cab53861c242e335fbc75af46f4d208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 11 Dec 2024 12:35:29 +0100 Subject: [PATCH] [clang][bytecode] Handle __builtin_memcmp ---

[clang] [clang][bytecode][NFC] Use Pointer::pointToSameBlock (PR #119552)

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

  1   2   3   4   5   6   7   8   9   10   >