[clang] [Clang] Remove __is_nullptr (PR #99038)

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

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-05 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 %s -verify + +#if !__has_cpp_attribute(clang::diagnose_specializations) +# error +#endif + +struct [[clang::diagnose_specializations]] S {}; // expected-warning {{'diagnose_specializations' attribute only applies to class templates}} + +templ

[clang] [Clang] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [flang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-08-17 Thread Nikolas Klauser via cfe-commits
@@ -14638,6 +14649,8 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { return true; } + case Builtin::BIfmin: + case Builtin::BIfminf: philnik777 wrote: I don't think anything should happen to the libc++ documentation in this patch. We

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-20 Thread Nikolas Klauser via cfe-commits
@@ -3327,6 +3330,15 @@ def DiagnoseIf : InheritableAttr { let Documentation = [DiagnoseIfDocs]; } +def DiagnoseSpecializations : InheritableAttr { + let Spellings = [Clang<"diagnose_specializations", /*AllowInC*/0>]; + let Args = [StringArgument<"Message", 1>]; ---

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-20 Thread Nikolas Klauser via cfe-commits
@@ -3327,6 +3330,15 @@ def DiagnoseIf : InheritableAttr { let Documentation = [DiagnoseIfDocs]; } +def DiagnoseSpecializations : InheritableAttr { + let Spellings = [Clang<"diagnose_specializations", /*AllowInC*/0>]; philnik777 wrote: Do explicit specializ

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-08-25 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/106005 This starts moving `X86Builtins.def` to be a tablegen file. It's quite large, so I think it'd be good to move things in multiple steps to avoid a bunch of merge conflicts due to the amount of time this takes

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-25 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/6] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Nikolas Klauser via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { + const LangOptions &Lang = PP.getLangOpts(); + const StringRef Name = II->getName(); + + if

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Does it makes sense to also support function templates? For example, my > understanding is that specializing `is_pointer_interconvertible_with_class()` > would be UB I can't find anything explicit about function template specializations, so I'm not 100% sure whether it's a

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-06-26 Thread Nikolas Klauser via cfe-commits
@@ -3636,6 +3648,22 @@ def Fmin : FPMathTemplate, LibBuiltin<"math.h"> { let OnlyBuiltinPrefixedAliasIsConstexpr = 1; } +def FmaximumNum : FPMathTemplate, LibBuiltin<"math.h"> { philnik777 wrote: In that case this should probably be a `GNULibBuiltin`. Or is

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-27 Thread Nikolas Klauser via cfe-commits
@@ -1126,9 +1126,6 @@ class QualType { /// Return true if this is a trivially relocatable type. bool isTriviallyRelocatableType(const ASTContext &Context) const; - /// Return true if this is a trivially equality comparable type. - bool isTriviallyEqualityComparableType(c

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-27 Thread Nikolas Klauser via cfe-commits
@@ -1126,9 +1126,6 @@ class QualType { /// Return true if this is a trivially relocatable type. bool isTriviallyRelocatableType(const ASTContext &Context) const; - /// Return true if this is a trivially equality comparable type. - bool isTriviallyEqualityComparableType(c

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-27 Thread Nikolas Klauser via cfe-commits
@@ -1126,9 +1126,6 @@ class QualType { /// Return true if this is a trivially relocatable type. bool isTriviallyRelocatableType(const ASTContext &Context) const; - /// Return true if this is a trivially equality comparable type. - bool isTriviallyEqualityComparableType(c

[clang] [TBAA] Emit distinct TBAA tags for pointers with different depths,types. (PR #76612)

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

[clang] [TBAA] Emit distinct TBAA tags for pointers with different depths,types. (PR #76612)

2024-06-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: First of all I want to say that this is a really cool project, especially the type sanitizer part. Thanks for working on this! > Just updated the tysan branches again. Unfortunately we aren't yet at a point > where LLVM is `tysan` clean, there is a larg

[clang] [TBAA] Emit distinct TBAA tags for pointers with different depths,types. (PR #76612)

2024-06-27 Thread Nikolas Klauser via cfe-commits
@@ -392,6 +392,10 @@ Non-comprehensive list of changes in this release - ``#pragma GCC diagnostic warning "-Wfoo"`` can now downgrade ``-Werror=foo`` errors and certain default-to-error ``-W`` diagnostics to warnings. +- Clang now emits distinct type-based alias analysis tag

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-27 Thread Nikolas Klauser via cfe-commits
@@ -1126,9 +1126,6 @@ class QualType { /// Return true if this is a trivially relocatable type. bool isTriviallyRelocatableType(const ASTContext &Context) const; - /// Return true if this is a trivially equality comparable type. - bool isTriviallyEqualityComparableType(c

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/93113 >From 3998e9a8e130677f5932b744c0f4487861a54710 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 23 May 2024 01:48:06 +0200 Subject: [PATCH] [Clang] Fix __is_trivially_equality_comparable returning tru

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

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

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-28 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @ZequanWu Could you give me a reproducer? Ther CI failure looks pretty unrelated to me, since it complains about LeakSanitizer. The next build was also green. https://github.com/llvm/llvm-project/pull/93113 ___ cfe-commits mailing l

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-28 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @ZequanWu I can't successfully build your reproducer with clang trunk. Would it be possible to provide the full test case or a fully reduced one? https://github.com/llvm/llvm-project/pull/93113 ___ cfe-commits mailing list cfe-commit

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-06-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/70976 >From a91f499900d4cea4804833d004b6c4e54a7d8b15 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sun, 3 Sep 2023 17:26:28 -0700 Subject: [PATCH 1/2] [clang] Extend diagnose_if to accept more detailed warni

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-06-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/70976 >From a91f499900d4cea4804833d004b6c4e54a7d8b15 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sun, 3 Sep 2023 17:26:28 -0700 Subject: [PATCH 1/3] [clang] Extend diagnose_if to accept more detailed warni

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-12 Thread Nikolas Klauser via cfe-commits
@@ -870,7 +872,8 @@ class DiagnosticsEngine : public RefCountedBase { /// \param FormatString A fixed diagnostic format string that will be hashed /// and mapped to a unique DiagID. template - unsigned getCustomDiagID(Level L, const char (&FormatString)[N]) { + [[depr

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-12 Thread Nikolas Klauser via cfe-commits
@@ -200,7 +273,33 @@ class DiagnosticIDs : public RefCountedBase { // FIXME: Replace this function with a create-only facilty like // createCustomDiagIDFromFormatString() to enforce safe usage. At the time of // writing, nearly all callers of this function were invalid.

[clang] b433023 - [Clang][NFC] Remove trailing whitespace from clang/tools/libclang/CXStoredDIagnostic.cpp

2024-09-12 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2024-09-12T15:43:27+02:00 New Revision: b43302372f592fd48a22d32b2603f8efee40a88e URL: https://github.com/llvm/llvm-project/commit/b43302372f592fd48a22d32b2603f8efee40a88e DIFF: https://github.com/llvm/llvm-project/commit/b43302372f592fd48a22d32b2603f8efee40a88e.dif

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-12 Thread Nikolas Klauser via cfe-commits
@@ -269,11 +268,60 @@ CATEGORY(INSTALLAPI, REFACTORING) return Found; } -DiagnosticMapping DiagnosticIDs::getDefaultMapping(unsigned DiagID) { +//===--===// +// Custom Diagnostic information +//===--

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-12 Thread Nikolas Klauser via cfe-commits
@@ -200,7 +273,33 @@ class DiagnosticIDs : public RefCountedBase { // FIXME: Replace this function with a create-only facilty like // createCustomDiagIDFromFormatString() to enforce safe usage. At the time of // writing, nearly all callers of this function were invalid.

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

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

[clang] [clang-tools-extra] [flang] Reapply "[clang] Extend diagnose_if to accept more detailed warning information (#70976)" (PR #108453)

2024-09-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/108453 This reverts commit e0cd11eba526234ca14a0b91f5598ca3363b6aca. Fix flang >From b429f137f3c1e2b2a72c9f3f444f6d43a8b5e35d Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 12 Sep 2024 21:27:27 +0200 S

[clang] [clang-tools-extra] [flang] Reapply "[clang] Extend diagnose_if to accept more detailed warning information (#70976)" (PR #108453)

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

[clang] [llvm] Prefer std::getenv to ::getenv (PR #108529)

2024-09-13 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: If the implementation is conforming this doesn't do anything. In fact, they have to be the same function. https://github.com/llvm/llvm-project/pull/108529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-09-14 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: gentle ping~ https://github.com/llvm/llvm-project/pull/106005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_common_type (PR #99473)

2024-09-14 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: gentle ping~ https://github.com/llvm/llvm-project/pull/99473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] e392056 - Reapply "Reapply "[clang] Extend diagnose_if to accept more detailed warning information (#70976)" (#108453)"

2024-09-14 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2024-09-14T22:25:08+02:00 New Revision: e39205654dc11c50bd117e8ccac243a641ebd71f URL: https://github.com/llvm/llvm-project/commit/e39205654dc11c50bd117e8ccac243a641ebd71f DIFF: https://github.com/llvm/llvm-project/commit/e39205654dc11c50bd117e8ccac243a641ebd71f.dif

[clang-tools-extra] e392056 - Reapply "Reapply "[clang] Extend diagnose_if to accept more detailed warning information (#70976)" (#108453)"

2024-09-14 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2024-09-14T22:25:08+02:00 New Revision: e39205654dc11c50bd117e8ccac243a641ebd71f URL: https://github.com/llvm/llvm-project/commit/e39205654dc11c50bd117e8ccac243a641ebd71f DIFF: https://github.com/llvm/llvm-project/commit/e39205654dc11c50bd117e8ccac243a641ebd71f.dif

[clang] [Clang] Allow user defined conversion implicit cast to _Complex types in constant expressions (PR #108758)

2024-09-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. https://github.com/llvm/llvm-project/pull/108758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-10-09 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,63 @@ +//===-- clang/Support/Compiler.h - Compiler abstraction support -*- 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-Identifier: Apa

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-09 Thread Nikolas Klauser via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, reinterpret_cast(std::_

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-09 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > ACK. Not a standard requirement though, is it? > > Correct, it's only UB on non-trivially-copyable. My point was more about if > we want to be consistent with GCC or not. I don't have any strong opinion on > that. I can see an argument that a user probably is doing somet

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-10 Thread Nikolas Klauser via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] [libcxx] [Clang] Add __builtin_common_type (PR #99473)

2024-10-06 Thread Nikolas Klauser via cfe-commits
@@ -14,16 +14,30 @@ #include <__type_traits/decay.h> #include <__type_traits/is_same.h> #include <__type_traits/remove_cvref.h> +#include <__type_traits/type_identity.h> #include <__type_traits/void_t.h> #include <__utility/declval.h> +#include <__utility/empty.h> #if !def

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-19 Thread Nikolas Klauser via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] [clang] constexpr built-in fma function. (PR #113020)

2024-10-21 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Ah, it's #88978 https://github.com/llvm/llvm-project/pull/113020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Builtin] add __builtin_exit (PR #74803)

2024-10-21 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/74803 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Builtin] add __builtin_exit (PR #74803)

2024-10-21 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Closing, since it seems to be abandoned. https://github.com/llvm/llvm-project/pull/74803 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in fma function. (PR #113020)

2024-10-21 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: This is definitely a requirement to implement this, but we also have to make the non-`__builtin_`-prefixed versions `constexpr`, since libc++ doesn't control their definitions. I'm pretty sure there was a PR that does this for some math function, but I can't find it right now

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-20 Thread Nikolas Klauser via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-22 Thread Nikolas Klauser via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] Add isTrivial() and isTriviallyCopyable() AST matchers (PR #90634)

2024-10-12 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: While the libc++ checks are in the same tree as clang-tidy itself we (libc++) don't actually consider them in-tree, since they are compiled as a plugin against a clang-tidy that's already installed on the system. https://github.com/llvm/llvm-project/pull/90634 ___

[clang] [clang] Mark `__builtin_convertvector` and `__builtin_shufflevector` as `constexpr`. (PR #112129)

2024-10-14 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > You can directly view it from the Clang AST on Godbolt. For this patch, I > don't believe additional tests are necessary. > > Any bugfix should contain a regression test. Here you could simply check that `__has_constexpr_builtin` is true for these builtins, since that is

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-10-29 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,137 @@ +//===--- BuiltinsX86.td - X86 Builtin function database -*- 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-Identifier: Ap

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-10-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > No objections to this patch, I do want to see other targets moved over as > well though, instead of x86 ending up being treated as a special/weird case. That is the plan. It just takes time to move everything. FWIW Hexagon and RISCV already use TableGen files as well. > I

[clang] [clang] constexpr built-in fma function. (PR #113020)

2024-10-22 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Sorry, I don't feel qualified to approve this. https://github.com/llvm/llvm-project/pull/113020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-22 Thread Nikolas Klauser via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] [libcxx] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-24 Thread Nikolas Klauser via cfe-commits
@@ -638,7 +638,7 @@ __uninitialized_allocator_relocate(_Alloc& __alloc, _Tp* __first, _Tp* __last, _ __guard.__complete(); std::__allocator_destroy(__alloc, __first, __last); } else { -__builtin_memcpy(__result, __first, sizeof(_Tp) * (__last - __first)); +__

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-10-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/106005 >From e3dbf737df53e4618e076fae7d913261fc47ba97 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sun, 25 Aug 2024 21:53:41 +0200 Subject: [PATCH] [Clang] Start moving X86Builtins.def to X86Builtins.td ---

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-10-30 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > The MSVC FE team hasn't expressed enthusiasm for adding ugly spellings. If > > I learn more I'll relay that info. > > Thank you for checking! Unfortunately, I think that's a reason for Clang to > not support it for the `msvc` vendor prefix either. What is the alternative

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-10-30 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @AaronBallman @RKSimon does this look good to you? https://github.com/llvm/llvm-project/pull/106005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-10-30 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > I'm personally sympathetic, and would be ok with something that we know MSVC > won't step on (`__clang_msvc__` would be fine to me). As far as the > `no_unique_address`, I THINK we already get the double-underscore spelling of > that, don't we? I don't think we exclude the

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-10-30 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > > > The MSVC FE team hasn't expressed enthusiasm for adding ugly spellings. > > > > If I learn more I'll relay that info. > > > > > > > > > Thank you for checking! Unfortunately, I think that's a reason for Clang > > > to not support it for the `msvc` vendor prefix eithe

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-10-30 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/106005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Merge some delarations which currently have different attributes (PR #79349)

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

[clang] [libcxx] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-28 Thread Nikolas Klauser via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-10-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 ready_for_review https://github.com/llvm/llvm-project/pull/113765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-10-27 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > How would that be used? MSVC seems to not like the ugly spelling > https://compiler-explorer.com/z/Kb85YY18P We need `[[msvc::no_unique_address]]` in libc++ for Windows but don't support MSVC, only clang-cl, so we can make use of this spelling to avoid grabbing the tokens.

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-10-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/113765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-11-08 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @AaronBallman I'm not _super_ worried about these specific cases, but I'd like to know how to proceed with `msvc` attributes we'd like to use in libc++ generally. e.g. `msvc::intrinsic` would be quite nice and doesn't actually need to be bound to the MSVC ABI. Also, as more a

[clang] [libcxx] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. The libc++ LGTM. https://github.com/llvm/llvm-project/pull/111434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/111434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-10-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/113765 This is required to avoid macro clashing when using attributes like `[[msvc::no_unique_address]]`. This patch also refactor the logic for attribute scope __uglification__ into a single place to make it easi

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-12 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > I went for only adding `[[clang::no_specialization]]` to function > > templates, since the other cases seem even more unlikely to me and seem to > > have a higher implementation complexity. Is that OK? > > Your test coverage also handles class templates and variable templ

[clang] [libcxx] [Clang] Add __builtin_common_type (PR #99473)

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

[clang] [Clang] Remove __is_nullptr from the list of type traits (PR #109533)

2024-09-21 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/109533 Support for `__is_nullptr` was removed in #99038, but I forgot to remove it from the list of type traits, resulting in Clang crashing when one tries to use it. >From db8690cdbc2a218692d8fc83398beecf8853bae

[clang] d296902 - [Clang] Remove __is_nullptr from the list of type traits

2024-09-21 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2024-09-21T18:38:15+02:00 New Revision: d2969022640a94b26b7324241e13d67080554d9f URL: https://github.com/llvm/llvm-project/commit/d2969022640a94b26b7324241e13d67080554d9f DIFF: https://github.com/llvm/llvm-project/commit/d2969022640a94b26b7324241e13d67080554d9f.dif

[clang] [Clang] Remove __is_nullptr from the list of type traits (PR #109533)

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

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2024-11-06 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Maybe a stupid question, but couldn't we make the function simply `__attribute__((overloadable, enable_if(true, ""))) `? https://github.com/llvm/llvm-project/pull/115099 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[libcxx] [libcxxabi] [libunwind] [llvm] [libc++] Unify the benchmarks with the test suite (PR #101399)

2024-11-07 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. https://github.com/llvm/llvm-project/pull/101399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Nikolas Klauser via cfe-commits
@@ -473,6 +473,7 @@ def ExpansionToDefined : DiagGroup<"expansion-to-defined">; def FlagEnum : DiagGroup<"flag-enum">; def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>; def InfiniteRecursion : DiagGroup<"infinite-recursion">; +def InvalidSpecialization

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

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

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-27 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @AaronBallman @cor3ntin are you happy as well? https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

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

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-11-18 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Closing for now. I hope MSVC will add it, but I don't really expect it unfortunately. https://github.com/llvm/llvm-project/pull/113765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [libcxx] [Clang] Add __builtin_invoke and detect std::invoke as a builtin (PR #116709)

2024-11-18 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/116709 `std::invoke` is currently quite heavy compared to a function call, since it involves quite heavy SFINAE. This can be done significantly more efficient by the compiler, since most calls to `std::invoke` are

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-09 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/6] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-09 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I went for only adding `[[clang::no_specialization]]` to function templates, since the other cases seem even more unlikely to me and seem to have a higher implementation complexity. Is that OK? https://github.com/llvm/llvm-project/pull/101469 _

[libcxx] [libcxxabi] [libunwind] [llvm] [libc++] Enable -Wmissing-prototypes (PR #116261)

2024-11-18 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116261 >From 5108e8350e3480fe22e7bd2978990e1a084a5b35 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 14 Nov 2024 18:30:39 +0100 Subject: [PATCH] [libc++] Enable -Wmissing-prototypes --- libcxx/src/charc

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/8] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-26 Thread Nikolas Klauser via cfe-commits
@@ -473,6 +473,7 @@ def ExpansionToDefined : DiagGroup<"expansion-to-defined">; def FlagEnum : DiagGroup<"flag-enum">; def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>; def InfiniteRecursion : DiagGroup<"infinite-recursion">; +def InvalidSpecialization

[clang] bf440f7 - [Clang][NFC] Remove trailing whitespace from Attr{, Docs}.td

2024-11-26 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2024-11-26T18:01:38+01:00 New Revision: bf440f75b485e4ea7f809dc37df74cac140069fd URL: https://github.com/llvm/llvm-project/commit/bf440f75b485e4ea7f809dc37df74cac140069fd DIFF: https://github.com/llvm/llvm-project/commit/bf440f75b485e4ea7f809dc37df74cac140069fd.dif

[clang] [libcxx] [Clang] Add __builtin_invoke and detect std::invoke as a builtin (PR #116709)

2024-11-30 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited 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

[clang] [libcxx] [Clang] Add __builtin_invoke and detect std::invoke as a builtin (PR #116709)

2024-11-30 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From 025f937646f190978325c58967ccb02828a78bd2 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Mon, 18 Nov 2024 16:06:31 +0100 Subject: [PATCH 1/2] [libc++] Define an internal API for std::invoke and fr

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

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

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-24 Thread Nikolas Klauser via cfe-commits
@@ -1696,6 +1697,7 @@ set(files __cxx03/__ranges/as_rvalue_view.h __cxx03/__ranges/chunk_by_view.h __cxx03/__ranges/common_view.h + __cxx03/__ranges/concat_view.h philnik777 wrote: This shouldn't be added. https://github.com/llvm/llvm-project/pull/1209

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

2025-01-01 Thread Nikolas Klauser 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

<    1   2   3   4   5   6   >