[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-02-23 Thread Fangyi Zhou via cfe-commits
@@ -166,57 +166,47 @@ DefinedOrUnknownSVal SValBuilder::conjureSymbolVal(const void *SymbolTag, if (Ex->isGLValue()) T = LCtx->getAnalysisDeclContext()->getASTContext().getPointerType(ExType); - return conjureSymbolVal(SymbolTag, Ex, LCtx, T, Count); + return conjureS

[clang-tools-extra] [clang-tidy] warn when `true` is used as a preprocessor keyword in C (PR #128265)

2025-02-23 Thread via cfe-commits
isuckatcs wrote: @PiotrZSL > What about 'false' ? In both cases if `false` is a keyword or an undefined macro, it evaluates to `false`, so I don't find that misleading or the source of a hard-to debug issue, so I don't see a reason to emit a warning for that. > This issue is detected by -Wu

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-02-23 Thread via cfe-commits
@@ -1299,8 +1299,8 @@ ProgramStateRef CStringChecker::invalidateBufferAux( RegionAndSymbolInvalidationTraits ITraits; bool CausesPointerEscape = InvalidationTraitOperations(ITraits, R); -return State->invalidateRegions(R, E, C.blockCount(), LCtx, i

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-23 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/126654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UnretainedLocalVarsChecker] Add a checker for local variables to NS and CF types. (PR #127554)

2025-02-23 Thread Rashmi Mudduluru via cfe-commits
@@ -332,6 +345,14 @@ class UncheckedCallArgsChecker final : public RawPtrRefCallArgsChecker { return isUncheckedPtr(QT); } + bool isSafePtr(const CXXRecordDecl *Record) const final { +return isRefCounted(Record) || isCheckedPtr(Record); + } + + bool isSafePtrType

[clang] [alpha.webkit.UnretainedLocalVarsChecker] Add a checker for local variables to NS and CF types. (PR #127554)

2025-02-23 Thread Ryosuke Niwa via cfe-commits
@@ -332,6 +345,14 @@ class UncheckedCallArgsChecker final : public RawPtrRefCallArgsChecker { return isUncheckedPtr(QT); } + bool isSafePtr(const CXXRecordDecl *Record) const final { +return isRefCounted(Record) || isCheckedPtr(Record); + } + + bool isSafePtrType

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-23 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,69 @@ +//===--- UnintendedCharOstreamOutputCheck.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: Apa

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/127720 >From b69bb465a24f2175f2f9f91f220252d3bcb27bde Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Feb 2025 07:38:37 +0800 Subject: [PATCH 1/9] [clang-tidy]add new check bugprone-unintended-char-ostre

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/127720 >From b69bb465a24f2175f2f9f91f220252d3bcb27bde Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Feb 2025 07:38:37 +0800 Subject: [PATCH 1/9] [clang-tidy]add new check bugprone-unintended-char-ostre

[clang-tools-extra] [clang-tidy]improve performance-unnecessary-value-param performance (PR #128383)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/128383 >From 721393e8f1a464931884be95fef48518f8c351f1 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 23 Feb 2025 08:36:53 +0800 Subject: [PATCH 1/2] [clang-tidy]improve performance-unnecessary-value-param

[clang-tools-extra] [clang-tidy] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-23 Thread Congcong Cai via cfe-commits
@@ -22,7 +22,8 @@ namespace clang::tidy::performance { class NoexceptFunctionBaseCheck : public ClangTidyCheck { public: NoexceptFunctionBaseCheck(StringRef Name, ClangTidyContext *Context) - : ClangTidyCheck(Name, Context) {} + : ClangTidyCheck(Name, Context) +

[clang-tools-extra] [clang-tidy] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-23 Thread Congcong Cai via cfe-commits
@@ -110,6 +110,12 @@ Changes in existing checks ` check by providing additional examples and fixing some macro related false positives. +- Improved :doc:`performance-noexcept-move-constructor + ` check by adding + a new (off-by-default) option `AllowFalseEvaluated`, whic

[clang] [Driver] Teach Barmetal toolchain about GCC installation(1/3) (PR #121829)

2025-02-23 Thread Garvit Gupta via cfe-commits
quic-garvgupt wrote: It's been a few weeks since this patch was last reviewed. If everything looks good, could someone please provide an LGTM? I'd like to merge this patch soon. https://github.com/llvm/llvm-project/pull/121829 ___ cfe-commits mailin

[clang] [Driver] Teach Barmetal toolchain about GCC installation(1/3) (PR #121829)

2025-02-23 Thread Garvit Gupta via cfe-commits
@@ -110,20 +111,93 @@ static std::string computeBaseSysRoot(const Driver &D, bool IncludeTriple) { return std::string(SysRootDir); } +// GCC sysroot here means form sysroot from either --gcc-install-dir, or from +// --gcc-toolchain or if the toolchain is installed alongside

[clang] [Driver] Teach Barmetal toolchain about GCC installation(1/3) (PR #121829)

2025-02-23 Thread Fangrui Song via cfe-commits
@@ -110,20 +111,93 @@ static std::string computeBaseSysRoot(const Driver &D, bool IncludeTriple) { return std::string(SysRootDir); } +// GCC sysroot here means form sysroot from either --gcc-install-dir, or from +// --gcc-toolchain or if the toolchain is installed alongside

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcilia (Large Immediate Arithmetic) extension (PR #124706)

2025-02-23 Thread Craig Topper via cfe-commits
https://github.com/topperc approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/124706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcilia (Large Immediate Arithmetic) extension (PR #124706)

2025-02-23 Thread via cfe-commits
@@ -1056,6 +1056,15 @@ struct RISCVOperand final : public MCParsedAsmOperand { isInt<26>(fixImmediateForRV32(Imm, isRV64Imm())); } + bool isSImm32() const { +int64_t Imm; +RISCVMCExpr::VariantKind VK = RISCVMCExpr::VK_RISCV_None; +if (!isImm()) +

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcilia (Large Immediate Arithmetic) extension (PR #124706)

2025-02-23 Thread via cfe-commits
https://github.com/hchandel updated https://github.com/llvm/llvm-project/pull/124706 >From 81d1b6240cfaedb521d4f0efd54744114577f455 Mon Sep 17 00:00:00 2001 From: Harsh Chandel Date: Fri, 24 Jan 2025 16:43:12 +0530 Subject: [PATCH 1/5] [RISCV] Add Qualcomm uC Xqcilia (Large Immediate Arithmeti

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcilia (Large Immediate Arithmetic) extension (PR #124706)

2025-02-23 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. https://github.com/llvm/llvm-project/pull/124706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move fma to the CLC library (PR #126052)

2025-02-23 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: > FYI @rjodinchr this breaks downstream clspv testing. > > ``` > # | declare !kernel_arg_name !7 float @llvm.fma.f32(float, float, float) #2 > # | Unsupported llvm intrinsic > # | UNREACHABLE executed at /clspv/lib/SPIRVProducerPass.cpp:2390! > ``` > > I was wondering if clspv

[libclc] [libclc] Fix int<->float conversion builtins (PR #126905)

2025-02-23 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr approved this pull request. https://github.com/llvm/llvm-project/pull/126905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][clang]: Implement a conditional lifetimebound_if builtin. (PR #125520)

2025-02-23 Thread Haojian Wu via cfe-commits
hokein wrote: > A moved from object could be reinitalized: > > ``` > void test() { > std::vector abc; > std::string b; > add(abc, std::move(b)); > b = std::string(); // now b can be used again. > } > ``` > > That being said, maybe this is rare enough that we could have

[clang] [analyzer] Refine TimeTrace name for dispatchWorkItem (PR #128352)

2025-02-23 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto approved this pull request. https://github.com/llvm/llvm-project/pull/128352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 6b5bde6 - [analyzer] Refine TimeTrace name for dispatchWorkItem (#128352)

2025-02-23 Thread via cfe-commits
Author: Balazs Benics Date: 2025-02-24T08:36:05+01:00 New Revision: 6b5bde697bb6f2ec8564c9b35bbf9f2d5b703f13 URL: https://github.com/llvm/llvm-project/commit/6b5bde697bb6f2ec8564c9b35bbf9f2d5b703f13 DIFF: https://github.com/llvm/llvm-project/commit/6b5bde697bb6f2ec8564c9b35bbf9f2d5b703f13.diff

[clang] [analyzer] Refine TimeTrace name for dispatchWorkItem (PR #128352)

2025-02-23 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/128352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix ASTWriter crash after merging named enums (PR #114240)

2025-02-23 Thread Michael Jabbour via cfe-commits
michael-jabbour-sonarsource wrote: Gentle ping :smile: @vsapsai, @vgvassilev, I think I have responded to your inquiries and added a few related questions. Could you have a look? https://github.com/llvm/llvm-project/pull/114240 ___ cfe-commits mailin

[clang] [Clang] Handle instantiating captures in addInstantiatedCapturesToScope() (PR #128478)

2025-02-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/128478 `addInstantiatedCapturesToScope()` might be called when transforming a lambda body. In this situation, it would look into all the lambda's parents and figure out all the instantiated captures. However, the inst

[clang] 0968df9 - [clang-format] Add the C language instead of treating it like C++ (#128287)

2025-02-23 Thread via cfe-commits
Author: Owen Pan Date: 2025-02-23T00:36:19-08:00 New Revision: 0968df9c3a5562f6a8d9f7948065848f3a273b81 URL: https://github.com/llvm/llvm-project/commit/0968df9c3a5562f6a8d9f7948065848f3a273b81 DIFF: https://github.com/llvm/llvm-project/commit/0968df9c3a5562f6a8d9f7948065848f3a273b81.diff LOG:

[clang] [clang-format] Add the C language instead of treating it like C++ (PR #128287)

2025-02-23 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/128287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add the C language instead of treating it like C++ (PR #128287)

2025-02-23 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-arm-ubuntu` running on `linaro-lldb-arm-ubuntu` while building `clang` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/11895 Here is the relevant piece of the build lo

[clang] [Clang] Treat constexpr-unknown value as invalid in `evaluateValue` (PR #128409)

2025-02-23 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/128409 It is an alternative to https://github.com/llvm/llvm-project/pull/127525. Close https://github.com/llvm/llvm-project/issues/127475. >From 83248eb164ff53442ad6d0c9d1be20027519bac1 Mon Sep 17 00:00:00 2001 From:

[clang] [Clang] Treat constexpr-unknown value as invalid in `evaluateValue` (PR #128409)

2025-02-23 Thread Yingwei Zheng via cfe-commits
@@ -122,9 +122,9 @@ namespace CaseStatements { } extern int &Recurse1; -int &Recurse2 = Recurse1; // expected-note {{declared here}} +int &Recurse2 = Recurse1; // pre-cxx23-note {{declared here}} dtcxzyw wrote: This is a regression. https://github.com/llvm/l

[clang] [clang-format] Add the C language instead of treating it like C++ (PR #128287)

2025-02-23 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-cmake-x86_64-avx512-win` running on `avx512-intel64-win` while building `clang` at step 6 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/81/builds/5036 Here is the relevant pi

[clang] [Clang][CodeGen] Bail out on constexpr unknown values in ConstantEmitter (PR #127525)

2025-02-23 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > > Clang rejects the following case after modifying evaluateValue to treat > > constexpr-unknown value as invalid > > I don't see the connection. At least, there isn't any obvious connection: the > testcase doesn't require constexpr-unknown. Maybe you need to "reject" the > va

[clang] [clang-format] Fix a bug that changes keyword `or` to an identifier (PR #128410)

2025-02-23 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/128410 Fixes #105482 >From bcec5b1bfe6fefbdcaab59e1361c71db395ebdb0 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 23 Feb 2025 00:54:55 -0800 Subject: [PATCH] [clang-format] Fix a bug that changes keyword `or` to a

[clang] [clang-format] Fix a bug that changes keyword `or` to an identifier (PR #128410)

2025-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Fixes #105482 --- Full diff: https://github.com/llvm/llvm-project/pull/128410.diff 4 Files Affected: - (modified) clang/lib/Format/FormatToken.h (-23) - (modified) clang/lib/Format/UnwrappedLineParser.c

[clang-tools-extra] [clang-tidy] Fix invalid fixit from modernize-use-ranges for nullptr used with std::unique_ptr (PR #127162)

2025-02-23 Thread via cfe-commits
chrchr-github wrote: Thanks for addressing this. However I think a more general solution is required (instead of special-casing `std::unique_ptr`/`nullptr`), see https://github.com/llvm/llvm-project/issues/124815#issuecomment-2676753012 https://github.com/llvm/llvm-project/pull/127162

[clang-tools-extra] 0f87690 - [clang-tidy][NFC][docs] Use single tick for 'false' and 'true' values in options (#128362)

2025-02-23 Thread via cfe-commits
Author: Baranov Victor Date: 2025-02-23T18:43:41+08:00 New Revision: 0f8769086e8eec684559eaceccf0cbe8e9a11bc0 URL: https://github.com/llvm/llvm-project/commit/0f8769086e8eec684559eaceccf0cbe8e9a11bc0 DIFF: https://github.com/llvm/llvm-project/commit/0f8769086e8eec684559eaceccf0cbe8e9a11bc0.diff

[clang] 8102fec - [clang][bytecode] Reject calls to pure virtual functions (#128412)

2025-02-23 Thread via cfe-commits
Author: Timm Baeder Date: 2025-02-23T11:44:37+01:00 New Revision: 8102fec00bb90969eee1c2160829866aa5c8a32f URL: https://github.com/llvm/llvm-project/commit/8102fec00bb90969eee1c2160829866aa5c8a32f DIFF: https://github.com/llvm/llvm-project/commit/8102fec00bb90969eee1c2160829866aa5c8a32f.diff L

[clang] [clang][bytecode] Reject calls to pure virtual functions (PR #128412)

2025-02-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/128412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-02-23 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= , Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: @@ -449,6 +479,10 @@ ClangTidyASTConsumerFactory::createASTConsumer( } std::vector> Consumers; + + if (!Context.getOptions().SystemHeaders.value_or(false)) +Consumers.push_back(std::make

[clang] c38befd - [clang][bytecode] Fix delete[] dtor order (#128411)

2025-02-23 Thread via cfe-commits
Author: Timm Baeder Date: 2025-02-23T11:32:35+01:00 New Revision: c38befd94ffe84e7d0d01ae9af10e32319f3ef12 URL: https://github.com/llvm/llvm-project/commit/c38befd94ffe84e7d0d01ae9af10e32319f3ef12 DIFF: https://github.com/llvm/llvm-project/commit/c38befd94ffe84e7d0d01ae9af10e32319f3ef12.diff L

[clang] [clang][bytecode] Fix delete[] dtor order (PR #128411)

2025-02-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/128411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. lgtm. please run git-clang-format also. i think there are format issue in the new code. https://github.com/llvm/llvm-project/pull/128402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread Congcong Cai via cfe-commits
@@ -44,6 +44,12 @@ void MoveConstArgCheck::registerMatchers(MatchFinder *Finder) { unless(isInTemplateInstantiation())) .bind("call-move"); + // Match ternary expressions where either branch contains std::move + auto TernaryWithMoveMatcher = +

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/128402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Reject calls to pure virtual functions (PR #128412)

2025-02-23 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-libc-amdgpu-runtime` running on `omp-vega20-1` while building `clang` at step 7 "Add check check-offload". Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/13492 Here is the r

[clang-tools-extra] [clang-tidy][NFC][docs] Use single tick for 'false' and 'true' values in options (PR #128362)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/128362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread David Rivera via cfe-commits
RiverDave wrote: > lgtm. please run git-clang-format also. i think there are format issue in the > new code. Thx @HerrCai0907, your feedback has been addresed. https://github.com/llvm/llvm-project/pull/128402 ___ cfe-commits mailing list cfe-commi

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

2025-02-23 Thread Denis Mikhailov via cfe-commits
https://github.com/denzor200 approved this pull request. https://github.com/llvm/llvm-project/pull/121291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Updating to include gcc-toolsets 13 and 14 (PR #128438)

2025-02-23 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] [clang] Updating to include gcc-toolsets 13 and 14 (PR #128438)

2025-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Bill Blum (roadswitcher) Changes Updating clang/lib/Driver to detect the newer gcc-toolchain versions. ( submitted to llvm-commits mailing list ) --- Full diff: https://github.com/llvm/llvm-project/pull/1

[clang] [clang] Updating to include gcc-toolsets 13 and 14 (PR #128438)

2025-02-23 Thread Bill Blum via cfe-commits
https://github.com/roadswitcher created https://github.com/llvm/llvm-project/pull/128438 Updating clang/lib/Driver to detect the newer gcc-toolchain versions. ( submitted to llvm-commits mailing list ) >From a0eb0bcc139d23294f8013da2dcc15adcaa8ef55 Mon Sep 17 00:00:00 2001 From: Bill Blum Dat

[clang-tools-extra] [clangd] Reduce superfluous rename conflicts (PR #121515)

2025-02-23 Thread Ujan RoyBandyopadhyay via cfe-commits
ujan-r wrote: No worries, thanks for the review! I don't have commit access, so you'll have to merge the changes on my behalf. https://github.com/llvm/llvm-project/pull/121515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-23 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,30 @@ +.. title:: clang-tidy - bugprone-unintended-char-ostream-output + +bugprone-unintended-char-ostream-output +=== + +Finds unintended character output from ``unsigned char`` and ``signed char`` to an +``ostream``. + +Normally, w

[clang-tools-extra] [clangd] Reduce superfluous rename conflicts (PR #121515)

2025-02-23 Thread Ujan RoyBandyopadhyay via cfe-commits
https://github.com/ujan-r updated https://github.com/llvm/llvm-project/pull/121515 >From e2d63656b94c2a1f9071397abc64d1cdcdb62c75 Mon Sep 17 00:00:00 2001 From: Ujan RoyBandyopadhyay <116058173+uja...@users.noreply.github.com> Date: Thu, 2 Jan 2025 00:20:52 -0600 Subject: [PATCH] [clangd] Reduce

[clang] [alpha.webkit.UnretainedLocalVarsChecker] Add a checker for local variables to NS and CF types. (PR #127554)

2025-02-23 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/127554 >From d6c4e1a23dc0cc6850c5cfdceecc2e1be8943592 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 17 Feb 2025 18:18:09 -0800 Subject: [PATCH 1/7] [alpha.webkit.UnretainedLocalVarsChecker] Add a checker for lo

[clang] [clang-tidy] [dataflow] Cache reference accessors for `bugprone-unchecked-optional-access` (PR #128437)

2025-02-23 Thread Valentyn Yukhymenko via cfe-commits
https://github.com/BaLiKfromUA created https://github.com/llvm/llvm-project/pull/128437 Fixes https://github.com/llvm/llvm-project/issues/126283 Extending https://github.com/llvm/llvm-project/pull/112605 to cache const getters which return references. This should fix false positive cases when

[clang] [clang-tidy] [dataflow] Cache reference accessors for `bugprone-unchecked-optional-access` (PR #128437)

2025-02-23 Thread Valentyn Yukhymenko via cfe-commits
BaLiKfromUA wrote: TODO: update release notes and `clang-tools-extra/docs/clang-tidy/checks/bugprone/unchecked-optional-access.rst` if needed https://github.com/llvm/llvm-project/pull/128437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [clang-tidy] [dataflow] Cache reference accessors for `bugprone-unchecked-optional-access` (PR #128437)

2025-02-23 Thread Valentyn Yukhymenko via cfe-commits
@@ -580,6 +580,26 @@ void handleConstMemberCall(const CallExpr *CE, return; } + // Cache if the const method returns a reference + if (RecordLoc != nullptr && CE->isGLValue()) { +const FunctionDecl *DirectCallee = CE->getDirectCallee(); +if (DirectCallee == nul

[clang] [clang-tidy] [dataflow] Cache reference accessors for `bugprone-unchecked-optional-access` (PR #128437)

2025-02-23 Thread Valentyn Yukhymenko via cfe-commits
@@ -3863,6 +3863,192 @@ TEST_P(UncheckedOptionalAccessTest, ConstBoolAccessorWithModInBetween) { )cc"); } +TEST_P(UncheckedOptionalAccessTest, + ConstRefAccessorToOptionalViaConstRefAccessorToHoldingObject) { + ExpectDiagnosticsFor(R"cc( +#include "unchecked_opti

[clang] [clang-tidy] [dataflow] Cache reference accessors for `bugprone-unchecked-optional-access` (PR #128437)

2025-02-23 Thread Valentyn Yukhymenko via cfe-commits
@@ -580,6 +580,26 @@ void handleConstMemberCall(const CallExpr *CE, return; } + // Cache if the const method returns a reference + if (RecordLoc != nullptr && CE->isGLValue()) { +const FunctionDecl *DirectCallee = CE->getDirectCallee(); +if (DirectCallee == nul

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-23 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,60 @@ +Distributed ThinLTO (DTLTO) +=== + +DTLTO allows for the distribution of backend ThinLTO compilations via external +distribution systems, e.g. Incredibuild. There is existing support for +distributing ThinLTO compilations by using separate

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-23 Thread Fangrui Song via cfe-commits
@@ -2142,3 +2190,326 @@ std::vector lto::generateModulesOrdering(ArrayRef R) { }); return ModulesOrdering; } + +namespace { +// For this out-of-process backend no codegen is done when invoked for each +// task. Instead we generate the required information (e.g. the summary

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-23 Thread Fangrui Song via cfe-commits
@@ -535,6 +535,21 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, D.getLTOMode() == LTOK_Thin); } + // Forward the DTLTO options to the linker. We add these unconditionally, + // rather than in addLTOOptions() as it is

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-23 Thread Fangrui Song via cfe-commits
@@ -1702,6 +1703,37 @@ static uint8_t getOsAbi(const Triple &t) { } } +// Check if an archive file is a thin archive. +static bool isThinArchive(Ctx &ctx, StringRef archiveFilePath) { + const size_t thinArchiveMagicLen = sizeof(ThinArchiveMagic) - 1; + + ErrorOr> memBuffer

[clang] [clang] Updating to include gcc-toolsets 13 and 14 (PR #128438)

2025-02-23 Thread Fangrui Song via cfe-commits
MaskRay wrote: I think redhat gcc-toolset support should move to Clang configuration files https://reviews.llvm.org/D136435 @tbaederr https://github.com/llvm/llvm-project/pull/128438 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-23 Thread Fangrui Song via cfe-commits
@@ -2142,3 +2190,326 @@ std::vector lto::generateModulesOrdering(ArrayRef R) { }); return ModulesOrdering; } + +namespace { +// For this out-of-process backend no codegen is done when invoked for each +// task. Instead we generate the required information (e.g. the summary

[clang-tools-extra] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-02-23 Thread via cfe-commits
flovent wrote: ping https://github.com/llvm/llvm-project/pull/127394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix invalid fixit from modernize-use-ranges for nullptr used with std::unique_ptr (PR #127162)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: LGTM. since it is just a patch instead of ideal solution for `std::equality_comparable_with` stuff, could you add some FIXME in code? https://github.com/llvm/llvm-project/pull/127162 ___ cfe-commits mailing li

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

2025-02-23 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > In the issue (#127499) you pointed out that this issue applies to the MSVC > > ABI where all parameters are destroyed in the callee. Is it reasonable to > > construct the analogous test case in that environment? > > Yes, in fact the reproducer on that issue will trigger u

<    1   2