[clang] clang: add unnamed_addr function attribute (PR #92499)

2024-05-17 Thread YAMAMOTO Takashi via cfe-commits
https://github.com/yamt updated https://github.com/llvm/llvm-project/pull/92499 >From 52b744c91bdba1cf8cda9d6164ec8fc130d75fab Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 17 May 2024 14:47:06 +0900 Subject: [PATCH] [clang] add unnamed_addr function attribute It simply applies the

[clang] [clang] CTAD alias: Emit a more descriptive diagnostic message when is_deducible constraint is evaluated to false. (PR #92389)

2024-05-17 Thread Haojian Wu via cfe-commits
hokein wrote: Thanks @mizvekov for the quick fix. https://github.com/llvm/llvm-project/pull/92389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement a bitwise_copyable builtin type trait. (PR #86512)

2024-05-17 Thread Haojian Wu via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s + +// Scalar types are bitwise clonable. +static_assert(__is_bitwise_cloneable(int)); +static_assert(__is_bitwise_cloneable(int*)); +// array +static_assert(__is_bitwise_cloneable(int[10])); + +// non-scalar

[clang] [clang] add unnamed_addr function attribute (PR #92499)

2024-05-17 Thread YAMAMOTO Takashi via cfe-commits
https://github.com/yamt edited https://github.com/llvm/llvm-project/pull/92499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Add amdgpu-as MMRA for fences (PR #78572)

2024-05-17 Thread Pierre van Houtryve via cfe-commits
Pierre-vh wrote: @arsenm Should we use `image` or `private`? We could allow both in the frontend, and only use `private` as the canonical MMRA. https://github.com/llvm/llvm-project/pull/78572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-17 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: Is there something else needed on my side to get that PR merged? https://github.com/llvm/llvm-project/pull/92126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix P2564 handling of variable initializers (PR #89565)

2024-05-17 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: @katzdm Does it make sense to file an issue so we don't forget to bring the warning back? https://github.com/llvm/llvm-project/pull/89565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/92385 >From 7acbb1dd89dbe266c3e53ab30178ac570722c759 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 16 May 2024 19:06:25 +0800 Subject: [PATCH 1/2] [Clang][Sema] Avoid pack expansion for expanded empty PackInd

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: @cor3ntin PTAL. Thanks! https://github.com/llvm/llvm-project/pull/92385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
@@ -2157,11 +2157,11 @@ void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) { void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) { VisitExpr(E); Record.push_back(E->TransformedExpressions); + Record.push_back(E->EmptyPack); Record.AddSourceLocation(E

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
@@ -4377,15 +4377,20 @@ class PackIndexingExpr final // The pack being indexed, followed by the index Stmt *SubExprs[2]; - size_t TransformedExpressions; + // The size of the trailing expressions. + unsigned TransformedExpressions : 31; zyn0217 wrote:

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/92385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
@@ -4377,15 +4377,20 @@ class PackIndexingExpr final // The pack being indexed, followed by the index Stmt *SubExprs[2]; - size_t TransformedExpressions; + // The size of the trailing expressions. + unsigned TransformedExpressions : 31; zyn0217 wrote:

[clang] [Clang][AArch64] Use __clang_arm_builtin_alias for overloaded svreinterpret's (PR #92427)

2024-05-17 Thread via cfe-commits
rsandifo-arm wrote: > > Thinking about it a bit more, maybe we can just do some magic to make > > things work? Say, if you specify `__attribute__((target("sve"))) > > __arm_streaming_compatible`, and the caller is in streaming mode, allow the > > call even if the caller doesn't have SVE proper

[clang] [webkit.RefCntblBaseVirtualDtor] Ignore a base class which has a specialized deref function for a given derived class. (PR #92501)

2024-05-17 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92501 >From 87cfc8234e1294dedc103b9bcd2b7d9d31874c4a Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Thu, 16 May 2024 23:24:13 -0700 Subject: [PATCH 1/4] [webkit.RefCntblBaseVirtualDtor] Ignore a base class which has a

[clang] ee54c86 - [clang][NFC] Improve const-correctness in `SourceManager` (#92436)

2024-05-17 Thread via cfe-commits
Author: Vlad Serebrennikov Date: 2024-05-17T13:01:37+04:00 New Revision: ee54c86ef70d7809e7d67cd44de2d3153b31c46e URL: https://github.com/llvm/llvm-project/commit/ee54c86ef70d7809e7d67cd44de2d3153b31c46e DIFF: https://github.com/llvm/llvm-project/commit/ee54c86ef70d7809e7d67cd44de2d3153b31c46e.

[clang] [clang][NFC] Improve const-correctness in `SourceManager` (PR #92436)

2024-05-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/92436 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenCL] Put constant initializer globals into constant addrspace (PR #90048)

2024-05-17 Thread Sven van Haastregt via cfe-commits
@@ -535,20 +535,23 @@ void AggExprEmitter::EmitArrayInit(Address DestPtr, llvm::ArrayType *AType, elementType.isTriviallyCopyableType(CGF.getContext())) { CodeGen::CodeGenModule &CGM = CGF.CGM; ConstantEmitter Emitter(CGF); -LangAS AS = ArrayQTy.getAddressSpa

[clang] [webkit.RefCntblBaseVirtualDtor] Ignore a base class which has a specialized deref function for a given derived class. (PR #92501)

2024-05-17 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92501 >From 87cfc8234e1294dedc103b9bcd2b7d9d31874c4a Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Thu, 16 May 2024 23:24:13 -0700 Subject: [PATCH 1/5] [webkit.RefCntblBaseVirtualDtor] Ignore a base class which has a

[clang] [llvm] [AArch64][TargetParser] move CPUInfo into tablegen [NFC] (PR #92145)

2024-05-17 Thread Tomas Matheson via cfe-commits
@@ -812,178 +812,270 @@ def ProcessorFeatures { list Generic = [FeatureFPARMv8, FeatureNEON, FeatureETE]; } +class AArch64Processor< + string n, + Architecture64 arch, + SchedMachineModel m, + list f, + list tunef, + list default_extensions +> : ProcessorModel { + //

[clang] 7a67479 - [clang][ExtractAPI] Correctly generate declaration fragments for non-type template parameters (#91958)

2024-05-17 Thread via cfe-commits
Author: Daniel Grumberg Date: 2024-05-17T10:33:31+01:00 New Revision: 7a6747939218efbe3b1d2cc0f896dfa97c0ff40f URL: https://github.com/llvm/llvm-project/commit/7a6747939218efbe3b1d2cc0f896dfa97c0ff40f DIFF: https://github.com/llvm/llvm-project/commit/7a6747939218efbe3b1d2cc0f896dfa97c0ff40f.dif

[clang] [clang][ExtractAPI] Correctly generate declaration fragments for non-type template parameters (PR #91958)

2024-05-17 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg closed https://github.com/llvm/llvm-project/pull/91958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][TargetParser] move CPUInfo into tablegen [NFC] (PR #92145)

2024-05-17 Thread Tomas Matheson via cfe-commits
tmatheson-arm wrote: Summary of the PR after the recent changes: - `CPUInfo` in `TargetParser` is now generated from `AArch64Processors.td` - The printed order of CPUs has changed, due to definition order. - `+perfmon` now appears in `target-features` for some CPUs. This is because `FeaturePerf

[clang] [Clang][AArch64][SVE] Allow write to SVE vector elements using the subscript operator (PR #91965)

2024-05-17 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/91965 >From 2e081d74e87ad14fdf6d950d3e3da6bed07ee723 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Mon, 13 May 2024 14:27:51 +0100 Subject: [PATCH] [Clang][AArch64][SVE] Allow write to SVE vector element

[clang] [clang][ExtractAPI] Remove symbols defined in categories to external types unless requested (PR #92522)

2024-05-17 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg created https://github.com/llvm/llvm-project/pull/92522 rdar://128259890 >From 7650c18c883bb14e5a4b17d6b6d61297f2fa3c44 Mon Sep 17 00:00:00 2001 From: Daniel Grumberg Date: Fri, 17 May 2024 11:58:18 +0100 Subject: [PATCH] [clang][ExtractAPI] Remove symbols de

[clang] [clang][ExtractAPI] Remove symbols defined in categories to external types unless requested (PR #92522)

2024-05-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Daniel Grumberg (daniel-grumberg) Changes rdar://128259890 --- Full diff: https://github.com/llvm/llvm-project/pull/92522.diff 3 Files Affected: - (modified) clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h (+7-2)

[clang] 58bad28 - [analyzer][NFC] Require explicit matching mode for CallDescriptions (#92454)

2024-05-17 Thread via cfe-commits
Author: Donát Nagy Date: 2024-05-17T13:08:45+02:00 New Revision: 58bad2862cf136f9483eb005bbfa6915d459b46d URL: https://github.com/llvm/llvm-project/commit/58bad2862cf136f9483eb005bbfa6915d459b46d DIFF: https://github.com/llvm/llvm-project/commit/58bad2862cf136f9483eb005bbfa6915d459b46d.diff LO

[clang] [analyzer][NFC] Require explicit matching mode for CallDescriptions (PR #92454)

2024-05-17 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/92454 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement a bitwise_copyable builtin type trait. (PR #86512)

2024-05-17 Thread Ilya Biryukov via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s + +// Scalar types are bitwise clonable. +static_assert(__is_bitwise_cloneable(int)); +static_assert(__is_bitwise_cloneable(int*)); +// array +static_assert(__is_bitwise_cloneable(int[10])); + +// non-scalar

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -215,3 +215,10 @@ namespace PR20735 { // fix-it:"{{.*}}":{[[@LINE-9]]:20-[[@LINE-9]]:20}:")" } } + +void consecutive_builtin_compare(int x, int y, int z) { + (void)(x < y < z); // expected-warning {{comparisons like 'X<=Y<=Z' don't have their mathematical meaning}}

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

2024-05-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/92200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

2024-05-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a small nit with the release notes. https://github.com/llvm/llvm-project/pull/92200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -487,6 +487,9 @@ Improvements to Clang's diagnostics } }; +- Clang emits a ``-Wparentheses`` warning for expressions with consecutive comparisons like ``x < y < z``. + It was made a ``-Wparentheses`` warning to be consistent with gcc. AaronBal

[clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-17 Thread Oleksandr Alex Zinenko via cfe-commits
ftynse wrote: > 10 separate commits/PRs for the same exact sed costs more in commit noise > (and effort on the part of @e-kwsm) than one solid, patient, review here Not unless you subscribe only to a subproject. FWIW, I'm not comfortable blanket approving changes, however trivial, to subprojec

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #92527)

2024-05-17 Thread via cfe-commits
https://github.com/yronglin created https://github.com/llvm/llvm-project/pull/92527 This PR reapply https://github.com/llvm/llvm-project/pull/87933 >From 433df06e3a946916264337bafd0af2028ba70e9d Mon Sep 17 00:00:00 2001 From: yronglin Date: Fri, 17 May 2024 19:28:04 +0800 Subject: [PATCH] [Cla

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #92527)

2024-05-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (yronglin) Changes This PR reapply https://github.com/llvm/llvm-project/pull/87933 --- Full diff: https://github.com/llvm/llvm-project/pull/92527.diff 15 Files Affected: - (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #87933)

2024-05-17 Thread via cfe-commits
yronglin wrote: Sorry for the late reply, I found the update of comments from the email, and I have a new PR that fixes these problems. https://github.com/llvm/llvm-project/pull/87933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #92527)

2024-05-17 Thread via cfe-commits
@@ -5695,19 +5694,35 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) { ImmediateCallVisitor V(getASTContext()); if (!NestedDefaultChecking) V.TraverseDecl(Field); - if (V.HasImmediateCalls) { + + // CWG1815 + // Support lifetime ext

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #92527)

2024-05-17 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/92527 >From 4b90d249c5b0790d624a4c1c0b80ff6fc80a70b3 Mon Sep 17 00:00:00 2001 From: yronglin Date: Fri, 17 May 2024 19:38:30 +0800 Subject: [PATCH] [Clang][CWG1815] Support lifetime extension of temporary created by

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #92527)

2024-05-17 Thread via cfe-commits
@@ -5695,19 +5694,35 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) { ImmediateCallVisitor V(getASTContext()); if (!NestedDefaultChecking) V.TraverseDecl(Field); - if (V.HasImmediateCalls) { + + // CWG1815 + // Support lifetime ext

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-17 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > I think the error node needs to be non-fatal. Good point, I completely agree. > For these applications it's more important to catch cases where malloc size > and index used for access are coming from "different sources", eg. one is > tainted and another isn't, doesn't matter

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #92527)

2024-05-17 Thread via cfe-commits
@@ -27,6 +27,80 @@ class MemInit { C m = s; }; +namespace std { +typedef decltype(sizeof(int)) size_t; + +// libc++'s implementation +template class initializer_list { + const _E *__begin_; + size_t __size_; + + initializer_list(const _E *__b, size_t __s) : __begin_(__b)

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #92527)

2024-05-17 Thread via cfe-commits
@@ -14113,12 +14120,9 @@ TreeTransform::TransformCXXTemporaryObjectExpr( return SemaRef.MaybeBindToTemporary(E); } - // FIXME: We should just pass E->isListInitialization(), but we're not - // prepared to handle list-initialization without a child InitListExpr. Sou

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #92527)

2024-05-17 Thread via cfe-commits
@@ -14102,6 +14102,13 @@ TreeTransform::TransformCXXTemporaryObjectExpr( if (TransformExprs(E->getArgs(), E->getNumArgs(), true, Args, &ArgumentChanged)) return ExprError(); + +if (E->isListInitialization() && !E->isStdInitListInitializatio

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -9203,15 +9203,15 @@ static NamedDecl *DiagnoseInvalidRedeclaration( << Idx << FDParam->getType() << NewFD->getParamDecl(Idx - 1)->getType(); } else if (FDisConst != NewFDisConst) { - SemaRef.Diag(FD->getLocation(), diag::note_member_def_close_const_

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -1527,20 +1527,20 @@ struct DeclaratorChunk { /// Retrieve the location of the 'const' qualifier. SourceLocation getConstQualifierLoc() const { - assert(MethodQualifiers); - return MethodQualifiers->getConstSpecLoc(); + return MethodQualifiers ? Metho

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

2024-05-17 Thread Zahira Ammarguellat via cfe-commits
@@ -14574,9 +14574,17 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexpl: +// AIX library function `frexpl` has 'long double' type and not +// PPCDoubleDouble type. To make sure we generate t

[clang] a68d20e - [clang] Implement CWG2428 "Deprecating a concept" (#92295)

2024-05-17 Thread via cfe-commits
Author: Vlad Serebrennikov Date: 2024-05-17T16:02:44+04:00 New Revision: a68d20e986053ec571223a9f3ead3e146a27dc82 URL: https://github.com/llvm/llvm-project/commit/a68d20e986053ec571223a9f3ead3e146a27dc82 DIFF: https://github.com/llvm/llvm-project/commit/a68d20e986053ec571223a9f3ead3e146a27dc82.

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clang-query] Remove support for srcloc output (PR #92442)

2024-05-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/92442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: The patch makes sense to me. I'll not repeat the existing comments, they raise relevant concerns. It would be nice to extend some test case with a tainted malloc to see how those note tags play out from the generic taint checker in this context. For this,

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-17 Thread Balazs Benics via cfe-commits
@@ -48,6 +49,45 @@ void myfoo(int *p); void myfooint(int p); char *fooRetPtr(void); +void t1(void) { + size_t size; + scanf("%zu", &size); + int *p = malloc(size); // expected-warning{{malloc is called with a tainted (potentially attacker controlled) value}} + free(p); +}

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-17 Thread Balazs Benics via cfe-commits
@@ -1273,6 +1273,41 @@ Check for memory leaks, double free, and use-after-free problems. Traces memory .. literalinclude:: checkers/unix_malloc_example.c :language: c +If the ``alpha.security.taint.TaintPropagation`` checker is enabled, the checker +warns for cases when

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/92420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-17 Thread Balazs Benics via cfe-commits
@@ -1779,18 +1790,79 @@ ProgramStateRef MallocChecker::MallocMemAux(CheckerContext &C, const CallEvent &Call, const Expr *SizeEx, SVal Init, Prog

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-17 Thread Balazs Benics via cfe-commits
@@ -48,6 +49,45 @@ void myfoo(int *p); void myfooint(int p); char *fooRetPtr(void); +void t1(void) { + size_t size; + scanf("%zu", &size); + int *p = malloc(size); // expected-warning{{malloc is called with a tainted (potentially attacker controlled) value}} + free(p); +}

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-17 Thread Balazs Benics via cfe-commits
@@ -1779,18 +1790,79 @@ ProgramStateRef MallocChecker::MallocMemAux(CheckerContext &C, const CallEvent &Call, const Expr *SizeEx, SVal Init, Prog

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-17 Thread Balazs Benics via cfe-commits
@@ -1273,6 +1273,41 @@ Check for memory leaks, double free, and use-after-free problems. Traces memory .. literalinclude:: checkers/unix_malloc_example.c :language: c +If the ``alpha.security.taint.TaintPropagation`` checker is enabled, the checker +warns for cases when

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/92424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration describi

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr { let Documentation = [CXX11NoReturnDocs]; } +def NonBlocking : TypeAttr { + let Spellings = [CXX11<"clang", "nonblocking">, AaronBallman wrote: Present Aaron thanks you and Past Aaron apologized f

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

2024-05-17 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/88978 >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH 1/8] Adding C23 constexpr math functions fmin and frexp. -

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Balazs Benics via cfe-commits
steakhal wrote: > The "cert" package looks not useful and the checker has not a meaningful name > with the old naming scheme. > Additionally tests and documentation is updated. > The checker looks good enough to be moved into non-alpha package. Personally, I prefer reviewing content changes sep

[clang] [Clang][AArch64][SVE] Allow write to SVE vector elements using the subscript operator (PR #91965)

2024-05-17 Thread Momchil Velikov via cfe-commits
@@ -4180,8 +4180,10 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E, // If the base is a vector type, then we are forming a vector element lvalue // with this subscript. - if (E->getBase()->getType()->isVectorType() && - !isa(E->getBase

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Balazs Benics via cfe-commits
@@ -1179,6 +1179,54 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C) strncpy(buf, "a", 1); // warn } +.. _security-putenv-with-auto: + +security.PutenvWithAuto +""" +Finds calls to the ``putenv`` function which pass a pointer to an automatic

[clang] [Clang][AArch64][SVE] Allow write to SVE vector elements using the subscript operator (PR #91965)

2024-05-17 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/91965 >From fd4a31c1eb48db410f5445f45243dfbc1d9d22ab Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Mon, 13 May 2024 14:27:51 +0100 Subject: [PATCH 1/2] [Clang][AArch64][SVE] Allow write to SVE vector ele

[clang] [Clang][AArch64][SVE] Allow write to SVE vector elements using the subscript operator (PR #91965)

2024-05-17 Thread Momchil Velikov via cfe-commits
@@ -88,3 +88,13 @@ float subscript_float32(svfloat32_t a, size_t b) { double subscript_float64(svfloat64_t a, size_t b) { return a[b]; } + +// CHECK-LABEL: @subscript_write_float32( +// CHECK-NEXT: entry: +// CHECK-NEXT:[[VECINS:%.*]] = insertelement [[A:%.*]], float 1

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Donát Nagy via cfe-commits
@@ -1032,11 +1037,6 @@ let ParentPackage = ENV in { let ParentPackage = POSAlpha in { NagyDonat wrote: Please delete the packages that will no longer contain any checkers after this change. (As it's a bad naming scheme, they shouldn't be repopulated later.)

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Donát Nagy via cfe-commits
@@ -1179,6 +1179,54 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C) strncpy(buf, "a", 1); // warn } +.. _security-putenv-with-auto: + +security.PutenvWithAuto +""" +Finds calls to the ``putenv`` function which pass a pointer to an automatic

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Thanks for bringing this checker out of alpha! I like the new name and I agree that the old `Limitations` section was incorrect; and I have some minor suggestions in inline comments. I'd also ask for running this checker on some open source projects; but

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/92424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Donát Nagy via cfe-commits
@@ -1179,6 +1179,54 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C) strncpy(buf, "a", 1); // warn } +.. _security-putenv-with-auto: + +security.PutenvWithAuto +""" +Finds calls to the ``putenv`` function which pass a pointer to an automatic

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,66 @@ +// RUN: %clang_analyze_cc1 \ +// RUN: -analyzer-checker=security.PutenvWithAuto \ +// RUN: -verify %s + +#include "Inputs/system-header-simulator.h" +void free(void *); +void *malloc(size_t); +int putenv(char *); +int snprintf(char *, size_t, const char *, ...)

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-17 Thread Doug Wyatt via cfe-commits
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration describi

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92452 >From 27fab1ec54259941e3ded174de18cd99aa89bf7e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 16:42:27 -0400 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when diagnosing near-match f

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
@@ -1527,20 +1527,20 @@ struct DeclaratorChunk { /// Retrieve the location of the 'const' qualifier. SourceLocation getConstQualifierLoc() const { - assert(MethodQualifiers); - return MethodQualifiers->getConstSpecLoc(); + return MethodQualifiers ? Metho

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
@@ -9203,15 +9203,15 @@ static NamedDecl *DiagnoseInvalidRedeclaration( << Idx << FDParam->getType() << NewFD->getParamDecl(Idx - 1)->getType(); } else if (FDisConst != NewFDisConst) { - SemaRef.Diag(FD->getLocation(), diag::note_member_def_close_const_

[clang] [clang] CTAD alias: Fix missing template arg packs during the transformation (PR #92535)

2024-05-17 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/92535 clang rejects some valid code (see testcases) because of an incorrect transformed deduction guides. This patch fixes it. We miss the template argument packs during the transformation (`auto (type-parameter-0-0..

[clang] [clang] CTAD alias: Fix missing template arg packs during the transformation (PR #92535)

2024-05-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Haojian Wu (hokein) Changes clang rejects some valid code (see testcases) because of an incorrect transformed deduction guides. This patch fixes it. We miss the template argument packs during the transformation (`auto (type-parameter-0-0

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
@@ -724,6 +724,8 @@ Bug Fixes to C++ Support templates during partial ordering when deducing template arguments from a function declaration or when taking the address of a function template. - Fix a bug with checking constrained non-type template parameters for equivalenc

[clang] [llvm] [BPF] Fix linking issues in static map initializers (PR #91310)

2024-05-17 Thread Nick Zavaritsky via cfe-commits
https://github.com/mejedi updated https://github.com/llvm/llvm-project/pull/91310 >From 440f62d438810fbd1166a9eb3dbfbe10957fba58 Mon Sep 17 00:00:00 2001 From: Nick Zavaritsky Date: Sun, 5 May 2024 10:20:52 + Subject: [PATCH] [BPF] Fix linking issues in static map initializers When BPF obj

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration describi

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92452 >From 27fab1ec54259941e3ded174de18cd99aa89bf7e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 16:42:27 -0400 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when diagnosing near-match f

[clang] [llvm] [BPF] Fix linking issues in static map initializers (PR #91310)

2024-05-17 Thread Nick Zavaritsky via cfe-commits
https://github.com/mejedi edited https://github.com/llvm/llvm-project/pull/91310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Remove const-qualification from `FunctionTemplateSpecializationInfo::TemplateArguments` (PR #92500)

2024-05-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/92500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [BPF] Fix linking issues in static map initializers (PR #91310)

2024-05-17 Thread Nick Zavaritsky via cfe-commits
https://github.com/mejedi edited https://github.com/llvm/llvm-project/pull/91310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
@@ -724,6 +724,8 @@ Bug Fixes to C++ Support templates during partial ordering when deducing template arguments from a function declaration or when taking the address of a function template. - Fix a bug with checking constrained non-type template parameters for equivalenc

[clang] [llvm] [BPF] Fix linking issues in static map initializers (PR #91310)

2024-05-17 Thread Nick Zavaritsky via cfe-commits
https://github.com/mejedi edited https://github.com/llvm/llvm-project/pull/91310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92452 >From 27fab1ec54259941e3ded174de18cd99aa89bf7e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 16:42:27 -0400 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when diagnosing near-match f

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/92452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][PS5] Set visibility option defaults (PR #92091)

2024-05-17 Thread Paul T Robinson via cfe-commits
@@ -0,0 +1,33 @@ +/// Check PS5 specific interactions between visibility options. +/// Detailed testing of -fvisibility-from-dllstorageclass is covered elsewhere. + +/// Check defaults. +// RUN: %clang -### -target x86_64-sie-ps5 -x cl -c -emit-llvm %s 2>&1 | \ +// RUN: FileChec

[clang] [Driver][PS5] Set visibility option defaults (PR #92091)

2024-05-17 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 edited https://github.com/llvm/llvm-project/pull/92091 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][PS5] Set visibility option defaults (PR #92091)

2024-05-17 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 approved this pull request. LGTM. I noted a couple of redundant checks, but if you think it's better for them to be explicit, I'm okay with keeping them. https://github.com/llvm/llvm-project/pull/92091 ___ cfe-commits mailing

[clang] [Driver][PS5] Set visibility option defaults (PR #92091)

2024-05-17 Thread Paul T Robinson via cfe-commits
@@ -0,0 +1,32 @@ +/// Check PS4 specific interactions between visibility options. +/// Detailed testing of -fvisibility-from-dllstorageclass is covered elsewhere. + +/// Check defaults. +// RUN: %clang -### -target x86_64-scei-ps4 -x cl -c -emit-llvm %s 2>&1 | \ +// RUN: FileChe

[clang] 932ca85 - libclc: remove __attribute__((assume)) for clspv targets (#92126)

2024-05-17 Thread via cfe-commits
Author: Romaric Jodin Date: 2024-05-17T06:13:32-07:00 New Revision: 932ca85680db5e4579306f37e55746097fb8ec7f URL: https://github.com/llvm/llvm-project/commit/932ca85680db5e4579306f37e55746097fb8ec7f DIFF: https://github.com/llvm/llvm-project/commit/932ca85680db5e4579306f37e55746097fb8ec7f.diff

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/92126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclc] libclc: remove __attribute__((assume)) for clspv targets (PR #92126)

2024-05-17 Thread Erich Keane via cfe-commits
erichkeane wrote: > Is there something else needed on my side to get that PR merged? My apologies, I thought you'd been around LLVM enough that you had merge rights. I've done it now. https://github.com/llvm/llvm-project/pull/92126 ___ cfe-commits m

[clang] 9917f3c - [Clang][AArch64] Require SVE or SSVE for scalable types. (#91356)

2024-05-17 Thread via cfe-commits
Author: Sander de Smalen Date: 2024-05-17T14:21:56+01:00 New Revision: 9917f3ce641490ff95a11d22e37754a972c05420 URL: https://github.com/llvm/llvm-project/commit/9917f3ce641490ff95a11d22e37754a972c05420 DIFF: https://github.com/llvm/llvm-project/commit/9917f3ce641490ff95a11d22e37754a972c05420.di

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-17 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/91356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

2024-05-17 Thread Youngsuk Kim via cfe-commits
https://github.com/JOE1994 updated https://github.com/llvm/llvm-project/pull/92200 >From 2c7f9a083c129df70a79d019286b6a29643a8973 Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Tue, 14 May 2024 17:42:59 -0500 Subject: [PATCH 1/5] [clang][Sema] Warn consecutive builtin comparisons in an expr

  1   2   3   4   >