[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -3128,6 +3128,26 @@ bool Type::isStdByteType() const { return false; } +static const TemplateDecl *getSpecializedTemplateType(const Type *T) { + const Type *DesugaredType = T->getUnqualifiedDesugaredType(); + if (const auto *Specialization = + DesugaredType->ge

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -9766,19 +9766,34 @@ def warn_operator_new_returns_null : Warning< "%select{| or 'noexcept'}1">, InGroup; def err_operator_new_dependent_param_type : Error< - "%0 cannot take a dependent type as first parameter; " - "use size_t (%1) instead">; + "%select{|type aware}1

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -9766,19 +9766,34 @@ def warn_operator_new_returns_null : Warning< "%select{| or 'noexcept'}1">, InGroup; def err_operator_new_dependent_param_type : Error< - "%0 cannot take a dependent type as first parameter; " - "use size_t (%1) instead">; + "%select{|type aware}1

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -16147,6 +16169,108 @@ bool Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor, return Invalid; } +bool Sema::isTypeAwareOperatorNewOrDelete(const NamedDecl *ND) const { + const FunctionDecl *FnDecl = nullptr; + if (auto *FTD = dyn_cast(ND)) +FnDecl = FT

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -16147,6 +16169,108 @@ bool Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor, return Invalid; } +bool Sema::isTypeAwareOperatorNewOrDelete(const NamedDecl *ND) const { + const FunctionDecl *FnDecl = nullptr; + if (auto *FTD = dyn_cast(ND)) +FnDecl = FT

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -16147,6 +16169,108 @@ bool Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor, return Invalid; } +bool Sema::isTypeAwareOperatorNewOrDelete(const NamedDecl *ND) const { + const FunctionDecl *FnDecl = nullptr; + if (auto *FTD = dyn_cast(ND)) +FnDecl = FT

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -1110,9 +1138,10 @@ static bool findDeleteForPromise(Sema &S, SourceLocation Loc, QualType PromiseTy // The deallocation function's name is looked up by searching for it in the // scope of the promise type. If nothing is found, a search is performed in // the global s

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -2520,6 +2520,18 @@ class FunctionDecl : public DeclaratorDecl, /// If this function is an allocation/deallocation function that takes /// the `std::nothrow_t` tag, return true through IsNothrow, bool isReplaceableGlobalAllocationFunction( + std::optional *Alignme

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -1095,12 +1095,40 @@ static TypeSourceInfo *getTypeSourceInfoForStdAlignValT(Sema &S, return S.Context.getTrivialTypeSourceInfo(StdAlignValDecl); } +// When searching for custom allocators on the PromiseType we want to +// warn that we will ignore type aware allocators.

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -2234,6 +2234,101 @@ enum class CXXNewInitializationStyle { Braces }; +enum class TypeAwareAllocationMode : unsigned { No, Yes }; +inline bool isTypeAwareAllocation(TypeAwareAllocationMode Mode) { + return Mode == TypeAwareAllocationMode::Yes; +} +inline TypeAwareAllocat

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -3849,7 +4119,15 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal, // delete. This is only necessary if we selected a destroying operator // delete that we are going to call (non-virtually); converting to void* // is trivial and left to AST consum

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-01-30 Thread via cfe-commits
@@ -3384,7 +3386,7 @@ bool FunctionDecl::isReservedGlobalPlacementOperator() const { return (proto->getParamType(1).getCanonicalType() == Context.VoidPtrTy); } -bool FunctionDecl::isReplaceableGlobalAllocationFunction( +bool FunctionDecl::isConstEvalSafeOrReplaceableGlobalA

[clang-tools-extra] [clang-tidy] Add C++ member function support to custom bugprone-unsafe-functions matches (PR #117165)

2025-01-30 Thread via cfe-commits
https://github.com/Discookie updated https://github.com/llvm/llvm-project/pull/117165 >From e90ab99dde0945d103959fa73ea2d31852f753e7 Mon Sep 17 00:00:00 2001 From: Viktor Date: Thu, 21 Nov 2024 14:33:24 + Subject: [PATCH 1/6] [clang-tidy] Add C++ member function support to user-defined bug

[clang] [AArch64] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-30 Thread Momchil Velikov via cfe-commits
@@ -2808,6 +2812,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, #define SVE_TYPE(Name, Id, SingletonId) \ case BuiltinType::Id: +#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) momchil-velikov wrote: It ca

[clang] [AArch64] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-30 Thread Momchil Velikov via cfe-commits
@@ -2808,6 +2812,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, #define SVE_TYPE(Name, Id, SingletonId) \ case BuiltinType::Id: +#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) momchil-velikov wrote: > Als

[clang] [AArch64] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-30 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/124968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7939ce6 - [AArch64] Add MSVC mangling for the __mfp8 type (#124968)

2025-01-30 Thread via cfe-commits
Author: Momchil Velikov Date: 2025-01-30T10:42:12Z New Revision: 7939ce6295e7fc0214cd307f97dfccc0cabde381 URL: https://github.com/llvm/llvm-project/commit/7939ce6295e7fc0214cd307f97dfccc0cabde381 DIFF: https://github.com/llvm/llvm-project/commit/7939ce6295e7fc0214cd307f97dfccc0cabde381.diff LO

[clang] [clang:frontend] Move helper functions to common location for SemaSPIRV (PR #125045)

2025-01-30 Thread David Spickett via cfe-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/125045 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang:frontend] Move helper functions to common location for SemaSPIRV (PR #125045)

2025-01-30 Thread David Spickett via cfe-commits
https://github.com/DavidSpickett commented: Just a drive by style comment. https://github.com/llvm/llvm-project/pull/125045 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang:frontend] Move helper functions to common location for SemaSPIRV (PR #125045)

2025-01-30 Thread David Spickett via cfe-commits
@@ -0,0 +1,65 @@ +#include "clang/Sema/Common.h" + +namespace clang { DavidSpickett wrote: https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions For example clang::CheckArgTypeIsCorrect instead of opening

[clang-tools-extra] 3262863 - [clang-tidy] Add C++ member function support to custom bugprone-unsafe-functions matches (#117165)

2025-01-30 Thread via cfe-commits
Author: Discookie Date: 2025-01-30T10:49:01Z New Revision: 3262863805d8a1de3e5c104d9daab82bf4a6d8d1 URL: https://github.com/llvm/llvm-project/commit/3262863805d8a1de3e5c104d9daab82bf4a6d8d1 DIFF: https://github.com/llvm/llvm-project/commit/3262863805d8a1de3e5c104d9daab82bf4a6d8d1.diff LOG: [cl

[clang] [clang:frontend] Move helper functions to common location for SemaSPIRV (PR #125045)

2025-01-30 Thread Muhammad Bassiouni via cfe-commits
https://github.com/bassiounix updated https://github.com/llvm/llvm-project/pull/125045 >From d938f75b1a5638f013ae2f7fb4f0ac2f6e28c6a4 Mon Sep 17 00:00:00 2001 From: Muhammad Bassiouni Date: Thu, 30 Jan 2025 12:02:25 +0200 Subject: [PATCH 1/2] [clang:frontend] Move helper functions in SemaHLSL t

[clang-tools-extra] [clang-tidy] Add C++ member function support to custom bugprone-unsafe-functions matches (PR #117165)

2025-01-30 Thread via cfe-commits
https://github.com/Discookie closed https://github.com/llvm/llvm-project/pull/117165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang:frontend] Move helper functions to common location for SemaSPIRV (PR #125045)

2025-01-30 Thread Muhammad Bassiouni via cfe-commits
@@ -0,0 +1,65 @@ +#include "clang/Sema/Common.h" + +namespace clang { bassiounix wrote: fixed https://github.com/llvm/llvm-project/pull/125045 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

2025-01-30 Thread Amit Kumar Pandey via cfe-commits
https://github.com/ampandey-1995 updated https://github.com/llvm/llvm-project/pull/124754 >From 913db08256a8ee3077067d55667e37628d9ebd7c Mon Sep 17 00:00:00 2001 From: Amit Pandey Date: Tue, 28 Jan 2025 15:15:01 +0530 Subject: [PATCH 1/2] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOp

[clang] b68b4f6 - [Driver][ASan] Refactor Clang-Driver "Sanitizer Bitcode" linking. (#123922)

2025-01-30 Thread via cfe-commits
Author: Amit Kumar Pandey Date: 2025-01-30T16:28:03+05:30 New Revision: b68b4f64a2bd2e0a22375cf89a4d655fc3667e11 URL: https://github.com/llvm/llvm-project/commit/b68b4f64a2bd2e0a22375cf89a4d655fc3667e11 DIFF: https://github.com/llvm/llvm-project/commit/b68b4f64a2bd2e0a22375cf89a4d655fc3667e11.d

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

2025-01-30 Thread Amit Kumar Pandey via cfe-commits
@@ -37,6 +37,16 @@ AMDGPUOpenMPToolChain::AMDGPUOpenMPToolChain(const Driver &D, // Lookup binaries into the driver directory, this is used to // discover the 'amdgpu-arch' executable. getProgramPaths().push_back(getDriver().Dir); + // Diagnose unsupported sanitizer opti

[clang] [Driver][ASan] Refactor Clang-Driver "Sanitizer Bitcode" linking. (PR #123922)

2025-01-30 Thread Amit Kumar Pandey via cfe-commits
https://github.com/ampandey-1995 closed https://github.com/llvm/llvm-project/pull/123922 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-30 Thread Benjamin Maxwell via cfe-commits
@@ -2808,6 +2812,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, #define SVE_TYPE(Name, Id, SingletonId) \ case BuiltinType::Id: +#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) MacDue wrote: With the curre

<    1   2   3   4   5