[clang] [clang-tools-extra] clangd: Extend reference search with constructor calls through forwarding (PR #169742)

2025-12-20 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > So I just tested this code on our codebase, the AST part is working, but the > background indexer is still not showing (all) the references, at least the > first `make_unique` I tested only worked with the AST. [...] > It works on my 2 cpp file setup, so some more compl

[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)

2025-12-20 Thread Zinovy Nis via cfe-commits
https://github.com/irishrover updated https://github.com/llvm/llvm-project/pull/172170 >From 02e40493c9f9bd8f77bdfb0fee7afd7ba3d26a1b Mon Sep 17 00:00:00 2001 From: Zinovy Nis Date: Sat, 13 Dec 2025 13:47:01 +0300 Subject: [PATCH 1/7] [clang-tidy] Add a new check 'modernize-use-string-view' Lo

[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)

2025-12-20 Thread Zinovy Nis via cfe-commits
https://github.com/irishrover updated https://github.com/llvm/llvm-project/pull/172170 >From 02e40493c9f9bd8f77bdfb0fee7afd7ba3d26a1b Mon Sep 17 00:00:00 2001 From: Zinovy Nis Date: Sat, 13 Dec 2025 13:47:01 +0300 Subject: [PATCH 1/6] [clang-tidy] Add a new check 'modernize-use-string-view' Lo

[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)

2025-12-20 Thread Zinovy Nis via cfe-commits
https://github.com/irishrover updated https://github.com/llvm/llvm-project/pull/172170 >From 02e40493c9f9bd8f77bdfb0fee7afd7ba3d26a1b Mon Sep 17 00:00:00 2001 From: Zinovy Nis Date: Sat, 13 Dec 2025 13:47:01 +0300 Subject: [PATCH 1/5] [clang-tidy] Add a new check 'modernize-use-string-view' Lo

[clang] [Clang][NFC] remove getUnqualifiedType() when it's already unqualified (PR #172504)

2025-12-20 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Does anyone need to hit the merge button on this? https://github.com/llvm/llvm-project/pull/172504 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix incorrect array initialization with string literal in dependent settings (fixes #112189) (PR #172995)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -133,6 +133,82 @@ const Expr *Expr::skipRValueSubobjectAdjustments( return E; } +static StringLiteral *CloneStringLiteral(const StringLiteral *SL, + ASTContext &C) { + SourceLocation *SLocs = new (C) SourceLocation[SL->getNumConcat

[clang] Fix incorrect array initialization with string literal in dependent settings (fixes #112189) (PR #172995)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -1023,6 +1023,10 @@ class Expr : public ValueStmt { return skipRValueSubobjectAdjustments(CommaLHSs, Adjustments); } + /// If the expression is a (possibly parenthesized) string literal + /// then make a copy of it. + Expr *CloneIfIAmAStringLiteral(ASTContext &Ctx)

[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)

2025-12-20 Thread Zinovy Nis via cfe-commits
https://github.com/irishrover updated https://github.com/llvm/llvm-project/pull/172170 >From 02e40493c9f9bd8f77bdfb0fee7afd7ba3d26a1b Mon Sep 17 00:00:00 2001 From: Zinovy Nis Date: Sat, 13 Dec 2025 13:47:01 +0300 Subject: [PATCH 1/4] [clang-tidy] Add a new check 'modernize-use-string-view' Lo

[clang] [clang][NFC][diagnostics] Remove most usage of `getCustomDiagID()` from CodeGen (PR #172557)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt approved this pull request. oh this is fantastic, and it fixes the formatting of the errors. Looks good to me. https://github.com/llvm/llvm-project/pull/172557 ___ cfe-commits mailing list [email protected] https://l

[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)

2025-12-20 Thread Zinovy Nis via cfe-commits
irishrover wrote: > ```diff > getArcana > ``` Thanks. Looks like overloaded functions? So let's ignore overloaded functions as I do for virtual/override? https://github.com/llvm/llvm-project/pull/172170 ___ cfe-commits mailing list cfe-commits@lists.

[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)

2025-12-20 Thread Zinovy Nis via cfe-commits
@@ -0,0 +1,68 @@ +.. title:: clang-tidy - modernize-use-string-view + +modernize-use-string-view + + +Looks for functions returning ``std::[w|u8|u16|u32]string`` and suggests to +change it to ``std::[...]string_view`` for performance reasons if

[clang-tools-extra] [clang-tidy] Add fix-it for C-style cast of nullptr (PR #173159)

2025-12-20 Thread Mradul Sonare via cfe-commits
https://github.com/SonareMradul updated https://github.com/llvm/llvm-project/pull/173159 >From c44ca1e6ac8f2fa11abf44de0d9ad7afabaddaab Mon Sep 17 00:00:00 2001 From: "[email protected]" Date: Sat, 20 Dec 2025 17:31:59 + Subject: [PATCH 1/3] [clang-tidy] Add fix-it for C-style cast of

[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)

2025-12-20 Thread Zinovy Nis via cfe-commits
https://github.com/irishrover updated https://github.com/llvm/llvm-project/pull/172170 >From 02e40493c9f9bd8f77bdfb0fee7afd7ba3d26a1b Mon Sep 17 00:00:00 2001 From: Zinovy Nis Date: Sat, 13 Dec 2025 13:47:01 +0300 Subject: [PATCH 1/3] [clang-tidy] Add a new check 'modernize-use-string-view' Lo

[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)

2025-12-20 Thread Zinovy Nis via cfe-commits
https://github.com/irishrover updated https://github.com/llvm/llvm-project/pull/172170 >From 02e40493c9f9bd8f77bdfb0fee7afd7ba3d26a1b Mon Sep 17 00:00:00 2001 From: Zinovy Nis Date: Sat, 13 Dec 2025 13:47:01 +0300 Subject: [PATCH 1/2] [clang-tidy] Add a new check 'modernize-use-string-view' Lo

[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)

2025-12-20 Thread Zinovy Nis via cfe-commits
https://github.com/irishrover edited https://github.com/llvm/llvm-project/pull/172170 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add support for consteval null terminated strings (PR #173140)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -17693,6 +17693,44 @@ void Sema::DiagnoseStaticAssertDetails(const Expr *E) { } } +template +static bool EvaluateAsNullTerminatedCharBuffer( +Sema &SemaRef, Expr *Message, ResultType &Result, ASTContext &Ctx, +Sema::StringEvaluationContext EvalContext, bool Error

[clang] [clang] Add support for consteval null terminated strings (PR #173140)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -294,13 +294,15 @@ bool Context::evaluateStrlen(State &Parent, const Expr *E, uint64_t &Result) { if (!FieldDesc->isPrimitiveArray()) return false; -if (Ptr.isDummy() || Ptr.isUnknownSizeArray()) +if (Ptr.isDummy() || Ptr.isUnknownSizeArray() || Ptr.isPas

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > LLVM Buildbot has detected a new failure on builder `sanitizer-windows` > running on `sanitizer-windows` while building `clang` at step 7 > "test-build-unified-tree-check-compiler-rt". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/107/builds/162

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Mythreya Kuricheti via cfe-commits
MythreyaK wrote: As far as I can tell, the failure does not seem related :thinking:. @ojhunt, please let me know if I'm wrong! https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm

[clang-tools-extra] [clang-tidy][include-cleaner] Fix false positive for stdlib-like macros (PR #173149)

2025-12-20 Thread via cfe-commits
@@ -517,6 +517,10 @@ Changes in existing checks - Improved :doc:`misc-header-include-cycle ` check performance. +- Improved :doc:`misc-include-cleaner EugeneZelenko wrote: > I think the section is missing in the current documentation.. Do you mean > "[clan

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-windows` running on `sanitizer-windows` while building `clang` at step 7 "test-build-unified-tree-check-compiler-rt". Full details are available at: https://lab.llvm.org/buildbot/#/builders/107/builds/16228 Here i

[clang] [clang] Add support for consteval null terminated strings (PR #173140)

2025-12-20 Thread Timm Baeder via cfe-commits
@@ -294,13 +294,15 @@ bool Context::evaluateStrlen(State &Parent, const Expr *E, uint64_t &Result) { if (!FieldDesc->isPrimitiveArray()) return false; -if (Ptr.isDummy() || Ptr.isUnknownSizeArray()) +if (Ptr.isDummy() || Ptr.isUnknownSizeArray() || Ptr.isPas

[clang-tools-extra] [clang-tidy][include-cleaner] Fix false positive for stdlib-like macros (PR #173149)

2025-12-20 Thread via cfe-commits
@@ -517,6 +517,10 @@ Changes in existing checks - Improved :doc:`misc-header-include-cycle ` check performance. +- Improved :doc:`misc-include-cleaner zeyi2 wrote: I think the section is missing in the current documentation.. Do you mean "[clang-include-fi

[clang] [Clang][SYCL] Modify err_sycl_entry_point_invalid to use %enum_select. (PR #173122)

2025-12-20 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `reverse-iteration` running on `hexagon-build-03` while building `clang` at step 6 "check_all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/110/builds/6915 Here is the relevant piece of the build l

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4fec702 - [clang] Add FixItHint for designated init order (#173136)

2025-12-20 Thread via cfe-commits
Author: Mythreya Kuricheti Date: 2025-12-21T05:33:00Z New Revision: 4fec70204fe99ce9dcb9eb34fbfb1b57f45d910f URL: https://github.com/llvm/llvm-project/commit/4fec70204fe99ce9dcb9eb34fbfb1b57f45d910f DIFF: https://github.com/llvm/llvm-project/commit/4fec70204fe99ce9dcb9eb34fbfb1b57f45d910f.diff

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Mythreya Kuricheti via cfe-commits
https://github.com/MythreyaK edited https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add support for consteval null terminated strings (PR #173140)

2025-12-20 Thread Timm Baeder via cfe-commits
@@ -294,13 +294,15 @@ bool Context::evaluateStrlen(State &Parent, const Expr *E, uint64_t &Result) { if (!FieldDesc->isPrimitiveArray()) return false; -if (Ptr.isDummy() || Ptr.isUnknownSizeArray()) +if (Ptr.isDummy() || Ptr.isUnknownSizeArray() || Ptr.isPas

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt auto_merge_enabled https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Oh actually, you'll need to edit your description because that's what GitHub will use as the commit message :D https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm.or

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt approved this pull request. Looks good! Thanks, if you update it to main I'll push the merge button :D https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm

[clang] [CIR][X86]Implement handling for convert-half builtins (PR #173143)

2025-12-20 Thread Priyanshu Kumar via cfe-commits
https://github.com/Priyanshu3820 updated https://github.com/llvm/llvm-project/pull/173143 >From 0dd977df6b2fda837c32044c199a13a32c232b6f Mon Sep 17 00:00:00 2001 From: Priyanshu Kumar <[email protected]> Date: Sat, 20 Dec 2025 08:25:59 + Subject: [PATCH 1/8] Implement handling for conv

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Mythreya Kuricheti via cfe-commits
https://github.com/MythreyaK updated https://github.com/llvm/llvm-project/pull/173136 >From 4b5b1dcd3cfd26b0192905f8679ec29967e36f27 Mon Sep 17 00:00:00 2001 From: Mythreya Date: Thu, 18 Dec 2025 23:21:50 -0800 Subject: [PATCH 1/6] [clang] Add FixItHint for designated init order --- clang/lib

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -3101,9 +3162,11 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, unsigned OldIndex = StructuredIndex - 1; if (StructuredList && OldIndex <= StructuredList->getNumInits()) { if (Expr *PrevInit = StructuredList->getIni

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt requested changes to this pull request. Just that one minor change as I hadn't considered our style choice around Diags, sorry about that :D https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list cfe-co

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add fix-it for C-style cast of nullptr (PR #173159)

2025-12-20 Thread Mradul Sonare via cfe-commits
https://github.com/SonareMradul edited https://github.com/llvm/llvm-project/pull/173159 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add fix-it for C-style cast of nullptr (PR #173159)

2025-12-20 Thread Mradul Sonare via cfe-commits
https://github.com/SonareMradul edited https://github.com/llvm/llvm-project/pull/173159 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Mythreya Kuricheti via cfe-commits
https://github.com/MythreyaK updated https://github.com/llvm/llvm-project/pull/173136 >From 4b5b1dcd3cfd26b0192905f8679ec29967e36f27 Mon Sep 17 00:00:00 2001 From: Mythreya Date: Thu, 18 Dec 2025 23:21:50 -0800 Subject: [PATCH 1/6] [clang] Add FixItHint for designated init order --- clang/lib

[clang] [SYCL] SYCL host kernel launch support for the sycl_kernel_entry_point attribute. (PR #152403)

2025-12-20 Thread Tom Honermann via cfe-commits
@@ -16412,28 +16438,53 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, bool IsInstantiation, FD->getAttr(); if (FD->isDefaulted()) { Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid) - << SKEPAttr << /*defaulted function

[clang] [Clang][Sema] Support 'counted_by' attribute on FAM/pointers in anonymous unions (PR #171996)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/171996 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Support 'counted_by' attribute on FAM/pointers in anonymous unions (PR #171996)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt requested changes to this pull request. I'm not super familiar with the bounds safety code, but this code looks ok to me, but the "is this field in a union" check seems suspicious to me, so if we can add some variations on the test below? https://github.com/llvm/llvm-

[clang] [Clang][Sema] Support 'counted_by' attribute on FAM/pointers in anonymous unions (PR #171996)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -207,10 +217,17 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return true; } + // Reject if both FD and CountFD are in the same union - they share storage. + if (FD->getParent() == CountFD->getParent() && FD->getParent()->isUnio

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-12-20 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/157319 >From e28e9e234b6165b49884cf254e1fb4efe44fe756 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sat, 6 Sep 2025 17:35:36 -0700 Subject: [PATCH 1/5] [clang-tidy] make `misc-const-correctness` work with

[clang] [CIR][X86]Implement handling for convert-half builtins (PR #173143)

2025-12-20 Thread Priyanshu Kumar via cfe-commits
https://github.com/Priyanshu3820 updated https://github.com/llvm/llvm-project/pull/173143 >From 0dd977df6b2fda837c32044c199a13a32c232b6f Mon Sep 17 00:00:00 2001 From: Priyanshu Kumar <[email protected]> Date: Sat, 20 Dec 2025 08:25:59 + Subject: [PATCH 1/7] Implement handling for conv

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -3092,6 +3094,65 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, PrevField = *FI; } + const auto GenerateDesignatedInitReorderingFixit = + [&](SemaBase::SemaDiagnosticBuilder &Diags) { +struct ReorderI

[clang-tools-extra] [clang-tidy][NFC] Refactor `bugprone-argument-comment` [1/3] (PR #172521)

2025-12-20 Thread via cfe-commits
https://github.com/zeyi2 closed https://github.com/llvm/llvm-project/pull/172521 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 14b9478 - [clang-tidy][NFC] Refactor `bugprone-argument-comment` [1/3] (#172521)

2025-12-20 Thread via cfe-commits
Author: mitchell Date: 2025-12-21T11:56:18+08:00 New Revision: 14b9478b328e4d8b91feef3b5a0b3b4152182b34 URL: https://github.com/llvm/llvm-project/commit/14b9478b328e4d8b91feef3b5a0b3b4152182b34 DIFF: https://github.com/llvm/llvm-project/commit/14b9478b328e4d8b91feef3b5a0b3b4152182b34.diff LOG:

[clang] [Clang][SYCL] Modify err_sycl_entry_point_invalid to use %enum_select. (PR #173122)

2025-12-20 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann closed https://github.com/llvm/llvm-project/pull/173122 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b5fd757 - [Clang][SYCL][NFC] Modify err_sycl_entry_point_invalid to use %enum_select. (#173122)

2025-12-20 Thread via cfe-commits
Author: Tom Honermann Date: 2025-12-20T22:36:05-05:00 New Revision: b5fd7572ed3ccca94118e3bcf244b1ab08f336c5 URL: https://github.com/llvm/llvm-project/commit/b5fd7572ed3ccca94118e3bcf244b1ab08f336c5 DIFF: https://github.com/llvm/llvm-project/commit/b5fd7572ed3ccca94118e3bcf244b1ab08f336c5.diff

[clang] [lld] [llvm] [WIP][IR][Constants] Change the semantic of `ConstantPointerNull` to represent an actual `nullptr` instead of a zero-value pointer (PR #166667)

2025-12-20 Thread Shilei Tian via cfe-commits
shiltian wrote: The most recent push included a large number of test case updates from `global ptr null` to `global ptr zeroinitializer`. https://github.com/llvm/llvm-project/pull/17 ___ cfe-commits mailing list [email protected] https://

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Mythreya Kuricheti via cfe-commits
https://github.com/MythreyaK edited https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Mythreya Kuricheti via cfe-commits
@@ -3092,6 +3094,65 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, PrevField = *FI; } + const auto GenerateDesignatedInitReorderingFixit = + [&](SemaBase::SemaDiagnosticBuilder &Diags) { +struct ReorderI

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Mythreya Kuricheti via cfe-commits
https://github.com/MythreyaK updated https://github.com/llvm/llvm-project/pull/173136 >From 4b5b1dcd3cfd26b0192905f8679ec29967e36f27 Mon Sep 17 00:00:00 2001 From: Mythreya Date: Thu, 18 Dec 2025 23:21:50 -0800 Subject: [PATCH 1/6] [clang] Add FixItHint for designated init order --- clang/lib

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Mythreya Kuricheti via cfe-commits
https://github.com/MythreyaK updated https://github.com/llvm/llvm-project/pull/173136 >From 4b5b1dcd3cfd26b0192905f8679ec29967e36f27 Mon Sep 17 00:00:00 2001 From: Mythreya Date: Thu, 18 Dec 2025 23:21:50 -0800 Subject: [PATCH 1/6] [clang] Add FixItHint for designated init order --- clang/lib

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Mythreya Kuricheti via cfe-commits
@@ -3092,6 +3094,65 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, PrevField = *FI; } + const auto GenerateDesignatedInitReorderingFixit = + [&](SemaBase::SemaDiagnosticBuilder &Diags) { +struct ReorderI

[clang] [CIR] Only emit FP math intrinsics when precision/errno settings allow it (PR #169424)

2025-12-20 Thread Hendrik Hübner via cfe-commits
https://github.com/HendrikHuebner closed https://github.com/llvm/llvm-project/pull/169424 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] da98be1 - [CIR] Only emit FP math intrinsics when precision/errno settings allow it (#169424)

2025-12-20 Thread via cfe-commits
Author: Hendrik Hübner Date: 2025-12-21T01:57:18+01:00 New Revision: da98be133e2f15cceb2c3982119490f6cd304eff URL: https://github.com/llvm/llvm-project/commit/da98be133e2f15cceb2c3982119490f6cd304eff DIFF: https://github.com/llvm/llvm-project/commit/da98be133e2f15cceb2c3982119490f6cd304eff.diff

[clang] [CIR] Implement part of ConstantExpr support for ScalarExpr (PR #173009)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -141,6 +141,23 @@ class ScalarExprEmitter : public StmtVisitor { } mlir::Value VisitConstantExpr(ConstantExpr *e) { +// A constant expression of type 'void' generates no code and produces no +// value. +if (e->getType()->isVoidType()) { ojh

[clang] [-Wunsafe-buffer-usage] Add check for custom printf/scanf functions (PR #173096)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -1161,7 +1167,7 @@ static bool hasUnsafePrintfStringArg(const CallExpr &Node, ASTContext &Ctx, // It is a fprintf: const Expr *UnsafeArg; -if (hasUnsafeFormatOrSArg(&Node, UnsafeArg, 1, Ctx, false)) { +if (hasUnsafeFormatOrSArg(Ctx, &Node, UnsafeArg, 1)) {

[clang] [-Wunsafe-buffer-usage] Add check for custom printf/scanf functions (PR #173096)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/173096 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add check for custom printf/scanf functions (PR #173096)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -886,9 +888,9 @@ static bool hasUnsafeFormatOrSArg(const CallExpr *Call, const Expr *&UnsafeArg, analyze_printf::PrintfConversionSpecifier::sArg) return true; // continue parsing - unsigned ArgIdx = FS.getPositionalArgIndex() + FmtArgIdx; + unsi

[clang] [-Wunsafe-buffer-usage] Add check for custom printf/scanf functions (PR #173096)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -255,3 +255,27 @@ void dontCrashForInvalidFormatString() { snprintf((char*)0, 0, "%"); snprintf((char*)0, 0, "\0"); } + + +// Also warn about unsafe printf/scanf-like functions: +void myprintf(const char *F, ...) __attribute__((__format__ (__printf__, 1, 2))); -

[clang] [-Wunsafe-buffer-usage] Add check for custom printf/scanf functions (PR #173096)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -825,9 +825,11 @@ struct LibcFunNamePrefixSuffixParser { // // `UnsafeArg` is the output argument that will be set only if this function // returns true. -static bool hasUnsafeFormatOrSArg(const CallExpr *Call, const Expr *&UnsafeArg, - const

[clang] [-Wunsafe-buffer-usage] Add check for custom printf/scanf functions (PR #173096)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt requested changes to this pull request. These are all just style nits, and a request for some additional tests https://github.com/llvm/llvm-project/pull/173096 ___ cfe-commits mailing list [email protected] https://li

[clang] [-Wunsafe-buffer-usage] Add check for custom printf/scanf functions (PR #173096)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -1175,7 +1181,7 @@ static bool hasUnsafePrintfStringArg(const CallExpr &Node, ASTContext &Ctx, if (auto *II = FD->getIdentifier()) isKprintf = II->getName() == "kprintf"; -if (hasUnsafeFormatOrSArg(&Node, UnsafeArg, 0, Ctx, isKprintf)) { +if (hasUnsafeFor

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -3101,9 +3162,10 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, unsigned OldIndex = StructuredIndex - 1; if (StructuredList && OldIndex <= StructuredList->getNumInits()) { if (Expr *PrevInit = StructuredList->getIni

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -3092,6 +3094,65 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, PrevField = *FI; } + const auto GenerateDesignatedInitReorderingFixit = + [&](SemaBase::SemaDiagnosticBuilder &Diags) { +struct ReorderI

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt requested changes to this pull request. This looks good to me, it just needs some style fixups https://github.com/llvm/llvm-project/pull/173136 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi

[clang] [clang] Add FixItHint for designated init order (PR #173136)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -3092,6 +3094,65 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, PrevField = *FI; } + const auto GenerateDesignatedInitReorderingFixit = + [&](SemaBase::SemaDiagnosticBuilder &Diags) { +struct ReorderI

[clang] [clang] Add support for consteval null terminated strings (PR #173140)

2025-12-20 Thread Oliver Hunt via cfe-commits
@@ -294,13 +294,15 @@ bool Context::evaluateStrlen(State &Parent, const Expr *E, uint64_t &Result) { if (!FieldDesc->isPrimitiveArray()) return false; -if (Ptr.isDummy() || Ptr.isUnknownSizeArray()) +if (Ptr.isDummy() || Ptr.isUnknownSizeArray() || Ptr.isPas

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/172170 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,68 @@ +.. title:: clang-tidy - modernize-use-string-view + +modernize-use-string-view + + +Looks for functions returning ``std::[w|u8|u16|u32]string`` and suggests to +change it to ``std::[...]string_view`` for performance reasons if

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,68 @@ +.. title:: clang-tidy - modernize-use-string-view + +modernize-use-string-view + + +Looks for functions returning ``std::[w|u8|u16|u32]string`` and suggests to +change it to ``std::[...]string_view`` for performance reasons if

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,84 @@ +//===--===// +// +// 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: Apac

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,339 @@ +// RUN: %check_clang_tidy -std=c++20-or-later %s modernize-use-string-view %t -- -- -isystem %clang_tidy_headers vbvictor wrote: Please use this file for c++17-or-later and create new file `use-string-view-cxx20.cpp` to test c++20-or-later h

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,84 @@ +//===--===// +// +// 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: Apac

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,84 @@ +//===--===// +// +// 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: Apac

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,68 @@ +.. title:: clang-tidy - modernize-use-string-view + +modernize-use-string-view + + +Looks for functions returning ``std::[w|u8|u16|u32]string`` and suggests to +change it to ``std::[...]string_view`` for performance reasons if

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,68 @@ +.. title:: clang-tidy - modernize-use-string-view + +modernize-use-string-view + + +Looks for functions returning ``std::[w|u8|u16|u32]string`` and suggests to +change it to ``std::[...]string_view`` for performance reasons if

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,68 @@ +.. title:: clang-tidy - modernize-use-string-view + +modernize-use-string-view + + +Looks for functions returning ``std::[w|u8|u16|u32]string`` and suggests to +change it to ``std::[...]string_view`` for performance reasons if

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,68 @@ +.. title:: clang-tidy - modernize-use-string-view + +modernize-use-string-view + vbvictor wrote: ```suggestion modernize-use-string-view = ``` https://github.com/llvm/llvm-project/pull

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,84 @@ +//===--===// +// +// 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: Apac

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,339 @@ +// RUN: %check_clang_tidy -std=c++20-or-later %s modernize-use-string-view %t -- -- -isystem %clang_tidy_headers + +#include + +namespace std { +namespace literals { +namespace string_literals { + string operator""s(const char *, size_t); +} +namespace string

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/172170 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add a new check 'replace-with-string-view' (PR #172170)

2025-12-20 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Looks good, thanks for your work; however, I think we should add some options to tweak behavior before we can land it. One major drawback is this pattern: ```diff template std::string getArcana(const T &N) { return dump([&](TextNodeDumper &D) { D

[clang] [CodeCompletion] Consider header files without extension, if... (PR #166447)

2025-12-20 Thread via cfe-commits
https://github.com/Sirraide commented: I feel like that’s reasonable; I’m not too familiar w/ the code completion part of Clang so I’ll leave it to someone else to approve this, but it should probably come w/ a release note https://github.com/llvm/llvm-project/pull/166447 _

[clang] [CodeCompletion] Consider header files without extension, if... (PR #166447)

2025-12-20 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks updated https://github.com/llvm/llvm-project/pull/166447 From 6a2ee288527869b2b36ce2d74e2c96059c1bc628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Tue, 4 Nov 2025 22:25:53 +0100 Subject: [PATCH] [CodeCompletion] Consider head

[clang] [CodeCompletion] Consider header files without extension, if... (PR #166447)

2025-12-20 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks updated https://github.com/llvm/llvm-project/pull/166447 From af71442e3763a2ea12bee17913a849b305260c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Tue, 4 Nov 2025 22:25:53 +0100 Subject: [PATCH] [CodeCompletion] Consider head

[clang] [CodeCompletion] Consider header files without extension, if... (PR #166447)

2025-12-20 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 origin/main HEAD --extensions cpp -- clang/lib/Sema/SemaCodeComplete.cpp clang/test/

[clang] [CodeCompletion] Consider header files without extension, if... (PR #166447)

2025-12-20 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks updated https://github.com/llvm/llvm-project/pull/166447 From 6ab23a49cc9918c3513b731818f1f5190e280ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Tue, 4 Nov 2025 22:25:53 +0100 Subject: [PATCH] [CodeCompletion] Consider head

[clang] [llvm] [HLSL][Matrix] Support row and column indexing modes for MatrixSubscriptExpr (PR #171564)

2025-12-20 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl closed https://github.com/llvm/llvm-project/pull/171564 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 21571cf - [HLSL][Matrix] Support row and column indexing modes for MatrixSubscriptExpr (#171564)

2025-12-20 Thread via cfe-commits
Author: Farzon Lotfi Date: 2025-12-20T17:21:04-05:00 New Revision: 21571cf30616cb12111d3f725348c27262d89753 URL: https://github.com/llvm/llvm-project/commit/21571cf30616cb12111d3f725348c27262d89753 DIFF: https://github.com/llvm/llvm-project/commit/21571cf30616cb12111d3f725348c27262d89753.diff

[clang] cb56a91 - [HLSL][Matrix] Add OR and AND logical operator support for matrix (#172384)

2025-12-20 Thread via cfe-commits
Author: Farzon Lotfi Date: 2025-12-20T17:20:32-05:00 New Revision: cb56a910f8bc90cb7df700fa702b75a0a2c550f8 URL: https://github.com/llvm/llvm-project/commit/cb56a910f8bc90cb7df700fa702b75a0a2c550f8 DIFF: https://github.com/llvm/llvm-project/commit/cb56a910f8bc90cb7df700fa702b75a0a2c550f8.diff

[clang] [HLSL][Matrix] Add OR and AND logical operator support for matrix (PR #172384)

2025-12-20 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl closed https://github.com/llvm/llvm-project/pull/172384 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Only emit FP math intrinsics when precision/errno settings allow it (PR #169424)

2025-12-20 Thread Hendrik Hübner via cfe-commits
https://github.com/HendrikHuebner updated https://github.com/llvm/llvm-project/pull/169424 From 9efce61e32ea9407efdaf011cdfb565e61a6fa24 Mon Sep 17 00:00:00 2001 From: hhuebner Date: Tue, 25 Nov 2025 00:26:58 +0100 Subject: [PATCH 1/4] [CIR] Move FP math intrinsics to separate function and add

[clang] [CIR] Only emit FP math intrinsics when precision/errno settings allow it (PR #169424)

2025-12-20 Thread Hendrik Hübner via cfe-commits
https://github.com/HendrikHuebner updated https://github.com/llvm/llvm-project/pull/169424 From 9efce61e32ea9407efdaf011cdfb565e61a6fa24 Mon Sep 17 00:00:00 2001 From: hhuebner Date: Tue, 25 Nov 2025 00:26:58 +0100 Subject: [PATCH 1/3] [CIR] Move FP math intrinsics to separate function and add

[clang] [CIR] Only emit FP math intrinsics when precision/errno settings allow it (PR #169424)

2025-12-20 Thread Hendrik Hübner via cfe-commits
https://github.com/HendrikHuebner updated https://github.com/llvm/llvm-project/pull/169424 From 9efce61e32ea9407efdaf011cdfb565e61a6fa24 Mon Sep 17 00:00:00 2001 From: hhuebner Date: Tue, 25 Nov 2025 00:26:58 +0100 Subject: [PATCH 1/2] [CIR] Move FP math intrinsics to separate function and add

  1   2   >