[libcxx] [libunwind] [llvm] [libc++] Upgrade to GCC 15 (PR #138293)

2025-05-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/138293 >From e735a57745e840f4a19bdd433e823a851890bcbe Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 2 May 2025 17:24:13 +0200 Subject: [PATCH] [libc++] Upgrade to GCC 15 --- .github/workflows/libcxx-bu

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-05-27 Thread Nikolas Klauser via cfe-commits
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static QualType CopyCV(QualType From, QualType To) { + if (From.isConstQualified()) +To.addConst(); + if (From.isVolatileQualified()) +To.addVolatile(); + retur

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-05-27 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > This seems reasonable to me? I'm not a huge fan of how much is being put into > `SemaTemplate.cpp` to support all the builtins though. I'm wondering if we > need to split that up in a follow-up and have a `SemaTemplateBuiltins` for > all of these to live. I can take a look

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-05-24 Thread Nikolas Klauser via cfe-commits
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static QualType CopyCV(QualType From, QualType To) { + if (From.isConstQualified()) +To.addConst(); + if (From.isVolatileQualified()) +To.addVolatile(); + retur

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-05-24 Thread Nikolas Klauser via cfe-commits
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static QualType CopyCV(QualType From, QualType To) { + if (From.isConstQualified()) +To.addConst(); + if (From.isVolatileQualified()) +To.addVolatile(); + retur

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-30 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Gentle ping @AaronBallman @cor3ntin https://github.com/llvm/llvm-project/pull/116709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [libcxxabi] [libunwind] [llvm] [libc++] Upgrade to GCC 15 (PR #138293)

2025-06-06 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/138293 >From 633b22215dd7b4addf5a9e1718a76030dd37f9e9 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 2 May 2025 17:24:13 +0200 Subject: [PATCH] [libc++] Upgrade to GCC 15 --- .github/workflows/libcxx-bu

[libunwind] [libunwind] Remove checks for -nostdlib++ (PR #143162)

2025-06-06 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/143162 libunwind uses a C linker, so it's never even trying to link against any C++ libraries. This removes the code which tries to drop C++ libraries, which makes the CMake configuration simpler and allows for upg

[libunwind] [libunwind] Remove checks for -nostdlib++ (PR #143162)

2025-06-11 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/143162 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/6] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/6] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] Docs: ambiguous use of "explicitly" in [[clang::no_specializaiton]] (PR #143839)

2025-06-12 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > This looks fine. The meaning is clear. (If anything, the C++ standard should > have a better way to talk about "partial or explicit specializations") Given that the whole argument to change this is that it's closer to the standard wording I don't see how the current change

[libunwind] [libunwind] Don't override LINKER_LANGUAGE (PR #143533)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 requested changes to this pull request. I don't think this is required, or even works after #143162. https://github.com/llvm/llvm-project/pull/143533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] Docs: ambiguous use of "explicitly" in [[clang::no_specializaiton]] (PR #143839)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 requested changes to this pull request. This seems incorrect. A specialization is instantiated or an explicit specialization according to https://eel.is/c++draft/temp.spec.general#4, which is definitely _not_ what we mean. https://github.com/llvm/llvm-project/pull

[clang] Docs: ambiguous use of "explicitly" in [[clang::no_specializaiton]] (PR #143839)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/143839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

2025-08-11 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Ping https://github.com/llvm/llvm-project/pull/133699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Use consistent indentation in `__libunwind_config.h` (PR #152861)

2025-08-11 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: Should we maybe just set `IndentPPDirectives: AfterHash`? We already do that in libc++, libc++abi and (I think) compiler-rt. https://github.com/llvm/llvm-project/pull/152861 ___ cfe-commits mailing list cfe-com

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-21 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 milestoned https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-21 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Thanks for having a look so quickly! https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-22 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-23 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: /cherry-pick 8b3d4bd https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow non-constant sizes for __builtin_assume_dereferenceable. (PR #156929)

2025-09-04 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/156929 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Allow attributes on first constructor argument in pre-C++11 (PR #157300)

2025-09-07 Thread Nikolas Klauser via cfe-commits
@@ -6007,7 +6007,7 @@ bool Parser::isConstructorDeclarator(bool IsUnqualified, bool DeductionGuide, // A C++11 attribute here signals that we have a constructor, and is an // attribute on the first constructor parameter. - if (getLangOpts().CPlusPlus11 && + if (getLangO

[clang] [clang-tools-extra] [compiler-rt] [flang] [libcxx] [libcxxabi] [lld] [lldb] [llvm] [Inclusive Language] migrate "sanity" checks to "soundness" checks (PR #156995)

2025-09-05 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Also, please split this up. It's super hard to review, and these massive cross-project patches tend to go nowhere. https://github.com/llvm/llvm-project/pull/156995 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

2025-09-07 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: ping https://github.com/llvm/llvm-project/pull/133699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] fix pc range condition check bug (PR #154902)

2025-09-01 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @yingcong-wu The new test fails on the Arm bots. Please fix it soon or revert to get the precommit CI green again (finally). https://github.com/llvm/llvm-project/pull/154902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [Clang] Introduce __builtin_meow_synthesises_from_spaceship (PR #155612)

2025-09-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/155612 >From d5086ee9311f6667839fbb88f4ef4f99413c11bf Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Wed, 27 Aug 2025 14:28:22 +0200 Subject: [PATCH] [Clang] Introduce __builtin_meow_synthesises_from_spaceship

[libunwind] [libunwind][test] set fed test to require x86 as others arch may have cross toolchain build (PR #156383)

2025-09-03 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. LGTM assuming the CI is happy to get that green again. Though I'm not sure we want to keep the test as-is. It seems to have quite a few assumptions about the environment baked in. https://github.com/llvm/llvm-project/pull/156383 ___

[clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libcxx] [lldb] [llvm] [mlir] [openmp] Fix typos and spelling errors across codebase (PR #156270)

2025-08-31 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Please split the PR by subproject to it is easier to review and approve. Exactly what I was about to say. I don't understand why this happens again and again though. Maybe we should add some documentation somewhere that cross-project patches should be split up if it's not s

[clang] [Clang] Assume unaligned in maksed load / store builtins (PR #156063)

2025-09-12 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: IMO the right default alignment would be `alignof(*ptr)`. Objects are pretty much never underaligned, but they tend to not be overaliend unless you want something specific - at which point you can use `__builtin_assume_aligned` to inform the compiler that it can use higher al

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

2025-09-12 Thread Nikolas Klauser via cfe-commits
@@ -1256,6 +1256,18 @@ def MaskedCompressStore : Builtin { let Prototype = "void(...)"; } +def MaskedGather : Builtin { + let Spellings = ["__builtin_masked_gather"]; + let Attributes = [NoThrow, CustomTypeChecking]; philnik777 wrote: I think this is `pur

[clang] [X86] Relax AVX ABI warning on internal functions (PR #157570)

2025-09-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: Does this actually fix the linked bug report? That's about `always_inline` functions, which still have default visibility. https://github.com/llvm/llvm-project/pull/157570 ___ cfe-commits mailing list cfe-commi

[clang] [NFC][clang] replace a C-array with std::array (PR #158047)

2025-09-12 Thread Nikolas Klauser via cfe-commits
@@ -5211,11 +5211,7 @@ class SpellingList { } bool hasSpelling() const { -for (size_t Kind = 0; Kind < NumSpellingKinds; ++Kind) { - if (Spellings[Kind].size() > 0) -return true; -} -return false; +return llvm::any_of(Spellings, [](const auto &

[clang] [Clang] Introduce __builtin_meow_synthesises_from_spaceship (PR #155612)

2025-09-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/155612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Introduce __builtin_meow_synthesises_from_spaceship (PR #155612)

2025-09-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/155612 >From e2125e4c9a9d8f3b45ba28af3a54cf13626a910f Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Wed, 27 Aug 2025 14:28:22 +0200 Subject: [PATCH] [Clang] Introduce __builtin_meow_synthesises_from_spaceship

[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)

2025-08-25 Thread Nikolas Klauser via cfe-commits
@@ -65,15 +65,31 @@ void GH104391() { M; // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} } +struct S4 get_s_ignored(void) __attribute__((candiscard)); philnik777 wrote: There doesn't seem to be any testing for

[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

2025-08-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > No. We can drop `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` and > > `_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS` by replacing it with > > `_LIBCPP_EXPORTED_FROM_ABI`. > > But how will that work when building with MinGW or MSVC? Or is that not > supported? Is is supported and keeps

[clang] [Clang] Introduce __builtin_meow_synthesises_from_spaceship (PR #155612)

2025-08-27 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > This is clever: that way we know it's a pure optimization to call spaceship > instead of less-than twice. IIUC you'd plan to use this from libc++ to > optimize eg __find_equal even on user-defined types? Yes, exactly. https://github.com/llvm/llvm-project/pull/155612 __

[clang] [Clang] Add builtins for masked vector loads / stores (PR #154464)

2025-08-20 Thread Nikolas Klauser via cfe-commits
@@ -1232,6 +1232,18 @@ def ConvertVector : Builtin { let Prototype = "void(...)"; } +def MaskedLoad : Builtin { + let Spellings = ["__builtin_masked_load"]; + let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr]; philnik777 wrote: This also is

[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)

2025-08-22 Thread Nikolas Klauser via cfe-commits
@@ -3646,6 +3646,14 @@ def Unavailable : InheritableAttr { let MeaningfulToClassTemplateDefinition = 1; } +def CanDiscard : InheritableAttr { + let Spellings = [CXX11<"clang", "candiscard">, + GCC<"candiscard">]; philnik777 wrote: I don't

[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)

2025-08-22 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: Also, please remove any CCs in the description. This causes a ping to the people every time the commit is pushed anywhere on GitHub, causing a lot of spam. https://github.com/llvm/llvm-project/pull/154943 ___

[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)

2025-08-22 Thread Nikolas Klauser via cfe-commits
@@ -199,6 +199,10 @@ Removed Compiler Flags Attribute Changes in Clang -- +- A new attribute ``[[clang::candiscard]]`` can be applied to a function returning a nodiscard type philnik777 wrote: IMO `discardable` would be a good name, b

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-22 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @tbaederr Thanks! I'll merge it once the fix on our side is ready. https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Allow __builtin_fma/fmaf/fmal to be used in a constant expression (PR #158048)

2025-09-17 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. The libc++ part LGTM. https://github.com/llvm/llvm-project/pull/158048 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Allow __builtin_fma/fmaf/fmal to be used in a constant expression (PR #158048)

2025-09-17 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > The libc++ part LGTM. > > Any advice on the libcxx buildbot CI failures? The regex/locale failures on apple platforms are unrelated - most likely due to an OS update (if we don't fix it soon we'll XFAIL the tests). The android failures should be fixed in trunk I think, b

[clang] [libcxx] [clang][libc++] Fix spelling of "synthesize" (PR #158523)

2025-09-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 requested changes to this pull request. AFAICT both spellings are correct. What's the reasoning for switching it? https://github.com/llvm/llvm-project/pull/158523 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[libcxx] [libcxxabi] [libunwind] [libcxx][CI] Use lld for everything in the ARM picolib builds (PR #158320)

2025-09-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. I'm happy with this if it's the preferred way to build things for picolibc. https://github.com/llvm/llvm-project/pull/158320 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [libclc] [Clang] Rename elementwise builtins to `clzg` and `ctzg` (PR #157128)

2025-09-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: FWIW I'm in favour of the renaming. Having consistent naming for the `__builtin_elementwise_*` and `__builtin_*` functions is IMO much more valuable than being consistent with compiler-internal naming. https://github.com/llvm/llvm-project/pull/157128 __

[clang] [libcxx] [Clang] Allow __builtin_fma/fmaf/fmal to be used in a constant expression (PR #158048)

2025-09-20 Thread Nikolas Klauser via cfe-commits
@@ -194,11 +194,19 @@ int main(int, char**) { ASSERT_NOT_CONSTEXPR_CXX23(std::fminf(1.0f, 0.0f) == 0.0f); ASSERT_NOT_CONSTEXPR_CXX23(std::fminl(1.0L, 0.0L) == 0.0L); +#if !__has_constexpr_builtin(__builtin_fma) ASSERT_NOT_CONSTEXPR_CXX23(std::fma(1.0f, 1.0f, 1.0f) == 2.

[clang] [clang][sema] Add nonnull attribute to builtin format functions (PR #158626)

2025-09-16 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/158626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][sema] Add nonnull attribute to builtin format functions (PR #158626)

2025-09-16 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: Is this a good idea? This doesn't just add diagnostics, but also makes it UB to pass a nullptr to these functions. What do actual libc implementations do when they are passed a nullptr? Do any of them define that behaviour? https://github.com/llvm/llvm-

[clang] [libcxx] [Clang] Allow __builtin_fma/fmaf/fmal to be used in a constant expression (PR #158048)

2025-09-18 Thread Nikolas Klauser via cfe-commits
@@ -194,11 +194,19 @@ int main(int, char**) { ASSERT_NOT_CONSTEXPR_CXX23(std::fminf(1.0f, 0.0f) == 0.0f); ASSERT_NOT_CONSTEXPR_CXX23(std::fminl(1.0L, 0.0L) == 0.0L); +#if !__has_constexpr_builtin(__builtin_fma) ASSERT_NOT_CONSTEXPR_CXX23(std::fma(1.0f, 1.0f, 1.0f) == 2.

[clang] [libcxx] [Clang] Allow __builtin_fma/fmaf/fmal to be used in a constant expression (PR #158048)

2025-09-20 Thread Nikolas Klauser via cfe-commits
@@ -194,11 +194,17 @@ int main(int, char**) { ASSERT_NOT_CONSTEXPR_CXX23(std::fminf(1.0f, 0.0f) == 0.0f); ASSERT_NOT_CONSTEXPR_CXX23(std::fminl(1.0L, 0.0L) == 0.0L); +#if !__has_constexpr_builtin(__builtin_fma) ASSERT_NOT_CONSTEXPR_CXX23(std::fma(1.0f, 1.0f, 1.0f) == 2.

[clang] [NFC][clang] Quote literal builtin attribute markers in Builtins.def docs (PR #160080)

2025-09-22 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > and just left a 'link' to it here instead? > > Also, is there a reason why we can’t just delete this file entirely and put > the link e.g. in `Builtins.td`/`BuiltinsBase.td` Since this isn't useful for the tablegen files I'm not sure that makes a ton of sense. Maybe rath

[clang] [Tooling] Simplify a use of std::is_same (NFC) (PR #160237)

2025-09-23 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > std::is_same<...>::type is the same as std::is_same<...>. This is technically not true. `is_same::type` names a specialization of `integral_constant`, not `is_same`. https://github.com/llvm/llvm-project/pull/160237 ___ cfe-commits

[clang] [clang] Implement __builtin_rotate{left,right}g (PR #160259)

2025-09-23 Thread Nikolas Klauser via cfe-commits
@@ -64,3 +101,39 @@ long long rotr64(long long x, unsigned long long y) { return __builtin_rotateright64(x, y); } +// CHECK-LABEL: test_builtin_rotaterightg +void test_builtin_rotaterightg(unsigned char uc, unsigned short us, + unsigned int ui,

[clang] [clang] Implement __builtin_rotate{left,right}g (PR #160259)

2025-09-23 Thread Nikolas Klauser via cfe-commits
@@ -767,12 +767,24 @@ def RotateLeft : BitInt8_16_32_64BuiltinsTemplate, Builtin { let Prototype = "T(T, T)"; } +def RotateLeftg : Builtin { + let Spellings = ["__builtin_rotateleftg"]; + let Attributes = [NoThrow, Const, Constexpr, CustomTypeChecking]; + let Prototype =

[clang] [clang] Implement __builtin_rotate{left,right}g (PR #160259)

2025-09-24 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s philnik777 wrote: Should the target be pinned? Then the `#ifdef`s wouldn't be necessary anymore I think. https://github.com/llvm/llvm-project/pull/160259 _

[clang] [clang] Implement __builtin_rotate{left,right}g (PR #160259)

2025-09-24 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +char stdc_rotateleft1[__builtin_stdc_rotate_left((unsigned char)0xB1, 3) == 0x8D ? 1 : -1]; philnik777 wrote: I'm pretty sure `static_assert`s are the recommended way to

[clang] [clang] Implement __builtin_rotate{left,right}g (PR #160259)

2025-09-24 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: Oh, you should also update the title. https://github.com/llvm/llvm-project/pull/160259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang][libc++] Fix spelling of "synthesize" (PR #158523)

2025-09-24 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: But please add the reasoning in the description. https://github.com/llvm/llvm-project/pull/158523 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement __builtin_stdc_rotate_left, __builtin_stdc_rotate_right (PR #160259)

2025-09-24 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. LGTM, but let's wait for one of the Clang people to take another look. https://github.com/llvm/llvm-project/pull/160259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

<    2   3   4   5   6   7