[clang] [NFC][analyzer] Document configuration options (PR #135169)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,115 @@ + +Configuring the Analyzer + + +The clang static analyzer supports two kinds of options: + +1. Global **analyzer options** influence the behavior of the analyzer engine. + They are documented on this page, in the

[clang] [HIP] change default offload archs (PR #139281)

2025-05-13 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: So we will wait until amdgcnspirv uses SPRIV backend by default, then switch HIP default offload arch to amdgcnspirv. That sounds a reasonable solution to me. https://github.com/llvm/llvm-project/pull/139281 ___ cfe-commits mailing li

[clang] e3f87e1 - [C] Fix a false-positive with tentative defn compat (#139738)

2025-05-13 Thread via cfe-commits
Author: Aaron Ballman Date: 2025-05-13T10:59:55-04:00 New Revision: e3f87e15910a5f1c5552fc3ef57e7dda3f68901a URL: https://github.com/llvm/llvm-project/commit/e3f87e15910a5f1c5552fc3ef57e7dda3f68901a DIFF: https://github.com/llvm/llvm-project/commit/e3f87e15910a5f1c5552fc3ef57e7dda3f68901a.diff

[clang] [clang][modules] Invalidate module cache when SDKSettings.json changes (PR #139751)

2025-05-13 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/139751 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] Make -funwind-tables the default for SystemZ. (PR #139764)

2025-05-13 Thread via cfe-commits
https://github.com/anoopkg6 created https://github.com/llvm/llvm-project/pull/139764 Making -funwind-tables by default for SystemZ like other architectures in driver by setting UnwindTableLevel::Asynchronous. This enables eh_frame to be generated by default. >From e0b15d83e04aebc8f7198af085c6f

[clang] Make -funwind-tables the default for SystemZ. (PR #139764)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: None (anoopkg6) Changes Making -funwind-tables by default for SystemZ like other architectures in driver by setting UnwindTableLevel::Asynchronous. This enables eh_frame to be generated by default. --- Full diff: https://github.com

[clang] Make -funwind-tables the default for SystemZ. (PR #139764)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (anoopkg6) Changes Making -funwind-tables by default for SystemZ like other architectures in driver by setting UnwindTableLevel::Asynchronous. This enables eh_frame to be generated by default. --- Full diff: https://github.com/llvm/l

[clang] [clang][bytecode][NFC] Delete DynamicAllocator copy/move ctors (PR #139710)

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

[clang] [Clang][CodeGen][X86] don't coerce int128 into `{i64,i64}` for SysV-like ABIs (PR #135230)

2025-05-13 Thread via cfe-commits
@@ -2595,6 +2595,14 @@ GetX86_64ByValArgumentPair(llvm::Type *Lo, llvm::Type *Hi, ABIArgInfo X86_64ABIInfo:: classifyReturnType(QualType RetTy) const { + // return int128 as i128 + if (const BuiltinType *BT = RetTy->getAs()) { +BuiltinType::Kind k = BT->getKind(); +

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -453,6 +453,37 @@ CodeGenModule::CodeGenModule(ASTContext &C, if (Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86) getModule().addModuleFlag(llvm::Module::Error, "NumRegisterParameters", CodeGenOpts.NumRegisterParameters

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-05-13 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/136854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -176,6 +176,21 @@ class CallerSym : public SymbolRecord { uint32_t RecordOffset = 0; }; +class HotPatchFuncSym : public SymbolRecord { aganea wrote: Thanks! Would that tooling remain proprietary, or is it something that will be open-sourced as well, for

[clang] [Clang] Fix Sema::checkArgCount for 0-arg functions (PR #139638)

2025-05-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Can somebody merge when it's appropriate? I don't have merge rights. Yup, we can land for you once precommit CI goes green. Thank you for letting us know! https://github.com/llvm/llvm-project/pull/139638 ___ cfe-commits mailing

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,20 @@ +// This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ. +// +// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-hotpatch-functions-file=%S/ms-hotpatch-functions.txt /Fo%t.obj %s ag

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Balazs Benics via cfe-commits
steakhal wrote: > I handled all the inline comments. > > I have one minor architectural question: we should standardize a way to > assign a single tag description (that is, an identifier that can be used in > debug dumps) to each checker family. The old code automatically used the name > of t

[clang] 131c8f8 - [OpenMP] Fix crash with invalid size expression (#139745)

2025-05-13 Thread via cfe-commits
Author: Aaron Ballman Date: 2025-05-13T12:55:53-04:00 New Revision: 131c8f84bb4799ba8dded520791115b3c2b94f29 URL: https://github.com/llvm/llvm-project/commit/131c8f84bb4799ba8dded520791115b3c2b94f29 DIFF: https://github.com/llvm/llvm-project/commit/131c8f84bb4799ba8dded520791115b3c2b94f29.diff

[clang] [OpenMP] Fix crash with invalid size expression (PR #139745)

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

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-05-13 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 HEAD~1 HEAD --extensions cpp -- clang/test/CodeGenCXX/builtin-get-vtable-pointer.cpp

[clang] [clang] Add builtin_get_vtable_pointer and virtual_member_address (PR #135469)

2025-05-13 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Closing this, as I'm not sure the virtual_member_address builtin is actually needed, so for now we'll just do `builtin_get_vtable` which is used in other projects https://github.com/llvm/llvm-project/pull/135469 ___ cfe-commits mailing

[clang] [clang] Add builtin_get_vtable_pointer and virtual_member_address (PR #135469)

2025-05-13 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/135469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-05-13 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/139790 >From a933679801bde89b53584c4c65118658477db4da Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 13 May 2025 13:35:55 -0700 Subject: [PATCH] [clang][PAC] Add __builtin_get_vtable_pointer With pointer authent

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Oliver Hunt (ojhunt) Changes With pointer authentication it becomes non-trivial to correctly load the vtable pointer of a polymorphic object. __builtin_get_vtable_pointer is a function that performs the load and performs the appr

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-05-13 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/139790 With pointer authentication it becomes non-trivial to correctly load the vtable pointer of a polymorphic object. __builtin_get_vtable_pointer is a function that performs the load and performs the appropriate au

[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)

2025-05-13 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/117428 >From 3e25d7ef2e223942298078dace8979905956d05c Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Fri, 22 Nov 2024 17:53:24 +0100 Subject: [PATCH 01/10] Add an off-by-default warning to complain about MSVC bitfiel

[clang] [CIR][NFC] Use arrangeFunctionDeclaration to build function types (PR #139787)

2025-05-13 Thread Erich Keane via cfe-commits
@@ -95,6 +120,34 @@ CIRGenTypes::arrangeFreeFunctionCall(const CallArgList &args, return arrangeFreeFunctionLikeCall(*this, cgm, args, fnType); } +/// Arrange the argument and result information for the declaration or +/// definition of the given function. +const CIRGenFunc

[clang] [CIR][NFC] Use arrangeFunctionDeclaration to build function types (PR #139787)

2025-05-13 Thread Erich Keane via cfe-commits
@@ -58,8 +59,9 @@ class RequiredArgs { } static RequiredArgs - forPrototypePlus(clang::CanQual prototype) { -return forPrototypePlus(prototype.getTypePtr()); + forPrototypePlus(clang::CanQual prototype, erichkeane wrote: Can you decode this name for

[clang] [clang][OpenMP] Treat "workshare" as unknown OpenMP directive (PR #139793)

2025-05-13 Thread Krzysztof Parzyszek via cfe-commits
https://github.com/kparzysz created https://github.com/llvm/llvm-project/pull/139793 The "workshare" construct is only present in Fortran. The common OpenMP code does treat it as any other directive, but in clang we need to reject it, and do so gracefully before it encounters an internal asser

[clang] [clang][OpenMP] Treat "workshare" as unknown OpenMP directive (PR #139793)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krzysztof Parzyszek (kparzysz) Changes The "workshare" construct is only present in Fortran. The common OpenMP code does treat it as any other directive, but in clang we need to reject it, and do so gracefully before it encounters an inte

[clang] [compiler-rt] [Coverage] Fix mapping for do-while loops with terminating statements (PR #139777)

2025-05-13 Thread Justin Cady via cfe-commits
https://github.com/justincady created https://github.com/llvm/llvm-project/pull/139777 The current region mapping for do-while loops that contain statements such as break or continue results in inaccurate line coverage reports for the line following the loop. This change handles terminating sta

[clang] [compiler-rt] [Coverage] Fix mapping for do-while loops with terminating statements (PR #139777)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Justin Cady (justincady) Changes The current region mapping for do-while loops that contain statements such as break or continue results in inaccurate line coverage reports for the line following the loop. This change handles terminating s

[clang] [compiler-rt] [Coverage] Fix mapping for do-while loops with terminating statements (PR #139777)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-pgo Author: Justin Cady (justincady) Changes The current region mapping for do-while loops that contain statements such as break or continue results in inaccurate line coverage reports for the line following the loop.

[clang] [llvm] [CMake] Add a linker test for -Bsymbolic-functions to AddLLVM (PR #79539)

2025-05-13 Thread Mateusz Mikuła via cfe-commits
@@ -314,6 +308,11 @@ function(add_link_opts target_name) set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-brtl") endif() + + if (NOT MINGW) +llvm_check_linker_flag(CXX "-Wl,-Bsymbolic-functions" +

[clang] [compiler-rt] [Coverage] Fix mapping for do-while loops with terminating statements (PR #139777)

2025-05-13 Thread Justin Cady via cfe-commits
https://github.com/justincady ready_for_review https://github.com/llvm/llvm-project/pull/139777 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElement in SymbolConjured (reland) (PR #137355)

2025-05-13 Thread Greg Bedwell via cfe-commits
gregbedwell wrote: We've observed a crash in clang since this commit when using `--analyze` in conjunction with `-ftime-trace`. I've put the details in #139779. Please could you take a look? https://github.com/llvm/llvm-project/pull/137355 ___ cfe-

[clang] [Clang][NFC] Introduce no local variable to avoid use after move (PR #139784)

2025-05-13 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. Oups, that's my code... https://github.com/llvm/llvm-project/pull/139784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-05-13 Thread JJ Marr via cfe-commits
https://github.com/jj-marr updated https://github.com/llvm/llvm-project/pull/130458 >From 64eb62576dc1ecf0e696f2448e410c2fd77575de Mon Sep 17 00:00:00 2001 From: JJ Marr Date: Sat, 8 Mar 2025 22:00:45 -0500 Subject: [PATCH] Explain which assertion failed during consteval --- clang/docs/Releas

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-05-13 Thread JJ Marr via cfe-commits
https://github.com/jj-marr updated https://github.com/llvm/llvm-project/pull/130458 >From 67984fbf0374fa40fd7b73431b17baddc301290f Mon Sep 17 00:00:00 2001 From: JJ Marr Date: Sat, 8 Mar 2025 22:00:45 -0500 Subject: [PATCH] Explain which assertion failed during consteval --- clang/docs/Releas

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-05-13 Thread JJ Marr via cfe-commits
https://github.com/jj-marr updated https://github.com/llvm/llvm-project/pull/130458 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-s

[clang] [Clang] Fix Sema::checkArgCount for 0-arg functions (PR #139638)

2025-05-13 Thread Hood Chatham via cfe-commits
hoodmane wrote: CI looks green now. https://github.com/llvm/llvm-project/pull/139638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] Fix a crash with spaceship and vector types (PR #139767)

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

[clang] 3b3adef - [Clang] Fix Sema::checkArgCount for 0-arg functions (#139638)

2025-05-13 Thread via cfe-commits
Author: Hood Chatham Date: 2025-05-13T13:01:28-07:00 New Revision: 3b3adefd58826ca4dfd87df8099766d416c54341 URL: https://github.com/llvm/llvm-project/commit/3b3adefd58826ca4dfd87df8099766d416c54341 DIFF: https://github.com/llvm/llvm-project/commit/3b3adefd58826ca4dfd87df8099766d416c54341.diff

[clang] [Clang] Fix Sema::checkArgCount for 0-arg functions (PR #139638)

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

[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)

2025-05-13 Thread Naveen Seth Hanig via cfe-commits
https://github.com/naveen-seth updated https://github.com/llvm/llvm-project/pull/139457 >From 5f246435b9784113ada3f82328433487391f40ab Mon Sep 17 00:00:00 2001 From: naveen-seth Date: Sun, 11 May 2025 14:24:00 + Subject: [PATCH 1/2] [clang] Enforce 1-based indexing for command line source

[clang] [CIR][NFC] Use arrangeFunctionDeclaration to build function types (PR #139787)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes This change replaces the simplified call that we were previously using to convert the function type provided by a global declaration to the CIR function type. We now go through 'arrangeGlobalDeclaration' w

[clang] [CIR][NFC] Use arrangeFunctionDeclaration to build function types (PR #139787)

2025-05-13 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/139787 This change replaces the simplified call that we were previously using to convert the function type provided by a global declaration to the CIR function type. We now go through 'arrangeGlobalDeclaration' whi

[clang] [WebAssembly][Clang] Add __builtin_wasm_ref_is_null_extern (PR #139580)

2025-05-13 Thread Thomas Lively via cfe-commits
https://github.com/tlively commented: WebAssembly part LGTM, too. https://github.com/llvm/llvm-project/pull/139580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Improve casting between i1 scalable vectors and i8 fixed vectors for -mrvv-vector-bits (PR #139190)

2025-05-13 Thread Nuno Lopes via cfe-commits
@@ -1476,8 +1486,14 @@ CoerceScalableToFixed(CodeGenFunction &CGF, llvm::FixedVectorType *ToTy, // If we are casting a scalable i1 predicate vector to a fixed i8 // vector, first bitcast the source. if (FromTy->getElementType()->isIntegerTy(1) && - FromTy->getElemen

[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)

2025-05-13 Thread Naveen Seth Hanig via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:0:1 %s -o - +// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:1:0 %s -o - + +// Related to #139375 +// Clang uses 1-based indexing for source locations given from the command-line. +// Verify

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-05-13 Thread JJ Marr via cfe-commits
jj-marr wrote: > @jj-marr Thanks. Do you want us to merge that for you? Is it something I can actually do myself? https://github.com/llvm/llvm-project/pull/130458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [clang-tools-extra] [Clang] Add builtins that deduplicate and sort types (PR #106730)

2025-05-13 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/106730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [openmp] [OpenMP 6.0 ]Codegen for Reduction over private variables with reduction clause (PR #134709)

2025-05-13 Thread Alexey Bataev via cfe-commits
@@ -4898,6 +4898,266 @@ void CGOpenMPRuntime::emitSingleReductionCombiner(CodeGenFunction &CGF, } } +void CGOpenMPRuntime::emitPrivateReduction( +CodeGenFunction &CGF, SourceLocation Loc, const Expr *Privates, +const Expr *LHSExprs, const Expr *RHSExprs, const Expr

[clang] [clang][modules] Invalidate module cache when SDKSettings.json changes (PR #139751)

2025-05-13 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir edited https://github.com/llvm/llvm-project/pull/139751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Invalidate module cache when SDKSettings.json changes (PR #139751)

2025-05-13 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. Nice find, thanks for fixing. https://github.com/llvm/llvm-project/pull/139751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [clang][modules] Invalidate module cache when SDKSettings.json changes (PR #139751)

2025-05-13 Thread Ben Langmuir via cfe-commits
@@ -0,0 +1,49 @@ +// This test checks that the module cache gets invalidated when the SDKSettings.json file changes. + +// RUN: rm -rf %t +// RUN: split-file %s %t + +//--- AppleTVOS15.0.sdk/SDKSettings-old.json +{ + "DisplayName": "tvOS 15.0", + "Version": "15.0", + "Canonica

[clang] 3f6ef4e - [CIR] Cleanup support for C functions (#136854)

2025-05-13 Thread via cfe-commits
Author: Iris Shi Date: 2025-05-13T09:47:21-07:00 New Revision: 3f6ef4ecfbb1597dc818cf2819907ab12799ade4 URL: https://github.com/llvm/llvm-project/commit/3f6ef4ecfbb1597dc818cf2819907ab12799ade4 DIFF: https://github.com/llvm/llvm-project/commit/3f6ef4ecfbb1597dc818cf2819907ab12799ade4.diff LOG:

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -807,6 +809,32 @@ void CodeViewDebug::emitObjName() { endSymbolRecord(CompilerEnd); } +void CodeViewDebug::emitHotPatchInformation() { aganea wrote: As mentionned before, maybe better to rename to `emitSecureHotPatchInformation()` https://github.com/ll

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,242 @@ +//===-- WindowsHotPatch.cpp - Support for Windows hotpatching -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,18 @@ +// This verifies that hotpatch function attributes are correctly propagated through LLVM IR when compiling with LTO. +// +// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-hotpatch-functions-file=%S/ms-hotpatch-functions.txt -flto /Fo%t.bc %s -

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -453,6 +453,37 @@ CodeGenModule::CodeGenModule(ASTContext &C, if (Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86) getModule().addModuleFlag(llvm::Module::Error, "NumRegisterParameters", CodeGenOpts.NumRegisterParameters

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -250,6 +250,7 @@ add_llvm_component_library(LLVMCodeGen VirtRegMap.cpp WasmEHPrepare.cpp WindowScheduler.cpp + WindowsHotPatch.cpp aganea wrote: Similarily, `WindowsSecureHotPatch.cpp`? https://github.com/llvm/llvm-project/pull/138972 __

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -6946,6 +6946,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_fms_hotpatch); + if (Arg *A = Args.getLastArg(options::OPT_fms_hotpatch_functions_file)) { aganea wrote: Idem, extra brace. https:

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-05-13 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/136854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -25,25 +25,23 @@ using namespace ento; using namespace taint; namespace { -class DivZeroChecker :

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-05-13 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @el-ev I merged this because I'm working on another change that's dependent on this. https://github.com/llvm/llvm-project/pull/136854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] 23f6358 - [clang][bytecode][NFC] Delete DynamicAllocator copy/move ctors (#139710)

2025-05-13 Thread via cfe-commits
Author: Timm Baeder Date: 2025-05-13T18:49:17+02:00 New Revision: 23f6358ec30918babde2bbf0966e80e689a9363d URL: https://github.com/llvm/llvm-project/commit/23f6358ec30918babde2bbf0966e80e689a9363d DIFF: https://github.com/llvm/llvm-project/commit/23f6358ec30918babde2bbf0966e80e689a9363d.diff L

[clang] [Clang] Fix Sema::checkArgCount for 0-arg functions (PR #139638)

2025-05-13 Thread Hood Chatham via cfe-commits
hoodmane wrote: Can somebody merge when it's appropriate? I don't have merge rights. https://github.com/llvm/llvm-project/pull/139638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][UserManual] Specify usage of -b flag (PR #139763)

2025-05-13 Thread Madhur Amilkanthwar via cfe-commits
https://github.com/madhur13490 created https://github.com/llvm/llvm-project/pull/139763 llvm-profgen cannot accept the perf profiles collected without `-b` and errors out with a message `"Invalid perf script input!"`. This can also be validated from the code in function `checkPerfScriptType()`

[clang] [clang-tools-extra] [Clang] Add builtins that deduplicate and sort types (PR #106730)

2025-05-13 Thread Matheus Izvekov via cfe-commits
@@ -1666,6 +1685,21 @@ namespace { return inherited::TransformTemplateArgument(Input, Output, Uneval); } +using TreeTransform::TransformTemplateSpecializationType; +QualType +TransformTemplateSpecializationType(TypeLocBuilder &TLB, +

[clang] [Clang][PGO][UserManual] Specify usage of -b flag (PR #139763)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Madhur Amilkanthwar (madhur13490) Changes llvm-profgen cannot accept the perf profiles collected without `-b` and errors out with a message `"Invalid perf script input!"`. This can also be validated from the code in function `checkPerfScr

[clang] [Clang][PGO][UserManual] Specify usage of -b flag (PR #139763)

2025-05-13 Thread Madhur Amilkanthwar via cfe-commits
https://github.com/madhur13490 edited https://github.com/llvm/llvm-project/pull/139763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -25,25 +25,23 @@ using namespace ento; using namespace taint; namespace { -class DivZeroChecker : public Checker> { +class DivZeroChecker : public CheckerFamily> { void reportBug(StringRef Msg, ProgramStateRef StateZero, CheckerContext &C) const; voi

[clang] [OpenMP] Fix crash with invalid size expression (PR #139745)

2025-05-13 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/139745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Add __builtin_type_pack_dedup template to deduplicate types in template arguments (PR #106730)

2025-05-13 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/106730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add PointerLikeType interface support for cir::PointerType (PR #139768)

2025-05-13 Thread Erich Keane via cfe-commits
@@ -0,0 +1,36 @@ +//===--===// +// +// 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] [CIR] Add PointerLikeType interface support for cir::PointerType (PR #139768)

2025-05-13 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/139768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] Fix a crash with spaceship and vector types (PR #139767)

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

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread via cfe-commits
@@ -453,6 +453,37 @@ CodeGenModule::CodeGenModule(ASTContext &C, if (Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86) getModule().addModuleFlag(llvm::Module::Error, "NumRegisterParameters", CodeGenOpts.NumRegisterParameters

[clang] [llvm] [RISCV] Improve casting between i1 scalable vectors and i8 fixed vectors for -mrvv-vector-bits (PR #139190)

2025-05-13 Thread Craig Topper via cfe-commits
https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/139190 >From 86692b0229da44dce5321b00c8409e50de86efaf Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 8 May 2025 15:13:47 -0700 Subject: [PATCH 1/2] [RISCV] Improve casting between i1 scalable vectors and i8 fi

[clang] Avoid emitting a linker options section in the compiler if it is empty. (PR #139821)

2025-05-13 Thread via cfe-commits
https://github.com/dyung created https://github.com/llvm/llvm-project/pull/139821 Recently in some of our internal testing, we noticed that the compiler was sometimes generating an empty linker.options section which seems unnecessary. This proposed change causes the compiler to simply omit emi

[clang] Avoid emitting a linker options section in the compiler if it is empty. (PR #139821)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules @llvm/pr-subscribers-clang-codegen Author: None (dyung) Changes Recently in some of our internal testing, we noticed that the compiler was sometimes generating an empty linker.options section which seems unnecessary. This proposed change

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-13 Thread Helena Kotas via cfe-commits
@@ -3269,27 +3285,42 @@ static bool initVarDeclWithCtor(Sema &S, VarDecl *VD, return true; } -static bool initGlobalResourceDecl(Sema &S, VarDecl *VD) { +bool SemaHLSL::initGlobalResourceDecl(VarDecl *VD) { + std::optional RegisterSlot; + uint32_t SpaceNo = 0; HLSLResou

[clang] Implement src:*=sanitize for UBSan (PR #139772)

2025-05-13 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Reminder to @thurstond as well :) Please figure out https://llvm.org/docs/GitHub.html#stacked-pull-requests https://github.com/llvm/llvm-project/pull/139772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-13 Thread Helena Kotas via cfe-commits
@@ -668,6 +668,26 @@ BuiltinTypeDeclBuilder::addHandleConstructorFromBinding() { .finalize(); } +BuiltinTypeDeclBuilder & +BuiltinTypeDeclBuilder::addHandleConstructorFromImplicitBinding() { + if (Record->isCompleteDefinition()) hekota wrote: If I reca

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-13 Thread Helena Kotas via cfe-commits
@@ -55,11 +55,33 @@ export void foo() { // CHECK-SAME: i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) // CHECK-NEXT: ret void -// Buf2 initialization part 1 - FIXME: constructor with implicit binding does not exist yet; -// the global init function currently

[clang] Implement src:*=sanitize for UBSan (PR #139772)

2025-05-13 Thread Vitaly Buka via cfe-commits
@@ -0,0 +1,23 @@ +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test1.c -o - | FileCheck %s -check-prefix=CHECK-ALLOWLIST +// RUN: %clang_cc1 -trip

[clang] [CIR] Upstream support for FlattenCFG switch and SwitchFlatOp (PR #139154)

2025-05-13 Thread via cfe-commits
Andres-Salamanca wrote: > This is also missing a end-to-end test that proves we generate switchflatop > if we are coming all the way from source code. There are examples in the > incubator on how to check if a pass runs (you can use print-before/after) and > the IR for it. In the incubator, t

[clang] [CIR] Upstream splat op for VectorType (PR #139827)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Amr Hesham (AmrDeveloper) Changes This change adds support for splat op for VectorType Issue https://github.com/llvm/llvm-project/issues/136487 --- Full diff: https://github.com/llvm/llvm-project/pull/139827.diff 7 Files Affected: - (m

[clang] [CIR] Upstream splat op for VectorType (PR #139827)

2025-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Amr Hesham (AmrDeveloper) Changes This change adds support for splat op for VectorType Issue https://github.com/llvm/llvm-project/issues/136487 --- Full diff: https://github.com/llvm/llvm-project/pull/139827.diff 7 Files Affected: -

[clang] [CIR] Upstream splat op for VectorType (PR #139827)

2025-05-13 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/139827 This change adds support for splat op for VectorType Issue https://github.com/llvm/llvm-project/issues/136487 >From e9b7f553f7ad8a9167a9aa4a11c86ccdb8472cdd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Dat

[clang] [CIR] Upstream splat op for VectorType (PR #139827)

2025-05-13 Thread Amr Hesham via cfe-commits
AmrDeveloper wrote: More test cases will be added when Bin and Comp operators are upstreamed for Vector https://github.com/llvm/llvm-project/pull/139827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [Clang] Stop changing DC when instantiating dependent friend specializations (PR #139436)

2025-05-13 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/139436 >From 1756fbcd874097fdea256c2c5986810a011eafed Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 11 May 2025 12:54:12 +0800 Subject: [PATCH 1/3] [Clang] Stop looking for DC from dependent friend specializa

[clang] [llvm] [CMake] Add a linker test for -Bsymbolic-functions to AddLLVM (PR #79539)

2025-05-13 Thread Brad Smith via cfe-commits
@@ -314,6 +308,11 @@ function(add_link_opts target_name) set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-brtl") endif() + + if (NOT MINGW) +llvm_check_linker_flag(CXX "-Wl,-Bsymbolic-functions" +

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-13 Thread Oliver Hunt via cfe-commits
@@ -219,11 +222,10 @@ UnsignedOrNone clang::getStackIndexOfNearestEnclosingCaptureCapableLambda( // Check if the capture-ready lambda can truly capture 'this' by checking // whether all enclosing lambdas of the capture-ready lambda can capture // 'this'. -const

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-13 Thread Oliver Hunt via cfe-commits
@@ -238,7 +240,7 @@ getGenericLambdaTemplateParameterList(LambdaScopeInfo *LSI, Sema &SemaRef) { /*Template kw loc*/ SourceLocation(), /*L angle loc*/ LSI->ExplicitTemplateParamsRange.getBegin(), LSI->TemplateParams, -/*R angle loc*/LSI->Explici

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-13 Thread Oliver Hunt via cfe-commits
@@ -1247,12 +1311,12 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, if (C->Kind == LCK_ByRef && Intro.Default == LCD_ByRef) { Diag(C->Loc, diag::err_reference_capture_with_reference_default) << FixItHint::CreateRemoval( -

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-13 Thread Oliver Hunt via cfe-commits
@@ -1186,15 +1188,28 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, CheckCXXThisCapture(C->Loc, /*Explicit=*/true, /*BuildAndDiagnose*/ true, /*FunctionScopeIndexToStopAtPtr*/ nullptr, C->Ki

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-13 Thread Oliver Hunt via cfe-commits
@@ -1207,12 +1222,61 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, // for e.g., [n{0}] { }; <-- if no is included. // FIXME: we should create the init capture variable and mark it invalid // in this case. - if (C->InitCaptu

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-13 Thread Oliver Hunt via cfe-commits
@@ -597,8 +598,7 @@ static EnumDecl *findEnumForBlockReturn(Expr *E) { // - it is an enumerator whose enum type is T or if (DeclRefExpr *DRE = dyn_cast(E)) { -if (EnumConstantDecl *D - = dyn_cast(DRE->getDecl())) { +if (EnumConstantDecl *D = dyn_cast(DRE-

<    1   2   3   4   5   6   >