[clang] [Sema] Note member decl when initializer list default constructs member (PR #121854)

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

[clang] 39879e4 - [Sema] Note member decl when initializer list default constructs member (#121854)

2025-02-03 Thread via cfe-commits
Author: Brian Foley Date: 2025-02-03T19:57:37+01:00 New Revision: 39879e4f4022d2845de14810532f633e553fa650 URL: https://github.com/llvm/llvm-project/commit/39879e4f4022d2845de14810532f633e553fa650 DIFF: https://github.com/llvm/llvm-project/commit/39879e4f4022d2845de14810532f633e553fa650.diff L

[clang] [Sema] Note member decl when initializer list default constructs member (PR #121854)

2025-02-03 Thread via cfe-commits
github-actions[bot] wrote: @bpfoley Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build,

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Vlad Serebrennikov via cfe-commits
@@ -1058,8 +1061,10 @@ namespace cwg62 { // cwg62: 2.9 // cxx98-error@-1 {{template argument uses local type }} get(); // cxx98-error@-1 {{template argument uses local type }} +// cxx98-note@-2 {{while substituting explicitly-specified template arguments}}

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Vlad Serebrennikov via cfe-commits
@@ -1386,6 +1386,7 @@ namespace cwg488 { // cwg488: 2.9 c++11 enum E { e }; f(e); // cxx98-error@-1 {{template argument uses local type 'E'}} +// cxx98-note@-2 {{while substituting deduced template arguments}} Endilll wrote: ```suggestion /

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Vlad Serebrennikov via cfe-commits
@@ -1058,8 +1061,10 @@ namespace cwg62 { // cwg62: 2.9 // cxx98-error@-1 {{template argument uses local type }} get(); // cxx98-error@-1 {{template argument uses local type }} +// cxx98-note@-2 {{while substituting explicitly-specified template arguments}}

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/125453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Changes to C++ DR tests look good otherwise. https://github.com/llvm/llvm-project/pull/125453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Wunsafe-buffer-usage] Add additional tests to esnure safe accesses to const sized array are not warned (PR #125483)

2025-02-03 Thread Malavika Samak via cfe-commits
https://github.com/malavikasamak created https://github.com/llvm/llvm-project/pull/125483 Add more tests, where the index of the const array access evaluates to a constant and depends on a template argument. rdar://143759014 >From 12dc35b91a805c75017d58d400082d2a8959ee31 Mon Sep 17 00:00:00 2

[clang] [analyzer][NFC] Add option assume-one-iteration (PR #125494)

2025-02-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 @llvm/pr-subscribers-clang Author: Donát Nagy (NagyDonat) Changes This commit adds the new analyzer option `assume-one-iteration`, which is `false` by default, but can be set to `true` to ensure that the analyzer always assumes

[clang] [analyzer][NFC] Add option assume-one-iteration (PR #125494)

2025-02-03 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/125494 This commit adds the new analyzer option `assume-one-iteration`, which is `false` by default, but can be set to `true` to ensure that the analyzer always assumes (at least) one iteration in loops. In some si

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-03 Thread Aaron Ballman via cfe-commits
@@ -2525,8 +2525,11 @@ void TextNodeDumper::VisitCXXRecordDecl(const CXXRecordDecl *D) { OS << " instantiated_from"; dumpPointer(Instance); } - if (const auto *CTSD = dyn_cast(D)) + if (const auto *CTSD = dyn_cast(D)) { dumpTemplateSpecializationKind(CTSD->get

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 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 cdeeb390a9ea21540fc44ba10dede66fbc0b2fc8 e6648ffc578b6c878ffcab494d6c5f11c775053d --e

[clang] [scan-build-py] use explicit compiler wrapper paths for intercept (PR #123252)

2025-02-03 Thread Aymeric Wibo via cfe-commits
obiwac wrote: Ping https://github.com/llvm/llvm-project/pull/123252 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -21,6 +21,7 @@ #include "clang/AST/Type.h" #include "clang/AST/TypeLoc.h" #include "clang/Basic/Builtins.h" +#include "clang/Basic/DiagnosticParse.h" inbelic wrote: ```suggestion ``` https://github.com/llvm/llvm-project/pull/125319

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -19105,6 +19105,51 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, return nullptr; switch (BuiltinID) { + case Builtin::BI__builtin_hlsl_adduint64: { inbelic wrote: I suppose I know why we weren't able to re-use the `__builtin_ad

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -2214,6 +2227,42 @@ static bool CheckResourceHandle( // returning an ExprError bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { switch (BuiltinID) { + case Builtin::BI__builtin_hlsl_adduint64: { +if (SemaRef.checkArgCount(TheCall, 2))

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -2023,6 +2024,18 @@ static bool CheckAllArgsHaveFloatRepresentation(Sema *S, CallExpr *TheCall) { checkAllFloatTypes); } +static bool CheckUnsignedIntegerRepresentation(Sema *S, CallExpr *TheCall) { + auto checkUnsignedInteger = [](clan

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -19105,6 +19105,51 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, return nullptr; switch (BuiltinID) { + case Builtin::BI__builtin_hlsl_adduint64: { inbelic wrote: Ah, I see that you have it in the commit notes. I still think it

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,46 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +uint2 test_too_few_arg() { + return __builtin_hlsl_adduint64(); + // expected-error@-1 {{too few arguments

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -230,6 +230,14 @@ static StructType *getSplitDoubleType(LLVMContext &Context) { return StructType::create({Int32Ty, Int32Ty}, "dx.types.splitdouble"); } +static StructType *getBinaryWithCarryType(LLVMContext &Context) { inbelic wrote: This is maybe some

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/125319 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -359,18 +359,21 @@ class OpLowerer { return lowerToBindAndAnnotateHandle(F); } - Error replaceSplitDoubleCallUsages(CallInst *Intrin, CallInst *Op) { + Error replaceExtractElementTypeOfCallUsages(CallInst *Intrin, CallInst *Op) { for (Use &U : make_early_inc_ra

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,46 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +uint2 test_too_few_arg() { + return __builtin_hlsl_adduint64(); + // expected-error@-1 {{too few arguments

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
https://github.com/inbelic commented: I would like to see if there is another reviewer has a suggestion of how we could re-use the built-in https://github.com/llvm/llvm-project/pull/125319 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,17 @@ +; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s + +; DXIL operation UAddc only supports i32. Other integer types are unsupported. +; CHECK: in function uaddc_i16 inbelic wrote: nit: I think LLVM E

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

2025-02-03 Thread via cfe-commits
higher-performance wrote: I think we should heavily consider the wider solution space before going with this proposal. The problem we will quickly hit here is that we need to be sure that whatever we want can actually be expressed as a condition in the cases we want. That's not currently the c

[clang] [clang-repl] Fix PLT offset too large linker error on ARM (PR #78959)

2025-02-03 Thread Fangrui Song via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: MaskRay wrote: I just noticed that non-arm architectures have a `HAVE_LINKER_FLAG_LONG_PLT` check. This is an arm ELF specific option in GNU ld (ignored by lld). You could keep the previous architecture == ARM check so that other machines d

[clang] Warn when unique objects might be duplicated in shared libraries (PR #117622)

2025-02-03 Thread Hans Wennborg via cfe-commits
zmodem wrote: Looks like some buildbots are unhappy. I'll back it out for now. https://github.com/llvm/llvm-project/pull/117622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cdeeb39 - Revert "Warn when unique objects might be duplicated in shared libraries (#117622)"

2025-02-03 Thread Hans Wennborg via cfe-commits
Author: Hans Wennborg Date: 2025-02-03T13:56:46+01:00 New Revision: cdeeb390a9ea21540fc44ba10dede66fbc0b2fc8 URL: https://github.com/llvm/llvm-project/commit/cdeeb390a9ea21540fc44ba10dede66fbc0b2fc8 DIFF: https://github.com/llvm/llvm-project/commit/cdeeb390a9ea21540fc44ba10dede66fbc0b2fc8.diff

[clang] [analyzer][NFC] Add option assume-one-iteration (PR #125494)

2025-02-03 Thread Balazs Benics via cfe-commits
steakhal wrote: Overall I had a quick look and nothing sticks out, but the devil is in the details, right? So I plan to allocate some quality time to review this PR this week. Thanks for the PR! https://github.com/llvm/llvm-project/pull/125494 ___ cf

[clang] [Sema] Add code completion for if constexpr (PR #124315)

2025-02-03 Thread via cfe-commits
https://github.com/FantasqueX updated https://github.com/llvm/llvm-project/pull/124315 >From 63ba8cc83e68cf649a4f930e4dc8ce867240406a Mon Sep 17 00:00:00 2001 From: Letu Ren Date: Sat, 25 Jan 2025 01:23:52 +0800 Subject: [PATCH 1/2] [Sema] Add code completion for if constexpr C++17 supports `i

[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #117437)

2025-02-03 Thread Hans Wennborg via cfe-commits
zmodem wrote: We're hitting an assert after this: ``` clang/lib/Analysis/CFG.cpp:822: void (anonymous namespace)::CFGBuilder::appendStmt(CFGBlock *, const Stmt *): Assertion `!isa(S) || cast(S)->IgnoreParens() == S' failed. ``` See https://crbug.com/394015869 for stack trace and reproducer. I

[clang] [compiler-rt] Rtsan fbsd (PR #125389)

2025-02-03 Thread via cfe-commits
davidtrevelyan wrote: @devnexen in principle, I'm of course not opposed to rtsan supporting FreeBSD - is there any motivation in particular for why you propose adding it here? Is this the first of many patches that are needed, or is it the only one that you can foresee? I'd like to make sure t

[clang] [analyzer][NFC] Add option assume-one-iteration (PR #125494)

2025-02-03 Thread Balazs Benics via cfe-commits
@@ -294,6 +294,16 @@ ANALYZER_OPTION( bool, ShouldUnrollLoops, "unroll-loops", "Whether the analysis should try to unroll loops with known bounds.", false) +ANALYZER_OPTION( +bool, ShouldAssumeOneIteration, "assume-one-iteration", +"Whether the analyzer should

[clang] [llvm] Generate `DW_AT_RUST_short_backtrace` attributes for `DISubprogram` nodes (PR #123683)

2025-02-03 Thread via cfe-commits
@@ -605,6 +605,10 @@ HANDLE_DW_AT(0x3b28, BORLAND_Delphi_ABI, 0, BORLAND) HANDLE_DW_AT(0x3b29, BORLAND_Delphi_return, 0, BORLAND) HANDLE_DW_AT(0x3b30, BORLAND_Delphi_frameptr, 0, BORLAND) HANDLE_DW_AT(0x3b31, BORLAND_closure, 0, BORLAND) + +// Rust extensions. +HANDLE_DW_AT(0x3

[clang] 90e0dd1 - Revert "[Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (#117437)"

2025-02-03 Thread Hans Wennborg via cfe-commits
Author: Hans Wennborg Date: 2025-02-03T15:52:04+01:00 New Revision: 90e0dd15ff070b5b4b1bb068cdade7f5b5e6ccec URL: https://github.com/llvm/llvm-project/commit/90e0dd15ff070b5b4b1bb068cdade7f5b5e6ccec DIFF: https://github.com/llvm/llvm-project/commit/90e0dd15ff070b5b4b1bb068cdade7f5b5e6ccec.diff

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I think the 'strict patch match' is valuable in the AST since the paper introduces it as a term of art. I hate our ast-print formats at times, but this is fine to me. https://github.com/llvm/llvm-project/pull/125372 ___

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -2525,8 +2525,11 @@ void TextNodeDumper::VisitCXXRecordDecl(const CXXRecordDecl *D) { OS << " instantiated_from"; dumpPointer(Instance); } - if (const auto *CTSD = dyn_cast(D)) + if (const auto *CTSD = dyn_cast(D)) { dumpTemplateSpecializationKind(CTSD->get

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

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

[libclc] fe694b1 - [libclc] Move mad_sat to CLC; optimize for vector types (#125517)

2025-02-03 Thread via cfe-commits
Author: Fraser Cormack Date: 2025-02-03T17:50:42Z New Revision: fe694b18dc518b86eae9aab85ff03abc54e1662f URL: https://github.com/llvm/llvm-project/commit/fe694b18dc518b86eae9aab85ff03abc54e1662f DIFF: https://github.com/llvm/llvm-project/commit/fe694b18dc518b86eae9aab85ff03abc54e1662f.diff LOG

[clang] [llvm] [HLSL] Create HLSL legalization passes (PR #123811)

2025-02-03 Thread Justin Bogner via cfe-commits
bogner wrote: Sharing the code here makes sense to me, however, this does make the pass run significantly earlier in the DXIL pipeline. That might be fine but we'll have to make sure we aren't creating dead functions in any of the other DXIL backend passes that might have been cleaned up by th

[clang] [HLSL] Make memory representation of boolean vectors in HLSL, vectors of i32. Add support for boolean swizzling. (PR #123977)

2025-02-03 Thread Finn Plummer via cfe-commits
@@ -2016,8 +2016,9 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { case Type::Vector: { const auto *VT = cast(T); TypeInfo EltInfo = getTypeInfo(VT->getElementType()); -Width = VT->isExtVectorBoolType() ? VT->getNumElements() -

[libclc] [libclc] Move mad_sat to CLC; optimize for vector types (PR #125517)

2025-02-03 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/125517 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-03 Thread Oliver Stöneberg via cfe-commits
firewave wrote: Performance looks good. Everything under 5% is acceptable. The top three entries should probably get tickets so they get looked into. The amount seems too much for what it actually provides. https://github.com/llvm/llvm-project/pull/125420 __

[clang] [Clang][Driver][Test] Created test for unsupported driver options (PR #120900)

2025-02-03 Thread via cfe-commits
@@ -0,0 +1,473 @@ +#!/usr/bin/env python3 + +"""generate_unsupported_in_drivermode.py + +This script generates Lit regression test files that validate that options are only exposed to intended driver modes. + +The options and driver modes are parsed from Options.td, whose path sh

[clang] [CIR] Initial implementation of CIR-to-LLVM IR lowering pass (PR #125260)

2025-02-03 Thread Andy Kaylor via cfe-commits
@@ -22,16 +35,164 @@ using namespace llvm; namespace cir { namespace direct { +// This pass requires the CIR to be in a "flat" state. All blocks in each +// function must belong to the parent region. Once scopes and control flow +// are implemented in CIR, a pass will be run b

[clang] [CIR] Initial implementation of CIR-to-LLVM IR lowering pass (PR #125260)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -22,16 +35,164 @@ using namespace llvm; namespace cir { namespace direct { +// This pass requires the CIR to be in a "flat" state. All blocks in each +// function must belong to the parent region. Once scopes and control flow +// are implemented in CIR, a pass will be run b

[clang] Pass -offload-lto instead of -lto for cuda/hip kernels (PR #125243)

2025-02-03 Thread Jakub Chlanda via cfe-commits
@@ -498,12 +498,17 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { }; // Forward all of the `--offload-opt` and similar options to the device. - CmdArgs.push_back("-flto"); for (auto &Arg : Args.filtered(OPT_offload_opt_eq_minus, OPT_mllvm)) CmdArgs

[clang] Pass -offload-lto instead of -lto for cuda/hip kernels (PR #125243)

2025-02-03 Thread Jakub Chlanda via cfe-commits
https://github.com/jchlanda approved this pull request. https://github.com/llvm/llvm-project/pull/125243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Pass -offload-lto instead of -lto for cuda/hip kernels (PR #125243)

2025-02-03 Thread Omar Ahmed via cfe-commits
https://github.com/omarahmed updated https://github.com/llvm/llvm-project/pull/125243 >From f3d466bffc2113b54d62e9a45370c643800b218c Mon Sep 17 00:00:00 2001 From: omarahmed Date: Fri, 31 Jan 2025 15:42:11 + Subject: [PATCH] Pass -offload-lto instead of -lto for cuda/hip kernels --

[clang] Pass -offload-lto instead of -lto for cuda/hip kernels (PR #125243)

2025-02-03 Thread Omar Ahmed via cfe-commits
@@ -498,12 +498,17 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { }; // Forward all of the `--offload-opt` and similar options to the device. - CmdArgs.push_back("-flto"); for (auto &Arg : Args.filtered(OPT_offload_opt_eq_minus, OPT_mllvm)) CmdArgs

[clang] [analyzer][NFC] Add option assume-one-iteration (PR #125494)

2025-02-03 Thread Donát Nagy via cfe-commits
NagyDonat wrote: By the way is the "NFC" tag justified for this "add an off-by-default option" commit? I used this because e.g. if somebody is looking for a bug, they can safely skip this commit -- but OTOH this _does_ add a new feature. https://github.com/llvm/llvm-project/pull/125494 ___

[clang] [clang-format] Hanlde qualified type name for `QualifierAlignment` (PR #125327)

2025-02-03 Thread via cfe-commits
https://github.com/mydeveloperday approved this pull request. Thank you https://github.com/llvm/llvm-project/pull/125327 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] CTAD alias: Respect explicit deduction guides defined after the first use of the alias template. (PR #125478)

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

[clang] Pass -offload-lto instead of -lto for cuda/hip kernels (PR #125243)

2025-02-03 Thread Omar Ahmed via cfe-commits
@@ -498,12 +498,16 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { }; // Forward all of the `--offload-opt` and similar options to the device. - CmdArgs.push_back("-flto"); for (auto &Arg : Args.filtered(OPT_offload_opt_eq_minus, OPT_mllvm)) CmdArgs

[clang] [clang][bytecode] Handle union move assignment operators as well (PR #125516)

2025-02-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/125516 None >From c5932a0673b96eb250aa7740dc54f2985a700359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 3 Feb 2025 16:17:35 +0100 Subject: [PATCH] [clang][bytecode] Handle union move assign

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-03 Thread Yaxun Liu via cfe-commits
@@ -1115,14 +1117,13 @@ def fno_convergent_functions : Flag<["-"], "fno-convergent-functions">, // Common offloading options let Group = offload_Group in { -def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>, yxsamliu wrote: For HI

[clang] db60244 - [PCH, CUDA] Take CUDA attributes into account (#125127)

2025-02-03 Thread via cfe-commits
Author: Artem Belevich Date: 2025-02-03T10:27:11-08:00 New Revision: db60244519023a2b083caa3ed3a27a6b59eb03d8 URL: https://github.com/llvm/llvm-project/commit/db60244519023a2b083caa3ed3a27a6b59eb03d8 DIFF: https://github.com/llvm/llvm-project/commit/db60244519023a2b083caa3ed3a27a6b59eb03d8.diff

[clang] [PCH, CUDA] Take CUDA attributes into account (PR #125127)

2025-02-03 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B closed https://github.com/llvm/llvm-project/pull/125127 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Wunsafe-buffer-usage] Add additional tests to esnure safe accesses to const sized array are not warned (PR #125483)

2025-02-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Malavika Samak (malavikasamak) Changes Add more tests, where the index of the const array access evaluates to a constant and depends on a template argument. rdar://143759014 --- Full diff: https://github.com/llvm/llvm-project/pull/125483

[clang] [llvm] [MC/DC] Nested decision (PR #125403)

2025-02-03 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/125403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Optimize -Wunsafe-buffer-usage. (PR #124554)

2025-02-03 Thread Ivana Ivanovska via cfe-commits
https://github.com/ivanaivanovska closed https://github.com/llvm/llvm-project/pull/124554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Warn when unique objects might be duplicated in shared libraries (PR #117622)

2025-02-03 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-win` running on `sie-win-worker` while building `clang` at step 7 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/46/builds/11501 Here is th

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -1909,7 +1909,19 @@ class Sema final : public SemaBase { /// '\#pragma clang attribute push' directives to the given declaration. void AddPragmaAttributes(Scope *S, Decl *D); - void PrintPragmaAttributeInstantiationPoint(); + using DiagFuncRef = + llvm::function_

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

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

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -1909,7 +1909,19 @@ class Sema final : public SemaBase { /// '\#pragma clang attribute push' directives to the given declaration. void AddPragmaAttributes(Scope *S, Decl *D); - void PrintPragmaAttributeInstantiationPoint(); + using DiagFuncRef = + llvm::function_

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Share some of Corentin's concerns, else just a few comments. https://github.com/llvm/llvm-project/pull/125453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [llvm] [analyzer] Consolidate array bound checkers (PR #125534)

2025-02-03 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/125534 Before this commit, there were two alpha checkers that used different algorithms/logic for detecting out of bounds memory access: the old `alpha.security.ArrayBound` and the experimental, more complex `alpha

[clang] [llvm] [analyzer] Consolidate array bound checkers (PR #125534)

2025-02-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-static-analyzer-1 Author: Donát Nagy (NagyDonat) Changes Before this commit, there were two alpha checkers that used different algorithms/logic for detecting out of bounds memory access: the old `alpha.security.ArrayBou

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-03 Thread Balazs Benics via cfe-commits
steakhal wrote: > > Could you please run this with `--enable-check-profile` to see how heavy it > > is? > > I plan to re-run it on clang soon, and share the results. I've picked a heavy TU of clang for the test: `clang/lib/Sema/SemaExpr.cpp` ``` ===

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-03 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/125420 >From 78390b2af01fcd5acfbd2a313852962c873e5611 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 2 Feb 2025 17:35:39 +0100 Subject: [PATCH 1/8] [clang-tidy] Add performance-redundant-lookup check Finds r

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-03 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within steakhal wrote: Fixed in d9d3984a056192b8ef61f38

[clang] [CIR] Initial implementation of CIR-to-LLVM IR lowering pass (PR #125260)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -22,16 +35,164 @@ using namespace llvm; namespace cir { namespace direct { +// This pass requires the CIR to be in a "flat" state. All blocks in each +// function must belong to the parent region. Once scopes and control flow +// are implemented in CIR, a pass will be run b

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-03 Thread via cfe-commits
@@ -91,6 +91,12 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`performance-redundant-lookup + ` check. + + This check warns about potential redundant container lookup operations within EugeneZelenko wrote: `This check` should be omitted.

[clang] [Clang] Optimize -Wunsafe-buffer-usage. (PR #125492)

2025-02-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ivana Ivanovska (ivanaivanovska) Changes The Clang disgnostic `-Wunsafe-buffer-usage` was adding up to +15% compilation time when used. Profiling showed that most of the overhead comes from the use of ASTMatchers. This change replaces th

[clang] [clang] CTAD alias: Respecte explicit deduction guides defined after the first use of the alias template. (PR #125478)

2025-02-03 Thread Haojian Wu via cfe-commits
@@ -740,6 +740,24 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +// Returns all source deduction guides associated with the declared +// deduction guides that have the specified deduction guide name. +llvm::DenseSet getSourceDed

[clang] [clang] CTAD alias: Respecte explicit deduction guides defined after the first use of the alias template. (PR #125478)

2025-02-03 Thread Haojian Wu via cfe-commits
@@ -1191,13 +1209,10 @@ void DeclareImplicitDeductionGuidesForTypeAlias( if (AliasTemplate->isInvalidDecl()) return; auto &Context = SemaRef.Context; - // FIXME: if there is an explicit deduction guide after the first use of the - // type alias usage, we will not cove

[clang] [clang] CTAD alias: Respect explicit deduction guides defined after the first use of the alias template. (PR #125478)

2025-02-03 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/125478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Optimize -Wunsafe-buffer-usage. (PR #125492)

2025-02-03 Thread Ivana Ivanovska via cfe-commits
https://github.com/ivanaivanovska ready_for_review https://github.com/llvm/llvm-project/pull/125492 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] CTAD alias: Respecte explicit deduction guides defined after the first use of the alias template. (PR #125478)

2025-02-03 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/125478 >From 62328c6ab0c9965712aea1d484fca4afa1294acd Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 3 Feb 2025 11:55:17 +0100 Subject: [PATCH 1/2] [clang] CTAD alias: Respecte explicit deduction guides defined a

[clang] d5684b8 - Warn when unique objects might be duplicated in shared libraries (#117622)

2025-02-03 Thread via cfe-commits
Author: Devon Loehr Date: 2025-02-03T13:20:52+01:00 New Revision: d5684b8402d2175e80a2792db58e9a8e960a8544 URL: https://github.com/llvm/llvm-project/commit/d5684b8402d2175e80a2792db58e9a8e960a8544 DIFF: https://github.com/llvm/llvm-project/commit/d5684b8402d2175e80a2792db58e9a8e960a8544.diff L

[clang] Warn when unique objects might be duplicated in shared libraries (PR #117622)

2025-02-03 Thread via cfe-commits
github-actions[bot] wrote: @DKLoehr Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build,

[clang] Warn when unique objects might be duplicated in shared libraries (PR #117622)

2025-02-03 Thread Hans Wennborg via cfe-commits
https://github.com/zmodem closed https://github.com/llvm/llvm-project/pull/117622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Optimize -Wunsafe-buffer-usage. (PR #125492)

2025-02-03 Thread Ivana Ivanovska via cfe-commits
https://github.com/ivanaivanovska created https://github.com/llvm/llvm-project/pull/125492 None >From 54c7b3c1fb149b82c26927d0fd831d8786f70ac3 Mon Sep 17 00:00:00 2001 From: Ivana Ivanovska Date: Mon, 2 Dec 2024 14:17:06 + Subject: [PATCH] Optimize -Wunsafe-buffer-usage. --- clang/lib/An

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

2025-02-03 Thread Yaxun Liu via cfe-commits
@@ -1106,8 +1106,12 @@ bool AMDGPUToolChain::shouldSkipSanitizeOption( // For simplicity, we only allow -fsanitize=address SanitizerMask K = parseSanitizerValue(A->getValue(), /*AllowGroups=*/false); - if (K != SanitizerKind::Address) + if (K != SanitizerKind::Address) {

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

2025-02-03 Thread Joseph Huber via cfe-commits
@@ -71,10 +71,10 @@ llvm::opt::DerivedArgList *AMDGPUOpenMPToolChain::TranslateArgs( const OptTable &Opts = getDriver().getOpts(); - for (Arg *A : Args) { -if (!llvm::is_contained(*DAL, A)) + for (Arg *A : Args) +if (!shouldSkipSanitizeOption(*this, Args, BoundAr

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

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

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-03 Thread Oleksandr T. via cfe-commits
@@ -1596,12 +1596,14 @@ QualType Sema::BuildQualifiedType(QualType T, SourceLocation Loc, QualType ProblemTy; if (T->isAnyPointerType() || T->isReferenceType() || -T->isMemberPointerType()) { +T->isMemberPointerType() || T->isArrayType()) { Qual

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-03 Thread Oleksandr T. via cfe-commits
@@ -9,20 +9,20 @@ typedef int (*T)[2]; restrict T x; typedef int *S[2]; -restrict S y; // expected-error {{restrict requires a pointer or reference ('S' (aka 'int *[2]') is invalid)}} - - +restrict S y; a-tarasyuk wrote: @AaronBallman thanks for the feedback

[clang] [PGO] Add a clang option -fprofile-continuous that enables PGO continuous mode (PR #124353)

2025-02-03 Thread Wael Yehia via cfe-commits
w2yehia wrote: I believe all comments have been addressed. friendly ping. @petrhosek any feedback please? https://github.com/llvm/llvm-project/pull/124353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun edited https://github.com/llvm/llvm-project/pull/125508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun commented: I haven't finished reviewing yet but some nits inline. https://github.com/llvm/llvm-project/pull/125508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 Thread Gábor Horváth via cfe-commits
@@ -287,6 +288,35 @@ class PathDiagnosticBuilder : public BugReporterContext { const PathSensitiveBugReport *getBugReport() const { return R; } }; +std::string timeTraceName(const BugReportEquivClass &EQ) { + if (!llvm::timeTraceProfilerEnabled()) { Xazax-h

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 Thread Gábor Horváth via cfe-commits
@@ -49,6 +49,127 @@ LLVM_DUMP_METHOD void ProgramPoint::dump() const { return printJson(llvm::errs()); } +const char *ProgramPoint::kindToStr(Kind K) { Xazax-hun wrote: Should this return a `StringRef` instead? https://github.com/llvm/llvm-project/pull/125

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 Thread Gábor Horváth via cfe-commits
@@ -49,6 +49,127 @@ LLVM_DUMP_METHOD void ProgramPoint::dump() const { return printJson(llvm::errs()); } +const char *ProgramPoint::kindToStr(Kind K) { + switch (K) { + case BlockEdgeKind: +return "BlockEdge"; + case BlockEntranceKind: +return "BlockEntrance"; +

[clang] [Sema] Note member decl when initializer list default constructs member (PR #121854)

2025-02-03 Thread Brian Foley via cfe-commits
bpfoley wrote: Could you please merge this for me? I don't have merge permissions. https://github.com/llvm/llvm-project/pull/121854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 Thread Gábor Horváth via cfe-commits
@@ -49,6 +49,127 @@ LLVM_DUMP_METHOD void ProgramPoint::dump() const { return printJson(llvm::errs()); } +const char *ProgramPoint::kindToStr(Kind K) { + switch (K) { + case BlockEdgeKind: +return "BlockEdge"; + case BlockEntranceKind: +return "BlockEntrance"; +

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 Thread Gábor Horváth via cfe-commits
@@ -49,6 +49,127 @@ LLVM_DUMP_METHOD void ProgramPoint::dump() const { return printJson(llvm::errs()); } +const char *ProgramPoint::kindToStr(Kind K) { Xazax-hun wrote: Based on the similar methods in `Decl` and `Stmt` the naming convention should be somet

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 Thread Gábor Horváth via cfe-commits
@@ -0,0 +1,38 @@ += +Performance Investigation += + +Multiple factors contribute to the time it takes to analyze a file with Clang Static Analyzer. +A translation unit contains multiple entry points, each of which take multiple ste

<    1   2   3   4   5   >