[clang] [clang][Tests][NFC] Add CWG713 test; add example from CWG1584 test (PR #100747)

2024-07-26 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/100747 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)

2024-07-26 Thread Matt Arsenault via cfe-commits
@@ -1185,6 +1189,9 @@ Currently, only the following parameter attributes are defined: value should be sign-extended to the extent required by the target's ABI (which is usually 32-bits) by the caller (for a parameter) or the callee (for a return value). +``noext``

[clang] [HLSL] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/100778 Improves readability and removes static verifier trigger. >From 1f1c082e0337209534f2f3ed77c410c0e2f81893 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 26 Jul 2024 10:10:38 -0700 Subject: [PATCH] [HLSL]

[clang] [HLSL] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Helena Kotas (hekota) Changes Improves readability and removes static verifier trigger. --- Full diff: https://github.com/llvm/llvm-project/pull/100778.diff 1 Files Affected: - (modified) clang/lib/Sema/SemaHLSL.cpp (+4-1) ``d

[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)

2024-07-26 Thread Eli Friedman via cfe-commits
@@ -1185,6 +1189,9 @@ Currently, only the following parameter attributes are defined: value should be sign-extended to the extent required by the target's ABI (which is usually 32-bits) by the caller (for a parameter) or the callee (for a return value). +``noext``

[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)

2024-07-26 Thread Eli Friedman via cfe-commits
@@ -2,7 +2,7 @@ ; PR933 efriedma-quic wrote: There shouldn't be tests in test/CodeGen/X86 using the default target triple... probably the tests should be relocated or fixed. https://github.com/llvm/llvm-project/pull/100757 _

[clang] 481eb4f - [clang] Enable the -Wdangling-assignment-gsl diagnostic by default. (#100708)

2024-07-26 Thread via cfe-commits
Author: Haojian Wu Date: 2024-07-26T19:28:37+02:00 New Revision: 481eb4f5159b753497ef20cb646eb6169f3eb078 URL: https://github.com/llvm/llvm-project/commit/481eb4f5159b753497ef20cb646eb6169f3eb078 DIFF: https://github.com/llvm/llvm-project/commit/481eb4f5159b753497ef20cb646eb6169f3eb078.diff LO

[clang] [clang] Enable the -Wdangling-assignment-gsl diagnostic by default. (PR #100708)

2024-07-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/100708 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread Xiang Li via cfe-commits
@@ -650,7 +650,10 @@ class DiagnoseHLSLAvailability bool HasMatchingEnvironmentOrNone(const AvailabilityAttr *AA); public: - DiagnoseHLSLAvailability(Sema &SemaRef) : SemaRef(SemaRef) {} + DiagnoseHLSLAvailability(Sema &SemaRef) + : SemaRef(SemaRef), +CurrentS

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

2024-07-26 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 01/11] Adding C23 constexpr math functions fmin and frexp.

[clang] [HLSL] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/100778 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Check inline defs when emitting speculative vtable (PR #100785)

2024-07-26 Thread Fabian Parzefall via cfe-commits
https://github.com/FPar created https://github.com/llvm/llvm-project/pull/100785 Clang should only emit an available_externally vtable when there are no unused virtual inline functions. Currently, if such such a function is declared without inline inside the class, but is defined inline outside

[clang] [clang] Check inline defs when emitting speculative vtable (PR #100785)

2024-07-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Fabian Parzefall (FPar) Changes Clang should only emit an available_externally vtable when there are no unused virtual inline functions. Currently, if such such a function is declared without inline inside the class, but is define

[clang] [llvm] [APFloat] Add support for f8E3M4 IEEE 754 type (PR #99698)

2024-07-26 Thread Alexander Pivovarov via cfe-commits
apivovarov wrote: @tschuett, Could you please help review this change? https://github.com/llvm/llvm-project/pull/99698 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [APFloat] Add support for f8E3M4 IEEE 754 type (PR #99698)

2024-07-26 Thread Thorsten Schütt via cfe-commits
tschuett wrote: > @tschuett, Could you please help review this change? I did. I gave you the float reviewer of the house. https://github.com/llvm/llvm-project/pull/99698 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang][CGDebugInfo] Don't generate an implicit 'this' parameter if one was specified explicitly (PR #100767)

2024-07-26 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/100767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Build release binaries for multiple targets (PR #98431)

2024-07-26 Thread Tom Stellard via cfe-commits
https://github.com/tstellar closed https://github.com/llvm/llvm-project/pull/98431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-07-26 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 01/12] Adding C23 constexpr math functions fmin and frexp.

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: Thanks! https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Richard Smith via cfe-commits
@@ -5425,34 +5534,112 @@ static bool isAtLeastAsSpecializedAs(Sema &S, SourceLocation Loc, // the partial ordering is done: TemplateDeductionInfo Info(Loc); switch (TPOC) { - case TPOC_Call: + case TPOC_Call: { if (DeduceTemplateArguments(S, TemplateParams, Args

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Richard Smith via cfe-commits
@@ -5346,7 +5346,6 @@ static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info, const Expr *RetExpr = cast(S)->getRetValue(); FullExpressionRAII Scope(Info); if (RetExpr && RetExpr->isValueDependent()) { - EvaluateDependentExpr(RetExpr, Info); ---

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Richard Smith via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Richard Smith via cfe-commits
@@ -859,8 +861,10 @@ class PackDeductionScope { // by this pack expansion, then clear out the deduction. DeducedFromEarlierParameter = !Deduced[Index].isNull(); DeducedPack Pack(Index); -Pack.Saved = Deduced[Index]; -Deduced[Index] = TemplateArgument(); +

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Richard Smith via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Richard Smith via cfe-commits
@@ -30,98 +30,27 @@ class basic_string_view { constexpr basic_string_view &operator=(const basic_string_view &) {} }; -template -constexpr bool operator<(basic_string_view, basic_string_view) { - return {}; -} -template -constexpr bool operator<(type_identity_t>, -

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Richard Smith via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -98,6 +98,12 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`bugprone-incorrect-iterators + ` check. + + Detects calls to iterator algorithms where they are called with potentially + invalid arguments. 5chmidti wrote: `where they` -> `t

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Some initial thoughts, and at first glance, this looks nice. Because we are early in the release cycle, there will be enough time to address the fixme's. (I haven't run the check against some code bases as I am not at my main machine for another week.) h

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/99917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,122 @@ +.. title:: clang-tidy - bugprone-incorrect-iterators + +bugprone-incorrect-iterators + + +Detects calls to iterator algorithms where they are called with potentially +invalid arguments. + +Different ranges + + +Looks f

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,122 @@ +.. title:: clang-tidy - bugprone-incorrect-iterators + +bugprone-incorrect-iterators + + +Detects calls to iterator algorithms where they are called with potentially +invalid arguments. + +Different ranges + + +Looks f

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,756 @@ +//===--- IncorrectIteratorsCheck.cpp - clang-tidy -===// +// +// 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-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,756 @@ +//===--- IncorrectIteratorsCheck.cpp - clang-tidy -===// +// +// 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-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,756 @@ +//===--- IncorrectIteratorsCheck.cpp - clang-tidy -===// +// +// 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-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,122 @@ +.. title:: clang-tidy - bugprone-incorrect-iterators + +bugprone-incorrect-iterators + + +Detects calls to iterator algorithms where they are called with potentially +invalid arguments. + +Different ranges + + +Looks f

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,756 @@ +//===--- IncorrectIteratorsCheck.cpp - clang-tidy -===// +// +// 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-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,756 @@ +//===--- IncorrectIteratorsCheck.cpp - clang-tidy -===// +// +// 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-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -30,98 +30,27 @@ class basic_string_view { constexpr basic_string_view &operator=(const basic_string_view &) {} }; -template -constexpr bool operator<(basic_string_view, basic_string_view) { - return {}; -} -template -constexpr bool operator<(type_identity_t>, -

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

2024-07-26 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 01/13] Adding C23 constexpr math functions fmin and frexp.

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/97911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: It'll be 1 week+ before I am back at my main machine to take a better look at the macro question. Maybe this can just be landed, without that distinction. https://github.com/llvm/llvm-project/pull/97911 ___ cfe-c

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -42,9 +42,9 @@ The check doesn't do a bad job, but it's not perfect. In particular: - At the point that the check runs, the AST contains a single ``StringLiteral`` for the format string where escapes have been expanded. - The check tries to put the escapes back, they ma

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5346,7 +5346,6 @@ static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info, const Expr *RetExpr = cast(S)->getRetValue(); FullExpressionRAII Scope(Info); if (RetExpr && RetExpr->isValueDependent()) { - EvaluateDependentExpr(RetExpr, Info); ---

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -859,8 +861,10 @@ class PackDeductionScope { // by this pack expansion, then clear out the deduction. DeducedFromEarlierParameter = !Deduced[Index].isNull(); DeducedPack Pack(Index); -Pack.Saved = Deduced[Index]; -Deduced[Index] = TemplateArgument(); +

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang] Check inline defs when emitting speculative vtable (PR #100785)

2024-07-26 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Can you give a self-contained example that shows why this is a problem? (I mean, I can imagine there could be some interaction that causes issues, but I'm not sure what that interaction is, in this context.) https://github.com/llvm/llvm-project/pull/100785 ___

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5425,34 +5534,112 @@ static bool isAtLeastAsSpecializedAs(Sema &S, SourceLocation Loc, // the partial ordering is done: TemplateDeductionInfo Info(Loc); switch (TPOC) { - case TPOC_Call: + case TPOC_Call: { if (DeduceTemplateArguments(S, TemplateParams, Args

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-26 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > I am still concerned about the double error on the `t.A<1 < 4>::x` example. The ideal outcome would be to turn the second error into a note. How feasible to fix you think that is? That's trivial to fix, just need to add a note variant of the "missing template" diagnostic.

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { }; } // namespace +// = + +namespace FXAnalysis { + +enum class DiagnosticID : uint8_t { + None = 0, // s

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/99656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/99656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { }; } // namespace +// = + +namespace FXAnalysis { + +enum class DiagnosticID : uint8_t { + None = 0, // s

[clang] [llvm] Finish deleting the le32/le64 targets (PR #98497)

2024-07-26 Thread Steven Johnson via cfe-commits
steven-johnson wrote: Note that Halide has removed its dependency on the le32/le64 targets as of https://github.com/halide/Halide/pull/8344. https://github.com/llvm/llvm-project/pull/98497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { }; } // namespace +// = + +namespace FXAnalysis { + +enum class DiagnosticID : uint8_t { + None = 0, // s

[clang] [llvm] [Sanitizer] Make sanitizer passes idempotent (PR #99439)

2024-07-26 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > > ThreadSanitizer is missing > > Have added the flag for tsan-module, But not sure about tsan, which is > function pass. How do we make that idempotent? We merged Module and function passes for other sanitizers, and we should do for tsan as well. So implementing for module

[clang] [clang][Driver] Support passing arbitrary args to -cc1as with -Xclangas. (PR #100714)

2024-07-26 Thread Alex Rønne Petersen via cfe-commits
https://github.com/alexrp updated https://github.com/llvm/llvm-project/pull/100714 From 63d2e2bb4836ca46b4d48958c253263ec624a638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 26 Jul 2024 09:40:42 +0200 Subject: [PATCH] [clang][Driver] Support passing arbitra

[clang] [clang][Driver] Support passing arbitrary args to -cc1as with -Xclangas. (PR #100714)

2024-07-26 Thread Alex Rønne Petersen via cfe-commits
https://github.com/alexrp edited https://github.com/llvm/llvm-project/pull/100714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Sanitizer] Make sanitizer passes idempotent (PR #99439)

2024-07-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. LGTM, but please git some time others to respond https://github.com/llvm/llvm-project/pull/99439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { }; } // namespace +// = + +namespace FXAnalysis { + +enum class DiagnosticID : uint8_t { + None = 0, // s

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/99656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
@@ -873,30 +873,17 @@ class Sema final : public SemaBase { /// Warn when implicitly casting 0 to nullptr. void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E); - // - function effects --- + /// All functions/lambdas/blocks which have bodies and which ha

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-26 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/98940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-26 Thread Shilei Tian via cfe-commits
https://github.com/shiltian commented: Do we have the varargs handling pass run even with O0? https://github.com/llvm/llvm-project/pull/98940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [llvm] [Sanitizer] Make sanitizer passes idempotent (PR #99439)

2024-07-26 Thread via cfe-commits
b-sumner wrote: LGTM https://github.com/llvm/llvm-project/pull/99439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-26 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Do we have the varargs handling pass run even with O0? Yes, it's a mandatory pass for NVPTX and AMDGPU. I added an extra pass in LTO recently just to let vararg functions be inlined, it's not necessary for correctness. https://github.com/llvm/llvm-project/pull/98940 _

[clang] [HLSL] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread Helena Kotas via cfe-commits
@@ -650,7 +650,10 @@ class DiagnoseHLSLAvailability bool HasMatchingEnvironmentOrNone(const AvailabilityAttr *AA); public: - DiagnoseHLSLAvailability(Sema &SemaRef) : SemaRef(SemaRef) {} + DiagnoseHLSLAvailability(Sema &SemaRef) + : SemaRef(SemaRef), +CurrentS

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-26 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/98940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Check inline defs when emitting speculative vtable (PR #100785)

2024-07-26 Thread Fabian Parzefall via cfe-commits
FPar wrote: Yes, certainly! The example below demonstrates a case where the `available_externally` vtable mismatches the actual definition, and holds a reference to a symbol that does not exist in the final program. You can see the mismatch by compiling with `-O1 -flto=thin`. The generated LL

[clang] [llvm] [APFloat] Add support for f8E3M4 IEEE 754 type (PR #99698)

2024-07-26 Thread Thomas Raoux via cfe-commits
https://github.com/ThomasRaoux approved this pull request. I'm not particularly familiar with this format but the changes look reasonable and consistent with the other formats. LGTM https://github.com/llvm/llvm-project/pull/99698 ___ cfe-commits maili

[clang] [llvm] [Sanitizer] Make sanitizer passes idempotent (PR #99439)

2024-07-26 Thread Fangrui Song via cfe-commits
MaskRay wrote: > all previous proposals to add such "re-run" protection ended up with "the > pipeline is wrong". But implementation is so trivial, so I don't mind just to > have it implemented. While the implementation is trivial, I also share the concern whether sanitizers should do this. Th

[clang] [llvm] [Sanitizer] Make sanitizer passes idempotent (PR #99439)

2024-07-26 Thread Fangrui Song via cfe-commits
MaskRay wrote: In the worse case we need this, I'd hope that this is target-specific. https://github.com/llvm/llvm-project/pull/99439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread via cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { }; } // namespace +// = + +namespace FXAnalysis { + +enum class DiagnosticID : uint8_t { + None = 0, // s

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread via cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { }; } // namespace +// = + +namespace FXAnalysis { + +enum class DiagnosticID : uint8_t { + None = 0, // s

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread via cfe-commits
@@ -873,30 +873,17 @@ class Sema final : public SemaBase { /// Warn when implicitly casting 0 to nullptr. void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E); - // - function effects --- + /// All functions/lambdas/blocks which have bodies and which ha

[clang] [llvm] [Sanitizer] Make sanitizer passes idempotent (PR #99439)

2024-07-26 Thread via cfe-commits
b-sumner wrote: @MaskRay can you talk more about your concerns? This won't affect compile time, and instrumenting a shadow load will cause an immediate crash of the application at runtime. This seems much more robust than counting on toolchains to always arrange to avoid double instrumentati

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-26 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/98940 >From 9195ed11dde78e04c831a5bcb6f9c1cc0e6f0304 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 15 Jul 2024 12:42:09 -0500 Subject: [PATCH] [OpenMP][libc] Remove special handling for OpenMP printf Summary:

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { }; } // namespace +// = + +namespace FXAnalysis { + +enum class DiagnosticID : uint8_t { + None = 0, // s

[clang] 069e8bc - [OpenMP][libc] Remove special handling for OpenMP printf (#98940)

2024-07-26 Thread via cfe-commits
Author: Joseph Huber Date: 2024-07-26T16:03:36-05:00 New Revision: 069e8bcd82c4420239f95c7e6a09e1f756317cfc URL: https://github.com/llvm/llvm-project/commit/069e8bcd82c4420239f95c7e6a09e1f756317cfc DIFF: https://github.com/llvm/llvm-project/commit/069e8bcd82c4420239f95c7e6a09e1f756317cfc.diff

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-26 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/98940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread Chris B via cfe-commits
llvm-beanz wrote: Does this have any behavior change that can be tested? https://github.com/llvm/llvm-project/pull/100778 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread Helena Kotas via cfe-commits
hekota wrote: > Does this have any behavior change that can be tested? No, it does not. I'll add [NFC] to the title. https://github.com/llvm/llvm-project/pull/100778 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [HLSL][NFC] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/100778 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Support passing arbitrary args to -cc1as with -Xclangas. (PR #100714)

2024-07-26 Thread Fangrui Song via cfe-commits
MaskRay wrote: I closed #52878 as working as intended. I think zig should specify a different `-mcpu=` or `-march=`. Sorry but I've closed the feature request #97517 as I don't think Clang can sign up addressing a potential surge of compatibility issues "please remove the incompatible target-

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-07-26 Thread Helena Kotas via cfe-commits
@@ -290,3 +294,296 @@ void SemaHLSL::DiagnoseAttrStageMismatch( << A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage) << (AllowedStages.size() != 1) << join(StageStrings, ", "); } + +namespace { + +/// This class implements HLSL availability diagnostics for default

[clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)

2024-07-26 Thread Helena Kotas via cfe-commits
@@ -8001,6 +8001,12 @@ NamedDecl *Sema::ActOnVariableDeclarator( } } + if (getLangOpts().HLSL) { +if (R->isHLSLSpecificType() && !NewVD->isImplicit()) { + Diag(D.getBeginLoc(), diag::err_hlsl_intangible_type_cannot_be_declared); hekota wrote:

[clang] fea5914 - Revert "[OpenMP][libc] Remove special handling for OpenMP printf (#98940)"

2024-07-26 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-07-26T16:39:12-05:00 New Revision: fea5914c926e2f013a8b5e27eaa74c7047fb2c71 URL: https://github.com/llvm/llvm-project/commit/fea5914c926e2f013a8b5e27eaa74c7047fb2c71 DIFF: https://github.com/llvm/llvm-project/commit/fea5914c926e2f013a8b5e27eaa74c7047fb2c71.diff

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread Doug Wyatt via cfe-commits
@@ -10897,6 +10902,53 @@ Attr *Sema::getImplicitCodeSegOrSectionAttrForFunction(const FunctionDecl *FD, return nullptr; } +// Should only be called when getFunctionEffects() returns a non-empty set. +// Decl should be a FunctionDecl or BlockDecl. +void Sema::maybeAddDeclWit

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-07-26 Thread via cfe-commits
@@ -10897,6 +10902,53 @@ Attr *Sema::getImplicitCodeSegOrSectionAttrForFunction(const FunctionDecl *FD, return nullptr; } +// Should only be called when getFunctionEffects() returns a non-empty set. +// Decl should be a FunctionDecl or BlockDecl. +void Sema::maybeAddDeclWit

[clang] [libc] [Clang] Suppress missing architecture error when doing LTO (PR #100652)

2024-07-26 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/100652 >From 5017fe0cc33af9b7731786122c21602258b51c9a Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 25 Jul 2024 15:40:40 -0500 Subject: [PATCH 1/2] [Clang] Suppress missing architecture error when doing LTO

[clang] [Clang][AST] {CXXDefaultArgExpr, CXXDefaultInitExpr}::hasRewrittenInit return true iff the init expression was really rebuild (PR #99748)

2024-07-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: The code mostly makes sense, can we update the summary to clarify the goal of this change? This is what goes in the git log and it is important this is detailed enough to understand the change w/o looking at the details of the change itself. https://github

[clang] [Clang][AST] {CXXDefaultArgExpr, CXXDefaultInitExpr}::hasRewrittenInit return true iff the init expression was really rebuild (PR #99748)

2024-07-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/99748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST] {CXXDefaultArgExpr, CXXDefaultInitExpr}::hasRewrittenInit return true iff the init expression was really rebuild (PR #99748)

2024-07-26 Thread Shafik Yaghmour via cfe-commits
@@ -1579,11 +1579,11 @@ void JSONNodeDumper::VisitMaterializeTemporaryExpr( } void JSONNodeDumper::VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *Node) { - attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit()); + JOS.attribute("hasRewrittenInit", Node->hasRewrit

[clang] [HLSL][NFC] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/100778 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)

2024-07-26 Thread Chris B via cfe-commits
@@ -8001,6 +8001,12 @@ NamedDecl *Sema::ActOnVariableDeclarator( } } + if (getLangOpts().HLSL) { +if (R->isHLSLSpecificType() && !NewVD->isImplicit()) { + Diag(D.getBeginLoc(), diag::err_hlsl_intangible_type_cannot_be_declared); llvm-beanz wrot

[clang] [libcxx] [clang] Add -Wimplicit-fallthrough to -Wextra (PR #97926)

2024-07-26 Thread Max Coplan via cfe-commits
Max =?utf-8?b?8J+RqPCfj73igI3wn5K7?= Copl Message-ID: In-Reply-To: https://github.com/vegerot updated https://github.com/llvm/llvm-project/pull/97926 >From eb83d32dcf26cf5a8f749400beaccf6688b9107d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20=F0=9F=91=A8=F0=9F=8F=BD=E2=80=8D=F0=9F=92=BB=20Co

<    1   2   3   4   >