[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
https://github.com/foxtran updated https://github.com/llvm/llvm-project/pull/127546 >From 80f3250eadc887d76abf9c2edbec6285aef6d5d2 Mon Sep 17 00:00:00 2001 From: "Igor S. Gerasimov" Date: Mon, 17 Feb 2025 22:39:31 +0100 Subject: [PATCH 1/8] Merge {Maybe,Always}FallThrough_ReturnsNonVoid into F

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/127623 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
https://github.com/Sirraide commented: I think the changes are fine now, but we should add one more: ```c++ // NO warning here. This could be a regular function returning a `Coro` object. [[noreturn]] Coro test(); ``` Putting the check in `CheckCompletedCoroutineBody()` means that this should al

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2025-02-18 Thread Joseph Huber via cfe-commits
jhuber6 wrote: The reproducer I posted above still crashes, just in a different place. ``` clang-21: /home/jhuber/Documents/llvm/llvm-project/llvm/lib/IR/Instructions.cpp:744: void llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef, llvm::ArrayRef >, const llvm::Twine&):

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/127623 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA] Add support for sm101 and sm120 target architectures (PR #127187)

2025-02-18 Thread Sebastian Jodłowski via cfe-commits
https://github.com/jodelek updated https://github.com/llvm/llvm-project/pull/127187 From a55c76bac1bd70878c777b5930553fac114d2fd5 Mon Sep 17 00:00:00 2001 From: Sebastian Jodlowski Date: Fri, 14 Feb 2025 01:34:16 -0800 Subject: [PATCH 1/4] Add support for sm101 target architecture (Tegra Black

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
https://github.com/Nerixyz updated https://github.com/llvm/llvm-project/pull/127623 >From 3014c72978494df2a77f4b660fcea5fd20802221 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Tue, 18 Feb 2025 12:56:05 +0100 Subject: [PATCH] [Clang] Warn about `[[noreturn]]` on coroutines --- .../clang/Basic/

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
Sirraide wrote: > I think the changes are fine now, but we should add one more test case: > > ```c++ > // NO warning here. This could be a regular function returning a `Coro` > object. > [[noreturn]] Coro test2(); > ``` > > Putting the check in `CheckCompletedCoroutineBody()` means that this s

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. https://github.com/llvm/llvm-project/pull/127623 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
@@ -544,25 +544,17 @@ static ControlFlowKind CheckFallThrough(AnalysisDeclContext &AC) { namespace { struct CheckFallThroughDiagnostics { - unsigned diag_MaybeFallThrough_HasNoReturn; - unsigned diag_MaybeFallThrough_ReturnsNonVoid; - unsigned diag_AlwaysFallThrough_HasNoR

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
https://github.com/foxtran updated https://github.com/llvm/llvm-project/pull/127546 >From 80f3250eadc887d76abf9c2edbec6285aef6d5d2 Mon Sep 17 00:00:00 2001 From: "Igor S. Gerasimov" Date: Mon, 17 Feb 2025 22:39:31 +0100 Subject: [PATCH 1/9] Merge {Maybe,Always}FallThrough_ReturnsNonVoid into F

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
Sirraide wrote: Also, just a heads-up, #127623 is likely going to be merged soon and introduce some merge conflicts for you in `CheckFallThroughForBody()`. The code that that pr touches is just deleted here, so that’s fine I think, but maybe make sure that none of the diag ids are `0` if the f

[clang] [CUDA] Add support for sm101 and sm120 target architectures (PR #127187)

2025-02-18 Thread Sebastian Jodłowski via cfe-commits
jodelek wrote: > LGTM. > > Do you need help merging the patch? This is my first one, so would appreciate the help, thanks! https://github.com/llvm/llvm-project/pull/127187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Alexander Richardson via cfe-commits
@@ -223,6 +221,41 @@ } while (0) #endif +#define _LIBUNWIND_TRACING_COMPACT_UNWIND (0) +#if !_LIBUNWIND_TRACING_COMPACT_UNWIND +#define _LIBUNWIND_TRACE_COMPACT_UNWIND0(msg) +#define _LIBUNWIND_TRACE_COMPACT_UNWIND(msg, ...) +#else +#define _LIBUNWIND_TRACE_COMPACT_UNWIND0

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add absl::{Span,string_view} to UnsafeBufferUsage analysis (PR #127698)

2025-02-18 Thread via cfe-commits
https://github.com/mxms0 created https://github.com/llvm/llvm-project/pull/127698 Add support for absl Span and string_view types to warn on their unsafe usage. >From 5f8bbc6abd98948186c4682035299be47e1550bc Mon Sep 17 00:00:00 2001 From: mxms Date: Tue, 18 Feb 2025 16:21:18 -0500 Subject: [P

[clang] [CUDA] Add support for sm101 and sm120 target architectures (PR #127187)

2025-02-18 Thread Sebastian Jodłowski via cfe-commits
https://github.com/jodelek updated https://github.com/llvm/llvm-project/pull/127187 From a55c76bac1bd70878c777b5930553fac114d2fd5 Mon Sep 17 00:00:00 2001 From: Sebastian Jodlowski Date: Fri, 14 Feb 2025 01:34:16 -0800 Subject: [PATCH 1/4] Add support for sm101 target architecture (Tegra Black

[clang] Add absl::{Span,string_view} to UnsafeBufferUsage analysis (PR #127698)

2025-02-18 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] Add absl::{Span,string_view} to UnsafeBufferUsage analysis (PR #127698)

2025-02-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Max (mxms0) Changes Add support for absl Span and string_view types to warn on their unsafe usage. --- Full diff: https://github.com/llvm/llvm-project/pull/127698.diff 1 Files Affected: - (modified) clang/lib/Analysis/UnsafeBufferUsage

[clang] Add absl::{Span,string_view} to UnsafeBufferUsage analysis (PR #127698)

2025-02-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: Max (mxms0) Changes Add support for absl Span and string_view types to warn on their unsafe usage. --- Full diff: https://github.com/llvm/llvm-project/pull/127698.diff 1 Files Affected: - (modified) clang/lib/Analysis/UnsafeBu

[clang] [Wunsafe-buffer-usage] Address some false positives in handling array indices that are decidably correct (PR #117370)

2025-02-18 Thread via cfe-commits
https://github.com/mxms0 closed https://github.com/llvm/llvm-project/pull/117370 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add absl::{Span,string_view} to UnsafeBufferUsage analysis (PR #127698)

2025-02-18 Thread via cfe-commits
mxms0 wrote: cc @jkorous-apple https://github.com/llvm/llvm-project/pull/127698 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. https://github.com/llvm/llvm-project/pull/127546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Force expressions with UO_Not to not be non-negative (PR #126846)

2025-02-18 Thread Richard Smith via cfe-commits
@@ -10069,6 +10069,17 @@ static std::optional TryGetExprRange(ASTContext &C, const Expr *E, case UO_AddrOf: // should be impossible return IntRange::forValueOfType(C, GetExprType(E)); +case UO_Not: { + std::optional SubRange = TryGetExprRange( + C,

[clang] db5bc8e - [Clang] Warn about `[[noreturn]]` on coroutines (#127623)

2025-02-18 Thread via cfe-commits
Author: nerix Date: 2025-02-18T22:30:39+01:00 New Revision: db5bc8e9d07729ce4994cc908275722a093e5c0c URL: https://github.com/llvm/llvm-project/commit/db5bc8e9d07729ce4994cc908275722a093e5c0c DIFF: https://github.com/llvm/llvm-project/commit/db5bc8e9d07729ce4994cc908275722a093e5c0c.diff LOG: [C

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
Sirraide wrote: #127623 has been merged. https://github.com/llvm/llvm-project/pull/127546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/127623 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coroutines] Mark parameter allocas with coro.outside.frame metadata (PR #127653)

2025-02-18 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Adding metadata to an instruction should never be required for correctness: optimizations are not required to preserve metadata on instructions, so this "fix" will just break again later. If we need two different kinds of alloca in coroutine functions, we need a different

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127700)

2025-02-18 Thread Michael Flanders via cfe-commits
https://github.com/Flandini created https://github.com/llvm/llvm-project/pull/127700 Fixes #116444. ### Current vs expected behavior Previously, the result of a `CXXNewExpr` was not always list initialized when using an initializer list. In this example: ``` struct S { int x; }; void F() {

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
https://github.com/foxtran updated https://github.com/llvm/llvm-project/pull/127546 >From d09db5fc8ca7f58813f917c3726d09f0e4cfdd81 Mon Sep 17 00:00:00 2001 From: "Igor S. Gerasimov" Date: Mon, 17 Feb 2025 22:39:31 +0100 Subject: [PATCH 1/9] Merge {Maybe,Always}FallThrough_ReturnsNonVoid into F

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127700)

2025-02-18 Thread Michael Flanders via cfe-commits
https://github.com/Flandini edited https://github.com/llvm/llvm-project/pull/127700 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127700)

2025-02-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Michael Flanders (Flandini) Changes Fixes #116444. ### Current vs expected behavior Previously, the result of a `CXXNewExpr` was not always list initialized when using an initializer list. In this example: ``` struct S { int x; }; void

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127700)

2025-02-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Michael Flanders (Flandini) Changes Fixes #116444. ### Current vs expected behavior Previously, the result of a `CXXNewExpr` was not always list initialized when using an initializer list. In this example: ``` struct

[clang] [llvm] [CaptureTracking][FunctionAttrs] Add support for CaptureInfo (PR #125880)

2025-02-18 Thread via cfe-commits
Prabhuk wrote: > > Builder link: > https://ci.chromium.org/ui/p/fuchsia/builders/prod/clang-windows-x64/b8722951897240189057/overview > Logs: > https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8722951897240189057/+/u/clang/build/stdout > > ``` > FAILED: > C:/b/s/w/ir/x/w/l

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
foxtran wrote: @Sirraide, I still do not see how to call EmitDiag with coroutines :) https://github.com/llvm/llvm-project/pull/127546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
@@ -696,12 +661,12 @@ static void CheckFallThroughForBody(Sema &S, const Decl *D, const Stmt *Body, if (CD.checkDiagnostics(Diags, ReturnsVoid, HasNoReturn)) return; SourceLocation LBrace = Body->getBeginLoc(), RBrace = Body->getEndLoc(); - auto EmitDiag = [&](Sourc

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
@@ -696,12 +661,12 @@ static void CheckFallThroughForBody(Sema &S, const Decl *D, const Stmt *Body, if (CD.checkDiagnostics(Diags, ReturnsVoid, HasNoReturn)) return; SourceLocation LBrace = Body->getBeginLoc(), RBrace = Body->getEndLoc(); - auto EmitDiag = [&](Sourc

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/127546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Fix resource wrapper declaration (PR #125718)

2025-02-18 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/125718 >From a65ccd00e3201af94059a2431f29da6ebfa6 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Tue, 4 Feb 2025 11:47:42 -0500 Subject: [PATCH 1/2] [HLSL] Fix resrouce wrapper declaration The resource wrappe

[clang] [llvm] [RISCV][VLS] Support RISCV VLS calling convention (PR #100346)

2025-02-18 Thread Craig Topper via cfe-commits
@@ -726,7 +713,11 @@ ABIArgInfo RISCVABIInfo::classifyArgumentType(QualType Ty, bool IsFixed, return ABIArgInfo::getDirect(); } - if (const VectorType *VT = Ty->getAs()) { + // TODO: _BitInt is not handled yet in VLS calling convention since _BitInt + // ABI is also

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,48 @@ +.. title:: clang-tidy - readability-ambiguous-smartptr-reset-call + +readability-ambiguous-smartptr-reset-call += + +Finds potentially erroneous calls to ``reset`` method on smart pointers when +the pointee type also has a

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,48 @@ +.. title:: clang-tidy - readability-ambiguous-smartptr-reset-call + +readability-ambiguous-smartptr-reset-call += + +Finds potentially erroneous calls to ``reset`` method on smart pointers when +the pointee type also has a

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-18 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/119718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-18 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/119718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][OpenMP] Upstream first part of `do concurrent` mapping (PR #126026)

2025-02-18 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: LGTM. Thanks. https://github.com/llvm/llvm-project/pull/126026 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-18 Thread Tarun Prabhu via cfe-commits
@@ -3986,11 +3986,15 @@ defm assumptions : BoolFOption<"assumptions", "Disable codegen and compile-time checks for C++23's [[assume]] attribute">, PosFlag>; + +let Visibility = [ClangOption, FlangOption] in { tarunprabhu wrote: > You'd hope that

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
Sirraide wrote: > I can not find corresponding type to save enum values into specific container > (expected `diag::FunModes`). Ah, that’s because it emits an anonymous enum inside a namespace; just use `unsigned` I’d say. https://github.com/llvm/llvm-project/pull/127546 __

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
foxtran wrote: https://godbolt.org/z/4EjMGoqTn So, That is what I'd like to expect :D https://github.com/llvm/llvm-project/pull/127546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Don't give up on an unsuccessful function instantiation (PR #126723)

2025-02-18 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Sorry that took a while, I am still coming back from WG21, so I can't look into this throughly yet. I would look into / want to know about the very specific requirements on hitting the bug, described in the bug report, such as the lambda vs struct thing.

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
Sirraide wrote: > https://godbolt.org/z/4EjMGoqTn > > So, That is what I'd like to expect :D What we’re currently emitting is more or less: ```c++ namespace diag { namespace FunModes { enum { Function, // ... }; } } ``` https://github.com/llvm/llvm-project/pull/127546 _

[clang] [CUDA] Add support for sm101 and sm120 target architectures (PR #127187)

2025-02-18 Thread Artem Belevich via cfe-commits
@@ -300,6 +306,10 @@ void NVPTXTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__CUDA_ARCH_FEAT_SM90_ALL", "1"); if (GPU == OffloadArch::SM_100a) Builder.defineMacro("__CUDA_ARCH_FEAT_SM100_ALL", "1"); +if (GPU == OffloadArch::SM_

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
https://github.com/foxtran updated https://github.com/llvm/llvm-project/pull/127546 >From 80f3250eadc887d76abf9c2edbec6285aef6d5d2 Mon Sep 17 00:00:00 2001 From: "Igor S. Gerasimov" Date: Mon, 17 Feb 2025 22:39:31 +0100 Subject: [PATCH 1/6] Merge {Maybe,Always}FallThrough_ReturnsNonVoid into F

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
@@ -3910,8 +3910,13 @@ StmtResult Sema::BuildReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp, FnRetType = FD->getReturnType(); if (FD->hasAttrs()) Attrs = &FD->getAttrs(); -if (FD->isNoReturn()) - Diag(ReturnLoc, diag::warn_noreturn_function_has_ret

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 5ecce45ea2980aff35d1283d4dd3feb8f74de16c 973dde560d5ae499ffacf3cdd1d18d42465057fb --e

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
@@ -3910,8 +3910,13 @@ StmtResult Sema::BuildReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp, FnRetType = FD->getReturnType(); if (FD->hasAttrs()) Attrs = &FD->getAttrs(); -if (FD->isNoReturn()) - Diag(ReturnLoc, diag::warn_noreturn_function_has_ret

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
https://github.com/foxtran updated https://github.com/llvm/llvm-project/pull/127546 >From fbdd55feb53bfbcc07af39dc9fa1bf77311f5e45 Mon Sep 17 00:00:00 2001 From: "Igor S. Gerasimov" Date: Mon, 17 Feb 2025 22:39:31 +0100 Subject: [PATCH 1/6] Merge {Maybe,Always}FallThrough_ReturnsNonVoid into F

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
https://github.com/Nerixyz updated https://github.com/llvm/llvm-project/pull/127623 >From 6ba42659e7350a893273b22f011166fa58c05e89 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Tue, 18 Feb 2025 12:56:05 +0100 Subject: [PATCH] [Clang] Warn about `[[noreturn]]` on coroutines --- .../clang/Basic/

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
foxtran wrote: Yep, I checked #122505 https://github.com/llvm/llvm-project/pull/127546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
https://github.com/foxtran updated https://github.com/llvm/llvm-project/pull/127546 >From 80f3250eadc887d76abf9c2edbec6285aef6d5d2 Mon Sep 17 00:00:00 2001 From: "Igor S. Gerasimov" Date: Mon, 17 Feb 2025 22:39:31 +0100 Subject: [PATCH 1/7] Merge {Maybe,Always}FallThrough_ReturnsNonVoid into F

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
foxtran wrote: @Sirraide, CI should be happy now. I have merged `invalid-noreturn warnings` as well as now `%enum_select` is used. https://github.com/llvm/llvm-project/pull/127546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [llvm] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-02-18 Thread Justin Bogner via cfe-commits
@@ -94,6 +94,11 @@ bool Qualifiers::isTargetAddressSpaceSupersetOf(LangAS A, LangAS B, (A == LangAS::Default && (B == LangAS::cuda_constant || B == LangAS::cuda_device || B == LangAS::cuda_shared)) || + // In HLSL, the this pointer for mem

[clang] 8e16e5c - [HLSL] Bug fix crash using Array Parameters when De-sugaring is the same as canonicalizing (#127670)

2025-02-18 Thread via cfe-commits
Author: Sarah Spall Date: 2025-02-18T10:49:26-08:00 New Revision: 8e16e5ca23d70b6d21346abfbe292aa7e91dcb2e URL: https://github.com/llvm/llvm-project/commit/8e16e5ca23d70b6d21346abfbe292aa7e91dcb2e DIFF: https://github.com/llvm/llvm-project/commit/8e16e5ca23d70b6d21346abfbe292aa7e91dcb2e.diff L

[clang] [HLSL] Bug fix crash using Array Parameters when De-sugaring is the same as canonicalizing (PR #127670)

2025-02-18 Thread Sarah Spall via cfe-commits
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/127670 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
Sirraide wrote: > Maybe we can just emit the enum once and check that every diagnostic that > uses `%enum_select` w/ the same enum has the same number of cases That also reminds me: A while ago I ran into a bug where someone had added a few cases to one diagnotic but forgot to update another d

[clang] [HLSL] Allow arrays to copy-initialize (PR #127557)

2025-02-18 Thread Chris B via cfe-commits
@@ -6585,6 +6585,18 @@ void InitializationSequence::InitializeFrom(Sema &S, } } +if (S.getLangOpts().HLSL && Initializer && isa(DestAT)) { llvm-beanz wrote: Looking at this a bit. `canPerformArrayCopy` fails in cases that would otherwise be va

[clang] [HLSL] Allow arrays to copy-initialize (PR #127557)

2025-02-18 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/127557 >From 54ba5ffea82a9613fd343750ec36242e1494f5e4 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 17 Feb 2025 20:41:18 -0600 Subject: [PATCH 1/2] [HLSL] Allow arrays to copy-initialize This change allo

[clang] [llvm] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-02-18 Thread Chris B via cfe-commits
@@ -94,6 +94,11 @@ bool Qualifiers::isTargetAddressSpaceSupersetOf(LangAS A, LangAS B, (A == LangAS::Default && (B == LangAS::cuda_constant || B == LangAS::cuda_device || B == LangAS::cuda_shared)) || + // In HLSL, the this pointer for mem

[clang] [HLSL] Allow arrays to copy-initialize (PR #127557)

2025-02-18 Thread Justin Bogner via cfe-commits
@@ -2927,6 +2898,53 @@ void CastOperation::CheckCXXCStyleCast(bool FunctionalStyle, } } +// CheckHLSLCStyleCast - Returns `true` ihe cast is handled or errored as an +// HLSL-specific cast. Returns false if the cast should be checked as a CXX +// C-Style cast. +bool CastOpe

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-18 Thread Teresa Johnson via cfe-commits
@@ -0,0 +1,25 @@ +#include "llvm/Support/LibCXXABI.h" + +namespace llvm { + +std::unique_ptr CXXABI::Create(Triple &TT) { + if (TT.getOS() == Triple::Linux) +return std::make_unique(); teresajohnson wrote: This is overly restrictive, however, since Linux is

[clang] [HLSL] Allow arrays to copy-initialize (PR #127557)

2025-02-18 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/127557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-18 Thread Teresa Johnson via cfe-commits
@@ -1920,6 +1924,18 @@ Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache, ThinLTO.CombinedIndex, WholeProgramVisibilityEnabledInLTO, DynamicExportSymbols, VisibleToRegularObjSymbols); + Triple TT(getTargetTriple()); + DeadRTTIElimIndex(ThinLTO.Combine

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-18 Thread Teresa Johnson via cfe-commits
@@ -911,6 +916,63 @@ static void setLiveRoot(ModuleSummaryIndex &Index, StringRef Name) { Summary->setLive(true); } +// Return true if the User U is reachable from a non-vtable user +// through the use-def chain. +static bool hasNonVTableUsers(const User *U, CXXABI *ABI

[clang] [clang] Lower non-builtin sincos[f|l] calls to llvm.sincos.* when -fno-math-errno is set (PR #121763)

2025-02-18 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/121763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][doc] -ffp-contract options and standard compliance (PR #127621)

2025-02-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: This is an improvement. I have a few minor comments. https://github.com/llvm/llvm-project/pull/127621 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [HLSL] Fix resource wrapper declaration (PR #125718)

2025-02-18 Thread Steven Perron via cfe-commits
https://github.com/s-perron converted_to_draft https://github.com/llvm/llvm-project/pull/125718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-02-18 Thread Justin Bogner via cfe-commits
@@ -94,6 +94,11 @@ bool Qualifiers::isTargetAddressSpaceSupersetOf(LangAS A, LangAS B, (A == LangAS::Default && (B == LangAS::cuda_constant || B == LangAS::cuda_device || B == LangAS::cuda_shared)) || + // In HLSL, the this pointer for mem

[clang] [HLSL] Fix resource wrapper declaration (PR #125718)

2025-02-18 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/125718 >From 3ba76b95757a43002d8f799651d7846658011e37 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Tue, 4 Feb 2025 11:47:42 -0500 Subject: [PATCH 1/2] [HLSL] Fix resrouce wrapper declaration The resource wrappe

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
Sirraide wrote: > Will it have redefinition problem since I need to share this enum between two > diagnostics? Hmm, that’s a good point. I think in that case, for now just use `%enum_select` for one of the two and make the other one a regular `%select` (you can still use the enum for both the

[clang] [HLSL] Disallow virtual inheritance and functions (PR #127346)

2025-02-18 Thread Sarah Spall via cfe-commits
@@ -1817,5 +1817,9 @@ def ext_hlsl_access_specifiers : ExtWarn< InGroup; def err_hlsl_unsupported_component : Error<"invalid component '%0' used; expected 'x', 'y', 'z', or 'w'">; def err_hlsl_packoffset_invalid_reg : Error<"invalid resource class specifier '%0' for packoff

[clang] [analyzer] Update the undefined assignment checker diagnostics to not use the term 'garbage' (PR #126596)

2025-02-18 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: We could also go with something like "uninitialized or inaccessible memory" so that to technically cover the OOB case without triggering an immediate visceral reaction to buffer overruns. But it'll probably still be net-negative in confusion compared to a simple "uninitialized".

[clang] [llvm] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-02-18 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/127675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
https://github.com/Nerixyz updated https://github.com/llvm/llvm-project/pull/127623 >From a7924a05880d6f96c27b169a709327275d3eb9f3 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Tue, 18 Feb 2025 12:56:05 +0100 Subject: [PATCH] [Clang] Warn about `[[noreturn]]` on coroutines --- .../clang/Basic/

[clang] [Clang] Warn about `[[noreturn]]` on coroutines (PR #127623)

2025-02-18 Thread via cfe-commits
Nerixyz wrote: > Probably where we create the FunctionDecl? The first warning is emitted when creating the return value. So I'm checking for a coroutine there. To fix the crash in the AnalysisBasedWarnings, I'm checking if a diagnostic with ID 0 would've been emitted. https://github.com/llvm/

[clang] [llvm] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-02-18 Thread Steven Perron via cfe-commits
@@ -94,6 +94,11 @@ bool Qualifiers::isTargetAddressSpaceSupersetOf(LangAS A, LangAS B, (A == LangAS::Default && (B == LangAS::cuda_constant || B == LangAS::cuda_device || B == LangAS::cuda_shared)) || + // In HLSL, the this pointer for mem

[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)

2025-02-18 Thread via cfe-commits
foxtran wrote: Looks like I cannot have some variable with proper type generated from `%enum_select`. So, for ``` "%enum_select{%Function{function}|%Block{block}|%Lambda{lambda}|%Coroutine{coroutine}}0" ``` I can not find corresponding type to save enum values into specific container (expected

[clang] [llvm] [AArch64] Add optional extensions enabled on Grace (PR #127620)

2025-02-18 Thread Elvina Yakubova via cfe-commits
https://github.com/ElvinaYakubova updated https://github.com/llvm/llvm-project/pull/127620 >From 4c29499a36117ab9681f99a16e017b33c2322317 Mon Sep 17 00:00:00 2001 From: Elvina Yakubova Date: Thu, 13 Feb 2025 05:45:21 -0800 Subject: [PATCH] [AArch64] Add optional extensions enabled on Grace Ena

[clang] [llvm] Template as type (PR #127654)

2025-02-18 Thread via cfe-commits
https://github.com/ykhatav updated https://github.com/llvm/llvm-project/pull/127654 >From 2714184615ef06027941c7bccee3a2453d76c24b Mon Sep 17 00:00:00 2001 From: "Khatavkar, Yashasvi" Date: Tue, 18 Feb 2025 06:44:49 -0800 Subject: [PATCH 1/3] Support template as type --- clang/include/clang/B

[clang] [llvm] [AArch64] Add optional extensions enabled on Grace (PR #127620)

2025-02-18 Thread Elvina Yakubova via cfe-commits
@@ -944,6 +944,15 @@ def ProcessorFeatures { list Falkor = [HasV8_0aOps, FeatureCRC, FeatureSHA2, FeatureAES, FeatureFPARMv8, FeatureNEON, FeaturePerfMon, FeatureRDM]; + list Grace= [HasV9_0aO

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127700)

2025-02-18 Thread Michael Flanders via cfe-commits
https://github.com/Flandini updated https://github.com/llvm/llvm-project/pull/127700 >From 2c094dc9d9eab60e94ea018a854a1eae48dd894b Mon Sep 17 00:00:00 2001 From: Michael Flanders Date: Tue, 18 Feb 2025 12:27:18 -0600 Subject: [PATCH 1/2] [analyzer] Do list init for CXX new expr with initialize

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127702)

2025-02-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Michael Flanders (Flandini) Changes Fixes #116444. Closed #127700 because I accidentally updated it in github UI. ### Current vs expected behavior Previously, the result of a `CXXNewExpr` was not always list initialized

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127702)

2025-02-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Michael Flanders (Flandini) Changes Fixes #116444. Closed #127700 because I accidentally updated it in github UI. ### Current vs expected behavior Previously, the result of a `CXXNewExpr` was not always list initialized when using an in

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127702)

2025-02-18 Thread Michael Flanders via cfe-commits
https://github.com/Flandini updated https://github.com/llvm/llvm-project/pull/127702 >From 12791f2c89f7e42bd261ac573c2497857c42b6f3 Mon Sep 17 00:00:00 2001 From: Michael Flanders Date: Tue, 18 Feb 2025 15:56:13 -0600 Subject: [PATCH] [analyzer] Do list initialization for CXXNewExpr with initi

[clang] [libc] [Clang] Fix cross-lane scan when given divergent lanes (PR #127703)

2025-02-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libc Author: Joseph Huber (jhuber6) Changes Summary: The scan operation implemented here only works if there are contiguous ones in the executation mask that can be used to propagate the result. There are two solutions to this, one is to enter 'whole-wav

[clang] [libc] [Clang] Fix cross-lane scan when given divergent lanes (PR #127703)

2025-02-18 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/127703 Summary: The scan operation implemented here only works if there are contiguous ones in the executation mask that can be used to propagate the result. There are two solutions to this, one is to enter 'whole-wave-

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127700)

2025-02-18 Thread Michael Flanders via cfe-commits
https://github.com/Flandini closed https://github.com/llvm/llvm-project/pull/127700 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [Clang] Fix cross-lane scan when given divergent lanes (PR #127703)

2025-02-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Joseph Huber (jhuber6) Changes Summary: The scan operation implemented here only works if there are contiguous ones in the executation mask that can be used to propagate the result. There are two solutions to this, one is to enter 'whole-wa

[clang] [libc] [Clang] Add handlers for 'match_any' and 'match_all' to `gpuintrin.h` (PR #127504)

2025-02-18 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 milestoned https://github.com/llvm/llvm-project/pull/127504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [Clang] Fix cross-lane scan when given divergent lanes (PR #127703)

2025-02-18 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127703 >From bf81a9280b0fda28862fb56f633614ce9bae9840 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 18 Feb 2025 15:08:05 -0600 Subject: [PATCH] [Clang] Fix cross-lane scan when given divergent lanes Summary:

<    1   2   3   4   5   6   >