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

2025-05-28 Thread Hana Dusíková via cfe-commits
hanickadot wrote: > @hanickadot Ping :) Soon, busy, will be back. https://github.com/llvm/llvm-project/pull/98756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Attribute support `[[clang::musttail]]` in `ExprConstant.cpp` (work in progress) (PR #138477)

2025-05-04 Thread Hana Dusíková via cfe-commits
hanickadot wrote: ```c++ constexpr int deep_test(int remaining) { if (remaining == 0) { return 42; } MUST_TAIL return deep_test(remaining - 1); } constexpr int result = deep_test(200'000); ``` With debug build of clang: ```sh clang++ -std=c++26 -c deep.cp

[clang] Attribute support `[[clang::musttail]]` in `ExprConstant.cpp` (work in progress) (PR #138477)

2025-05-04 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/138477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Attribute support `[[clang::musttail]]` in `ExprConstant.cpp` (work in progress) (PR #138477)

2025-05-04 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/138477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Attribute support `[[clang::musttail]]` in `ExprConstant.cpp` (work in progress) (PR #138477)

2025-05-04 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/138477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Attribute support `[[clang::musttail]]` in `ExprConstant.cpp` (work in progress) (PR #138477)

2025-05-04 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot created https://github.com/llvm/llvm-project/pull/138477 This change makes `[[clang::musttail]]` work. Function calls marked with this attribute won't use system stack, but will loop after nearest function call. The attribute is already very strick, and checks all

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-22 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/7] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-22 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/6] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-21 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/5] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-21 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/4] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-21 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/5] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-21 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/5] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-21 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/4] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-20 Thread Hana Dusíková via cfe-commits
@@ -779,6 +779,9 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, // TODO: Final number? Builder.defineMacro("__cpp_type_aware_allocators", "202500L"); + + if (LangOpts.ImplicitConstexpr) // same value as GCC +Builder.defineMacro("__cp

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-20 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/3] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/2] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH 1/2] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
@@ -10163,6 +10163,16 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, } ConstexprSpecKind ConstexprKind = D.getDeclSpec().getConstexprSpecifier(); + +// Clang's option -fimplicit-constexpr will make functions without constexpr +// o

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
@@ -6612,6 +6612,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_fconstexpr_depth_EQ); Args.AddLastArg(CmdArgs, options::OPT_fconstexpr_steps_EQ); + Args.AddLastArg(CmdArgs, options::OPT_fimplicit_constexpr); -

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
@@ -0,0 +1,51 @@ +// RUN: %clang_cc1 -verify=normal,both -std=c++23 %s +// RUN: %clang_cc1 -verify=implicit,both -fimplicit-constexpr -std=c++23 %s hanickadot wrote: new test added for earlier standards too https://github.com/llvm/llvm-project/pull/136436 __

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From f37eb75b71d2aa6433bc528b7b4532138ae4e62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 20 Apr 2025 00:24:46 +0200 Subject: [PATCH] [clang] add -fimplicit-constexpr fla

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From b8865c8f7eddfd7bfaba1b0f5399ea03c6780070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 19 Apr 2025 16:52:33 +0200 Subject: [PATCH 1/2] [clang] add -fimplicit-constexpr

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
hanickadot wrote: My motivation is get better ability to experiment with constexpr-ification of stdlib and other libraries. This proved very useful in GCC. Where quickly check something for constexpr-ness is much easier. https://github.com/llvm/llvm-project/pull/136436

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/136436 From b8865c8f7eddfd7bfaba1b0f5399ea03c6780070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 19 Apr 2025 16:52:33 +0200 Subject: [PATCH] [clang] add -fimplicit-constexpr fla

[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

2025-04-19 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot created https://github.com/llvm/llvm-project/pull/136436 Same as GCC's flag of the same name. If a function (constructor / destructor) doesn't have a `constexpr` nor `consteval` specifier. It will implicitly add `constexpr`. This change doesn't touch variables.

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2025-01-12 Thread Hana Dusíková via cfe-commits
hanickadot wrote: I pushed new design, will update PR's description soon, but now I need to finish proposal's wording. https://github.com/llvm/llvm-project/pull/111861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

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

2025-01-09 Thread Hana Dusíková via cfe-commits
hanickadot wrote: > Unfortunately we currently have two constant expression evaluators, can you > take a look at implementing this in the bytecode interpreter as well? Since > this PR is already pretty big I think it would be OK to do it in a follow-up > PR. I will try, I'm not familiar with

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

2025-01-08 Thread Hana Dusíková 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-08 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From 7d65b133b5f04e078b3b26cee2b4be0fe78d01e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Mon, 6 Jan 2025 21:06:10 +0100 Subject: [PATCH 1/2] [clang] implement P3309 atomic bui

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

2025-01-08 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From 7d65b133b5f04e078b3b26cee2b4be0fe78d01e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Mon, 6 Jan 2025 21:06:10 +0100 Subject: [PATCH 1/2] [clang] implement P3309 atomic bui

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

2025-01-08 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From 7d65b133b5f04e078b3b26cee2b4be0fe78d01e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Mon, 6 Jan 2025 21:06:10 +0100 Subject: [PATCH 1/2] [clang] implement P3309 atomic bui

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

2025-01-06 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From 7d65b133b5f04e078b3b26cee2b4be0fe78d01e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Mon, 6 Jan 2025 21:06:10 +0100 Subject: [PATCH] [clang] implement P3309 atomic builtin

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

2025-01-06 Thread Hana Dusíková via cfe-commits
hanickadot wrote: It's broken after rebase, fixing it now... https://github.com/llvm/llvm-project/pull/98756 ___ 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-06 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From bfb43ab80b0272e60c8b43bcd14533ee68a11f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Mon, 6 Jan 2025 20:40:01 +0100 Subject: [PATCH] [clang] implement P3309 atomic builtin

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Hana Dusíková via cfe-commits
hanickadot wrote: I have no additional list of thing Jessica pointed out, LGTM https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot approved this pull request. https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Hana Dusíková via cfe-commits
hanickadot wrote: Do you have example before/after of the change? It's a bit hard to imagine. https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-11 Thread Hana Dusíková via cfe-commits
hanickadot wrote: I'm struggling to make sensible API with composition. When I tried that all `const|static|dynamic|reinterpret|schema_cast` weren't consistent with rest of std library. https://github.com/llvm/llvm-project/pull/111861 ___ cfe-commits

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-11 Thread Hana Dusíková via cfe-commits
@@ -0,0 +1,517 @@ +// -*- C++ -*- +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-11 Thread Hana Dusíková via cfe-commits
@@ -0,0 +1,517 @@ +// -*- C++ -*- +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-11 Thread Hana Dusíková via cfe-commits
@@ -0,0 +1,517 @@ +// -*- C++ -*- +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-11 Thread Hana Dusíková via cfe-commits
@@ -0,0 +1,517 @@ +// -*- C++ -*- +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-11 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/111861 From e1c8d5e689fe8d3d0338eb64220aaf6371aed48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 10 Oct 2024 21:05:55 +0200 Subject: [PATCH 1/3] [clang & libcxx] constexpr point

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-10 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/111861 From e1c8d5e689fe8d3d0338eb64220aaf6371aed48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 10 Oct 2024 21:05:55 +0200 Subject: [PATCH 1/2] [clang & libcxx] constexpr point

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-10 Thread Hana Dusíková via cfe-commits
hanickadot wrote: > Hmm, so needs to somehow allow accessing bits that aren't low bits? yes, for example upper byte on aarch64 > As a general comment not specific to this patch, I'd prefer to build around > llvm.ptrmask and geps as much as possible, as opposed to relying on ptrtoint. I 100% a

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-10 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/111861 From e1c8d5e689fe8d3d0338eb64220aaf6371aed48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 10 Oct 2024 21:05:55 +0200 Subject: [PATCH] [clang & libcxx] constexpr pointer t

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-10 Thread Hana Dusíková via cfe-commits
hanickadot wrote: > Is there some explanation of the set of builtins you chose somewhere? How is > "masking" a pointer different from the existing > __builtin_align_down/__builtin_align_up? Intention is to allow to use any bits in pointer for tagging and give freedom. To do so. I'm not propos

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-10 Thread Hana Dusíková via cfe-commits
hanickadot wrote: example of simple usage: ```c++ int64_t a = 42; uintptr_t tag = 0b101u; auto tptr = std::tagged_ptr(&a, tag); assert(tptr.unsafe_dirty_pointer() != &a); int64_t * original = tptr.pointer(); assert(tag == tptr.tag()); assert(original == &a); auto [p, t] = tptr; as

[clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)

2024-10-10 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot created https://github.com/llvm/llvm-project/pull/111861 This PR is not for merging! It's just for reviewing design meant for standard library proposal P3125 (pointer tagging) This code allows us to do pointer tagging in a safe way and also in constexpr. It's all

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-19 Thread Hana Dusíková via cfe-commits
hanickadot wrote: I was also implementing this and run into an issue, so I looked into your implementation and you have exactly same issue as I do, following code will fail: ```c++ namespace std { template consteval bool is_within_lifetime(const T * ptr) noexcept { return __builtin_is

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-19 Thread Hana Dusíková via cfe-commits
@@ -17264,3 +17288,76 @@ bool Expr::tryEvaluateStrLen(uint64_t &Result, ASTContext &Ctx) const { EvalInfo Info(Ctx, Status, EvalInfo::EM_ConstantFold); return EvaluateBuiltinStrLen(this, Result, Info); } + +namespace { +struct IsWithinLifetimeHandler { + EvalInfo &Info; +

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-19 Thread Hana Dusíková via cfe-commits
@@ -3760,6 +3765,9 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, if ((O->isAbsent() && !(handler.AccessKind == AK_Construct && I == N)) || (O->isIndeterminate() && !isValidIndeterminateAccess(handler.AccessKind))) { + // O

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-19 Thread Hana Dusíková via cfe-commits
@@ -3927,6 +3935,9 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, // Placement new onto an inactive union member makes it active. O->setUnion(Field, APValue()); } else { +// Pointer to/into inactive unio

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

2024-07-29 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From e21d8acf36c188056bc2f08b60470fdd6d62cf7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 13 Jul 2024 20:59:22 +0200 Subject: [PATCH] [clang] constexpr atomic builtins (__

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-22 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot closed https://github.com/llvm/llvm-project/pull/99773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-22 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/99773 From ebf1c6996f18cbd706ec3d76a1887c58c9ce3230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 20 Jul 2024 20:12:45 +0200 Subject: [PATCH 1/2] [clang-tidy] `bugprone-exception-

[clang] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-07-21 Thread Hana Dusíková via cfe-commits
hanickadot wrote: When this change is building at Compiler Explorer I noticed it spams build output with warnings: ``` In file included from /root/llvm-project/clang/include/clang/AST/Type.h:31, from /root/llvm-project/clang/include/clang/AST/DeclarationName.h:16,

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-21 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/99773 From ebf1c6996f18cbd706ec3d76a1887c58c9ce3230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 20 Jul 2024 20:12:45 +0200 Subject: [PATCH] [clang-tidy] `bugprone-exception-esca

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-21 Thread Hana Dusíková via cfe-commits
@@ -518,6 +518,10 @@ Changes in existing checks usages of ``std::string_view::compare``. Added a `StringLikeClasses` option to detect usages of ``compare`` method in custom string-like classes. +- Improved :doc:`exception-escape ` hanickadot wrote: Oh, s

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-20 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/99773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-20 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/99773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-20 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/99773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-20 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot created https://github.com/llvm/llvm-project/pull/99773 As in title, code which check eligibility of exceptions with pointer types to be handled by exception handler of type `void *` disallowed this case. It was check: ```c++ if (isStandardPointerConvertible(Exce

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

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From f308fee20b44b1a7f83ca0038acf7b43fdd46fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 13 Jul 2024 20:59:22 +0200 Subject: [PATCH] [clang] constexpr atomic builtins (__

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

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From 76fe494219d085247e537b3633c321ffe2917226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 13 Jul 2024 20:10:26 +0200 Subject: [PATCH 1/2] [clang] constexpr atomic builtins

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

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From 76fe494219d085247e537b3633c321ffe2917226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 13 Jul 2024 20:10:26 +0200 Subject: [PATCH] [clang] constexpr atomic builtins (__

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

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot created https://github.com/llvm/llvm-project/pull/98756 This implements clang support for P3309 constexpr std::atomic & std::atomic_ref (currently in LWG) by allowing constant evaluation of clang's __c11_atomic_OP and GCC's __atomic_OP builtins. From e42b4a8877fe

[clang] [libcxx] [clang] [libc++] P3309 constexpr atomic and atomic ref [WIP] (PR #98738)

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot closed https://github.com/llvm/llvm-project/pull/98738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] [libc++] P3309 constexpr atomic and atomic ref [WIP] (PR #98738)

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98738 From c691efa7649c990814bb363511106457e306aefa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 13 Jul 2024 14:28:07 +0200 Subject: [PATCH] [clang] [libc++] atomic constexpr sup

[clang] [libcxx] [clang] [libc++] P3309 constexpr atomic and atomic ref [WIP] (PR #98738)

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98738 From 83645b161f62bbff2baf5a90eef2c6cd1b280180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 13 Jul 2024 13:12:24 +0200 Subject: [PATCH] [clang] [libc++] atomic constexpr sup

[clang] [libcxx] [clang] [libc++] P3309 constexpr atomic and atomic ref [WIP] (PR #98738)

2024-07-13 Thread Hana Dusíková via cfe-commits
hanickadot wrote: @philnik777 I would rather not, at least for the review, manipulating two branches will be cumbersome. I can split it before merging, but as I don't expect this to happen soon, it should be fine. https://github.com/llvm/llvm-project/pull/98738

[clang] [libcxx] [clang] [libc++] P3309 constexpr atomic and atomic ref [WIP] (PR #98738)

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98738 From 63cefb0634ece515cbc1939c56d4fa2f0ef1eccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sat, 13 Jul 2024 13:12:24 +0200 Subject: [PATCH] [clang] [libc++] atomic constexpr sup

[clang] [libcxx] [clang] [libc++] P3309 constexpr atomic and atomic ref [WIP] (PR #98738)

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/98738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] [libc++] P3309 constexpr atomic and atomic ref [WIP] (PR #98738)

2024-07-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/98738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Suppress covmap and profdata for system headers. (PR #97952)

2024-07-07 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/97952 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-06-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot approved this pull request. https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-06-13 Thread Hana Dusíková via cfe-commits
@@ -2122,20 +2135,70 @@ struct CounterCoverageMappingBuilder subtractCounters(ParentCount, TrueCount)); } - void createDecision(const BinaryOperator *E) { + void createOrCancelDecision(const BinaryOperator *E, unsigned Since) { unsigned NumCon

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-06-13 Thread Hana Dusíková via cfe-commits
@@ -2122,20 +2135,70 @@ struct CounterCoverageMappingBuilder subtractCounters(ParentCount, TrueCount)); } - void createDecision(const BinaryOperator *E) { + void createOrCancelDecision(const BinaryOperator *E, unsigned Since) { unsigned NumCon

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-06-13 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-06-13 Thread Hana Dusíková via cfe-commits
@@ -14416,7 +14416,7 @@ Syntax: :: declare void @llvm.instrprof.mcdc.tvbitmap.update(ptr , i64 , -i32 ) +i32 ) hanickadot wrote: I saw a patt

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-06-13 Thread Hana Dusíková via cfe-commits
@@ -484,10 +484,31 @@ MC/DC Instrumentation - When instrumenting for Modified Condition/Decision Coverage (MC/DC) using the -clang option ``-fcoverage-mcdc``, users are limited to at most **six** leaf-level -conditions in a boolean expression. A warning w

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-23 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Rework !SystemHeadersCoverage (PR #91446)

2024-05-20 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/91446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread Hana Dusíková via cfe-commits
hanickadot wrote: > @hanickadot Your comments to `llvm/CoverageMapping.cpp` are not for this PR. > See #80676 . > > They are my preferences. Didn't know the context, I saw it green as added. Just ignore it. https://github.com/llvm/llvm-project/pull/82448 __

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread Hana Dusíková via cfe-commits
@@ -223,9 +223,130 @@ Expected CounterMappingContext::evaluate(const Counter &C) const { return LastPoppedValue; } +mcdc::TVIdxBuilder::TVIdxBuilder(const SmallVectorImpl &NextIDs, + int Offset) +: Indices(NextIDs.size()) { + // Construc

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread Hana Dusíková via cfe-commits
@@ -223,9 +223,130 @@ Expected CounterMappingContext::evaluate(const Counter &C) const { return LastPoppedValue; } +mcdc::TVIdxBuilder::TVIdxBuilder(const SmallVectorImpl &NextIDs, + int Offset) +: Indices(NextIDs.size()) { + // Construc

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread Hana Dusíková via cfe-commits
@@ -1959,9 +2013,44 @@ struct CounterCoverageMappingBuilder subtractCounters(ParentCount, TrueCount)); } + void RewindDecision(unsigned Since) { +#ifndef NDEBUG +llvm::DenseSet SeenIDs; +#endif +unsigned NConds = 0; hanickadot

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread Hana Dusíková via cfe-commits
@@ -223,9 +223,130 @@ Expected CounterMappingContext::evaluate(const Counter &C) const { return LastPoppedValue; } +mcdc::TVIdxBuilder::TVIdxBuilder(const SmallVectorImpl &NextIDs, + int Offset) +: Indices(NextIDs.size()) { + // Construc

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot requested changes to this pull request. https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread Hana Dusíková via cfe-commits
@@ -723,7 +737,15 @@ struct MCDCCoverageBuilder { if (I == CondIDs.end()) return -1; else - return I->second; + return I->second.ID; + } + + void ccc(const Expr *CondExpr, mcdc::ConditionIDs IDs) { hanickadot wrote: this should be nam

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeCoverage] Fix CoverageMapping for binary conditionals ops (PR #82141)

2024-02-18 Thread Hana Dusíková via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s | FileCheck %s + +// CHECK-LABEL: binary_conditional: +// CHECK-NEXT: File 0, [[@LINE+4]]:31 -> {{

[clang] [clang][CodeCoverage] Fix CoverageMapping for binary conditionals ops (PR #82141)

2024-02-18 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot approved this pull request. Small typo in test. Otherwise LGTM https://github.com/llvm/llvm-project/pull/82141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [clang][CodeCoverage] Fix CoverageMapping for binary conditionals ops (PR #82141)

2024-02-18 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/82141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot closed https://github.com/llvm/llvm-project/pull/80292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From 886cd32ef022fcb7c5a4604c5238074a54f78b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] [coverage] fix crash in code coverage

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From af3118a1bbc071ec5d3a9d5b43cce66b0fe828e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] [coverage] fix crash in code coverage

[llvm] [mlir] [clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From 4b2d3b7b8f04510f791e4d3cc68b2de5a273c735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] [coverage] fix crash in code coverage

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
@@ -234,6 +234,35 @@ constexpr int check_macro_consteval_if_skipped(int i) { // CHECK-NEXT: [[@LINE return i; } +struct false_value { + constexpr operator bool() { +return false; + } +}; + +template struct dependable_false_value { + constexpr operator bool() { +

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From 4b2d3b7b8f04510f791e4d3cc68b2de5a273c735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] [coverage] fix crash in code coverage

  1   2   >