[clang] [analyzer] Avoid creating LazyCompoundVal when possible (PR #116840)

2024-11-20 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/116840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-20 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: @ckandeler, perhaps you would be willing to review this patch? I don't seem to have gotten any traction from my usual reviewers over the course of the past year. https://github.com/llvm/llvm-project/pull/77556 ___ cfe-commits ma

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt edited https://github.com/llvm/llvm-project/pull/115902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix constexpr-ness on implicitly deleted destructors (PR #116359)

2024-11-20 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/116359 >From c950170822a58ca98e3f50e95b160c83ec1c63f1 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 15 Nov 2024 21:49:23 +0800 Subject: [PATCH 1/3] [Clang] Fix constexpr-ness on implicitly deleted destr

[clang-tools-extra] [clang-tidy][NFC]remove deps of clang in clang tidy test (PR #116588)

2024-11-20 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-bootstrap-hwasan` running on `sanitizer-buildbot11` while building `clang-tools-extra` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/3680 Her

[clang] [HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (PR #117017)

2024-11-20 Thread Justin Bogner via cfe-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/117017 >From a4e932c29bddb78bd287cabca2e9ea0da6c96337 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 13 Nov 2024 17:04:30 -0800 Subject: [PATCH 1/2] [HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_res

[clang] [ASTMatchers] AST matcher support for ObjC pointers (PR #117021)

2024-11-20 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff def22f4e718daa74c2d0c03a32e32d4913a46278 87ba2a10ca7435fdf6b5c47d2c1c97c1e188cfcd --e

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,17 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +; CHECK-DAG: %[[#bool:]] = OpTypeBool +; CHECK-DAG: %[[#uint:]]

[clang] [ASTMatchers] AST matcher support for ObjC pointers (PR #117021)

2024-11-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Rashmi Mudduluru (t-rasmud) Changes Add `ObjCInterfaceDecl` to the list of types supported by the `hasType` and `hasDeclaration` matchers, `ObjCObjectPointerType` to the list of types supported by `pointee`. --- Full diff: https://github

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/102040 >From e98e6f210f02af0813393d88e1bc4f02c0682e5f Mon Sep 17 00:00:00 2001 From: higher-performance Date: Mon, 5 Aug 2024 15:04:19 -0400 Subject: [PATCH 1/8] Add Clang attribute to ensure that fields are

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread via cfe-commits
@@ -551,3 +551,14 @@ struct full_of_empty empty_test_2(void) { struct full_of_empty e; return e; // no-warning } + +struct with_explicit_field { + int x; + int y [[clang::requires_explicit_initialization]]; // #FIELD_Y +}; + +void aggregate() { + struct with_explicit_fie

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread via cfe-commits
@@ -2302,6 +2302,10 @@ def err_init_list_bad_dest_type : Error< def warn_cxx20_compat_aggregate_init_with_ctors : Warning< "aggregate initialization of type %0 with user-declared constructors " "is incompatible with C++20">, DefaultIgnore, InGroup; +def warn_cxx20_compat_re

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2024-11-20 Thread Ulrich Weigand via cfe-commits
@@ -513,11 +514,26 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM, } // Handle floating-point types. + // Promote all f16 operations to float, with some exceptions below. + for (unsigned Opc = 0; Opc < ISD::BUILTIN_OP_END; ++Opc) +setOperati

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2024-11-20 Thread Ulrich Weigand via cfe-commits
@@ -102,6 +102,7 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM, addRegisterClass(MVT::i32, &SystemZ::GR32BitRegClass); addRegisterClass(MVT::i64, &SystemZ::GR64BitRegClass); if (!useSoftFloat()) { +addRegisterClass(MVT::f16, &SystemZ::FP16

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread via cfe-commits
@@ -1472,3 +1472,105 @@ template struct Outer { }; }; Outer::Inner outerinner; + +void aggregate() { + struct NonAgg { +NonAgg() { } +[[clang::requires_explicit_initialization]] int na; // expected-warning {{'requires_explicit_initialization' attribute is ignored i

[clang] [lldb] [Clang] Improve Sema diagnostic performance for __builtin_counted_by_ref (PR #116719)

2024-11-20 Thread Bill Wendling via cfe-commits
bwendling wrote: > The main thing I’m concerned about here is that I feel like there ought to be > a better way of doing this than checking for and disallowing it in every > place where we can have a subexpression in C. Yeah, but we don't have such a method, partially due to the languages Clan

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread via cfe-commits
@@ -29,6 +29,7 @@ #include "clang/AST/TypeLoc.h" #include "clang/AST/UnresolvedSet.h" #include "clang/Basic/Diagnostic.h" +#include "clang/Basic/DiagnosticSema.h" higher-performance wrote: Are you saying I should move `warn_cxx20_compat_requires_explicit_init

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread via cfe-commits
@@ -2331,6 +2335,9 @@ def err_init_reference_member_uninitialized : Error< "reference member of type %0 uninitialized">; def note_uninit_reference_member : Note< "uninitialized reference member is here">; +def warn_field_requires_explicit_init : Warning< + "field %select{%

[clang] [HLSL] Implement SV_GroupID semantic (PR #115911)

2024-11-20 Thread Chris B via cfe-commits
@@ -784,6 +785,17 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL) { HLSLSV_DispatchThreadIDAttr(getASTContext(), AL)); } +void SemaHLSL::handleSV_GroupIDAttr(Decl *D, const ParsedAttr &AL) { + auto *VD = cast(D); + if (!isLega

[clang] [lldb] [Clang] Improve Sema diagnostic performance for __builtin_counted_by_ref (PR #116719)

2024-11-20 Thread Bill Wendling via cfe-commits
bwendling wrote: > > Could you point to a place in the code where it creates a placeholder? > > I mean, e.g. `CheckPointerToMemberOperands()` can return `BoundMemberTy` as > the type of a `.*` expression, and `CreateBuiltinMatrixSubscriptExpr()` > creates a `MatrixSubscriptExpr` with type `Inc

[clang] [lldb] [Clang] Improve Sema diagnostic performance for __builtin_counted_by_ref (PR #116719)

2024-11-20 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/116719 >From 2dcf18163de2ccce959f46bf82df1fa40e3fd1fc Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 15 Nov 2024 15:41:48 -0800 Subject: [PATCH 1/7] [Clang] Improve Sema diagnostic performance for __builtin

[clang-tools-extra] [clang-tidy] ignore consteval function in `ExceptionAnalyzer` (PR #116643)

2024-11-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM minus comment nits https://github.com/llvm/llvm-project/pull/116643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][UBSan] Make sure that the implicit-conversion group is compatible with minimal runtime (PR #114865)

2024-11-20 Thread Axel Lundberg via cfe-commits
Zonotora wrote: @zygoloid I don't have write access, please merge on my behalf! https://github.com/llvm/llvm-project/pull/114865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread via cfe-commits
@@ -3141,6 +3148,10 @@ def warn_attribute_ignored_no_calls_in_stmt: Warning< "statement">, InGroup; +def warn_attribute_needs_aggregate : Warning< higher-performance wrote: Thanks so much for the review! For `warn_field_requires_explicit_init`, I'm think

[clang-tools-extra] [clang-tidy] ignore consteval function in `ExceptionAnalyzer` (PR #116643)

2024-11-20 Thread Julian Schmidt via cfe-commits
@@ -162,6 +162,10 @@ Changes in existing checks ` check to treat `std::span` as a handle class. +- Improved :doc:`bugprone-exception-escape + ` by fixing false positives + when consteval function with throw statements. 5chmidti wrote: `when encountering

[clang] [lldb] [Clang] Improve Sema diagnostic performance for __builtin_counted_by_ref (PR #116719)

2024-11-20 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/116719 >From 2dcf18163de2ccce959f46bf82df1fa40e3fd1fc Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 15 Nov 2024 15:41:48 -0800 Subject: [PATCH 1/6] [Clang] Improve Sema diagnostic performance for __builtin

[clang-tools-extra] [clang-tidy] ignore consteval function in `ExceptionAnalyzer` (PR #116643)

2024-11-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/116643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [Clang] Improve Sema diagnostic performance for __builtin_counted_by_ref (PR #116719)

2024-11-20 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/116719 >From 2dcf18163de2ccce959f46bf82df1fa40e3fd1fc Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 15 Nov 2024 15:41:48 -0800 Subject: [PATCH 1/5] [Clang] Improve Sema diagnostic performance for __builtin

[clang] [clang] hexagon: fix link order for libc/builtins (PR #117057)

2024-11-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Brian Cain (androm3da) Changes When linking programs with qcld, we get a link error like below: Error: /inst/clang+llvm-19.1.0-cross-hexagon-unknown-linux-musl/x86_64-linux-gnu/bin/../target/hexagon-unknown-linux-musl//usr/lib/libc.a(

[clang] [lldb] [Clang] Improve Sema diagnostic performance for __builtin_counted_by_ref (PR #116719)

2024-11-20 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/116719 >From 2dcf18163de2ccce959f46bf82df1fa40e3fd1fc Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 15 Nov 2024 15:41:48 -0800 Subject: [PATCH 1/4] [Clang] Improve Sema diagnostic performance for __builtin

[clang] [clang][UBSan] Make sure that the implicit-conversion group is compatible with minimal runtime (PR #114865)

2024-11-20 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. https://github.com/llvm/llvm-project/pull/114865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
@@ -2848,7 +2819,7 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, case Intrinsic::spv_wave_active_countbits: return selectWaveActiveCountBits(ResVReg, ResType, I); case Intrinsic::spv_wave_any: -return selectWaveActiveAnyTrue(ResVReg, ResType,

[clang] [Clang] Fix -Wunused-private-field false negative with defaulted comparison operators (PR #116871)

2024-11-20 Thread Chris White via cfe-commits
https://github.com/whiteio updated https://github.com/llvm/llvm-project/pull/116871 >From c69426607d63b3a0cf7d839c82cde55273a5f942 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 19 Nov 2024 20:06:28 + Subject: [PATCH 1/2] [Clang] Fix -Wunused-private-field false negative with defaul

[clang] [ASTMatchers] AST matcher support for ObjC pointers (PR #117021)

2024-11-20 Thread Rashmi Mudduluru via cfe-commits
https://github.com/t-rasmud updated https://github.com/llvm/llvm-project/pull/117021 >From 87ba2a10ca7435fdf6b5c47d2c1c97c1e188cfcd Mon Sep 17 00:00:00 2001 From: Rashmi Mudduluru Date: Tue, 19 Nov 2024 14:50:24 -0800 Subject: [PATCH 1/2] [ASTMatchers] AST matcher support for ObjC pointers Add

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
@@ -2848,7 +2819,7 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, case Intrinsic::spv_wave_active_countbits: return selectWaveActiveCountBits(ResVReg, ResType, I); case Intrinsic::spv_wave_any: -return selectWaveActiveAnyTrue(ResVReg, ResType,

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/115902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Farzon Lotfi via cfe-commits
@@ -2848,7 +2819,7 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, case Intrinsic::spv_wave_active_countbits: return selectWaveActiveCountBits(ResVReg, ResType, I); case Intrinsic::spv_wave_any: -return selectWaveActiveAnyTrue(ResVReg, ResType,

[clang] [Clang/AMDGPU] Zero sized arrays not allowed in HIP device code. (PR #113470)

2024-11-20 Thread Vigneshwar Jayakumar via cfe-commits
https://github.com/VigneshwarJ updated https://github.com/llvm/llvm-project/pull/113470 >From 0e2ee524f5b5c19169e446c55a386a00cfb0f6bc Mon Sep 17 00:00:00 2001 From: vigneshwar jayakumar Date: Wed, 23 Oct 2024 09:20:16 -0500 Subject: [PATCH 1/5] [Clang/AMDGPU] Zero sized arrays not allowed in H

[clang] [Clang] Fix -Wunused-private-field false negative with defaulted comparison operators (PR #116871)

2024-11-20 Thread Chris White via cfe-commits
@@ -7535,7 +7535,7 @@ void Sema::CheckExplicitlyDefaultedFunction(Scope *S, FunctionDecl *FD) { return; } - if (DefKind.isComparison()) + if (DefKind.isComparison() && isa(FD->getDeclContext())) UnusedPrivateFields.clear(); whiteio wrote: Thanks

[clang-tools-extra] [clang-tidy][NFC]remove deps of clang in clang tidy test (PR #116588)

2024-11-20 Thread Florian Mayer via cfe-commits
fmayer wrote: > LLVM Buildbot has detected a new failure on builder > `sanitizer-aarch64-linux-bootstrap-hwasan` running on `sanitizer-buildbot11` > while building `clang-tools-extra` at step 2 "annotate". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/55/builds

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -29,6 +29,7 @@ #include "clang/AST/TypeLoc.h" #include "clang/AST/UnresolvedSet.h" #include "clang/Basic/Diagnostic.h" +#include "clang/Basic/DiagnosticSema.h" AaronBallman wrote: This suggests the diagnostic should be under DiagnosticASTKinds.td instead.

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -1419,6 +1419,42 @@ is not specified. }]; } +def ExplicitInitDocs : Documentation { + let Category = DocCatField; + let Content = [{ +The ``clang::requires_explicit_initialization`` attribute indicates that the +field of an aggregate must be initialized explicitly by us

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -2302,6 +2302,10 @@ def err_init_list_bad_dest_type : Error< def warn_cxx20_compat_aggregate_init_with_ctors : Warning< "aggregate initialization of type %0 with user-declared constructors " "is incompatible with C++20">, DefaultIgnore, InGroup; +def warn_cxx20_compat_re

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -2148,6 +2161,35 @@ void CXXRecordDecl::completeDefinition(CXXFinalOverriderMap *FinalOverriders) { for (conversion_iterator I = conversion_begin(), E = conversion_end(); I != E; ++I) I.setAccess((*I)->getAccess()); + + ASTContext &Context = getASTContext(); +

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -6014,6 +6014,10 @@ static void handleNoMergeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(NoMergeAttr::Create(S.Context, AL)); } +static void handleExplicitInitAttr(Sema &S, Decl *D, const ParsedAttr &AL) { AaronBallman wrote: This can be d

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/115902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add a testcase for riscv64-linux-android triple (PR #116892)

2024-11-20 Thread via cfe-commits
@@ -311,3 +311,19 @@ // CHECK-X86_64-GCC: Found candidate GCC installation: {{.*}}i686-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Found candidate GCC installation: {{.*}}x86_64-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Selected GCC installation: {{.*}}x86_

[clang] [clang] constexpr built-in reduce and function. (PR #116822)

2024-11-20 Thread via cfe-commits
https://github.com/c8ef edited https://github.com/llvm/llvm-project/pull/116822 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix constexpr-ness on implicitly deleted destructors (PR #116359)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -81,6 +81,9 @@ FIELD(IsStandardLayout, 1, NO_MERGE) /// member. FIELD(IsCXX11StandardLayout, 1, NO_MERGE) +/// True when the class has a virtual base class. +FIELD(HasVBases, 1, NO_MERGE) AaronBallman wrote: Do we need to add this here? Doesn't `Definiti

[clang] Draft (PR #116976)

2024-11-20 Thread via cfe-commits
https://github.com/c8ef created https://github.com/llvm/llvm-project/pull/116976 None >From 4d13a8267dd5d0e99063bb088a85406af5266c80 Mon Sep 17 00:00:00 2001 From: c8ef Date: Wed, 20 Nov 2024 22:07:35 +0800 Subject: [PATCH] constexpr reduce or/xor --- clang/docs/ReleaseNotes.rst

[clang] [llvm] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-20 Thread Boaz Brickner via cfe-commits
https://github.com/bricknerb approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/115921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] eliminate shadowing warnings for parameters using deducing this (PR #114813)

2024-11-20 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/114813 >From 91ff2b4226110ea35c78f0f1b6ff89b4bec2c788 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 4 Nov 2024 17:38:46 +0200 Subject: [PATCH 1/4] [Clang] eliminate shadowing warnings for parameters using d

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-20 Thread Boaz Brickner via cfe-commits
@@ -184,14 +184,30 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { const SourceManager &SM = PP.getSourceManager(); const ModuleMap &MM = HS.getModuleMap(); - llvm::DenseSet ModuleMaps; - - llvm::DenseSet ProcessedModules; - auto CollectModuleMa

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-20 Thread Boaz Brickner via cfe-commits
@@ -184,14 +184,30 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { const SourceManager &SM = PP.getSourceManager(); const ModuleMap &MM = HS.getModuleMap(); - llvm::DenseSet ModuleMaps; - - llvm::DenseSet ProcessedModules; - auto CollectModuleMa

[clang] [Clang][NFC] Refactor `Targets.h` to make it publicly accessible (PR #116090)

2024-11-20 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. LGTM. This is a perfectly reasonable change if these APIs are needed by CIR. https://github.com/llvm/llvm-project/pull/116090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [Multilib] Custom flags YAML parsing (PR #110657)

2024-11-20 Thread Victor Campos via cfe-commits
https://github.com/vhscampos edited https://github.com/llvm/llvm-project/pull/110657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Refactor `Targets.h` to make it publicly accessible (PR #116090)

2024-11-20 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/116090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix ToType/FromType diagnostic ordering (PR #116988)

2024-11-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/116988 We need to check the ToType first, then the FromType. Additionally, remove qualifiers from the parent type of the field we're emitting a note for. >From 328b8fc8faf08cf68036f3bdc67bcfeeb5cfd8c5 Mon Sep 17 00:0

[clang] [clang][bytecode] Fix ToType/FromType diagnostic ordering (PR #116988)

2024-11-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes We need to check the ToType first, then the FromType. Additionally, remove qualifiers from the parent type of the field we're emitting a note for. --- Full diff: https://github.com/llvm/llvm-project/pull/116

[clang] [TBAA] Only emit pointer tbaa metedata for record types. (PR #116991)

2024-11-20 Thread Florian Hahn via cfe-commits
https://github.com/fhahn created https://github.com/llvm/llvm-project/pull/116991 Be conservative if the type isn't a record type. Handling other types may require stripping const-qualifiers inside the type, e.g. MemberPointerType. Without this, we assign different tags to the accesses for p an

[clang] [TBAA] Only emit pointer tbaa metedata for record types. (PR #116991)

2024-11-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Florian Hahn (fhahn) Changes Be conservative if the type isn't a record type. Handling other types may require stripping const-qualifiers inside the type, e.g. MemberPointerType. Without this, we assign different tags to the accesses for p

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-20 Thread Timm Baeder via cfe-commits
@@ -362,22 +279,28 @@ bool clang::interp::DoBitCast(InterpState &S, CodePtr OpPC, const Pointer &Ptr, assert(Ptr.isBlockPointer()); assert(Buff); - BitcastBuffer Buffer; + size_t BitSize = BuffSize * 8; + BitcastBuffer Buffer(BitSize); if (!CheckBitcastType(S, OpPC,

[clang] [clang] Fix a crash issue that caused by handling of fields with initializers in nested anonymous unions (PR #113049)

2024-11-20 Thread via cfe-commits
yronglin wrote: Sorry for the very late update, I had some troubles in the past two months. This update check the number of C++11 in-class-initializer in the class and update `CXXRecordDecl::DefinitionData::HasInClassInitializer` when calling `FieldDecl::hasInClassInitializer()`. I think we m

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
@@ -1949,6 +1952,23 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg, return Result; } +bool SPIRVInstructionSelector::selectWaveActiveAnyTrue(Register ResVReg, + const SPIRVType *ResType, +

[clang] Add a testcase for riscv64-linux-android triple (PR #116892)

2024-11-20 Thread via cfe-commits
@@ -14,7 +14,7 @@ // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" -// CHECK: "{{.*}}ld{{(.exe)?}}" "--sysr

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Farzon Lotfi via cfe-commits
@@ -2826,6 +2843,8 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, return selectExtInst(ResVReg, ResType, I, CL::s_clamp, GL::SClamp); case Intrinsic::spv_wave_active_countbits: return selectWaveActiveCountBits(ResVReg, ResType, I); + case Intrin

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Farzon Lotfi via cfe-commits
@@ -1949,24 +1955,48 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg, return Result; } +bool SPIRVInstructionSelector::selectWaveNOpInst(Register ResVReg, + const SPIRVType *ResType, +

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
@@ -1949,6 +1952,23 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg, return Result; } +bool SPIRVInstructionSelector::selectWaveActiveAnyTrue(Register ResVReg, + const SPIRVType *ResType, +

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Farzon Lotfi via cfe-commits
@@ -1949,24 +1955,48 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg, return Result; } +bool SPIRVInstructionSelector::selectWaveNOpInst(Register ResVReg, + const SPIRVType *ResType, +

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
@@ -2826,6 +2843,8 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, return selectExtInst(ResVReg, ResType, I, CL::s_clamp, GL::SClamp); case Intrinsic::spv_wave_active_countbits: return selectWaveActiveCountBits(ResVReg, ResType, I); + case Intrin

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
@@ -86,6 +86,7 @@ let TargetPrefix = "spv" in { def int_spv_dot4add_i8packed : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>; def int_spv_dot4add_u8packed : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i3

[clang] Add a testcase for riscv64-linux-android triple (PR #116892)

2024-11-20 Thread via cfe-commits
@@ -311,3 +311,19 @@ // CHECK-X86_64-GCC: Found candidate GCC installation: {{.*}}i686-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Found candidate GCC installation: {{.*}}x86_64-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Selected GCC installation: {{.*}}x86_

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt updated https://github.com/llvm/llvm-project/pull/115902 >From 845256b2ed971a4e42f7f871e8b51e711486261a Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Mon, 11 Nov 2024 16:34:23 -0700 Subject: [PATCH 01/15] [HLSL] Implement WaveActiveAnyTrue intrinsic --- clang/

[clang] [llvm] [AArch64] Implement intrinsics for F1CVTL/F2CVTL and BF1CVTL/BF2CVTL (PR #116959)

2024-11-20 Thread via cfe-commits
@@ -0,0 +1,48 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2 +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme2,+fp8 -verify-machineinstrs -force-streaming < %s | FileCheck %s + +; F1CVTL / F2CVTL + +define { , } @f1cvtl

[clang] [llvm] [LLVM][NFC] Use `used`'s element type if available (PR #116804)

2024-11-20 Thread Jan Voung via cfe-commits
https://github.com/jvoung approved this pull request. https://github.com/llvm/llvm-project/pull/116804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [X86][MC,LLD][NFC] Rename R_X86_64_REX2_GOTPCRELX (PR #116737)

2024-11-20 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert closed https://github.com/llvm/llvm-project/pull/116737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
@@ -1949,24 +1955,48 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg, return Result; } +bool SPIRVInstructionSelector::selectWaveNOpInst(Register ResVReg, + const SPIRVType *ResType, +

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
@@ -1949,24 +1955,48 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg, return Result; } +bool SPIRVInstructionSelector::selectWaveNOpInst(Register ResVReg, + const SPIRVType *ResType, +

[clang] [HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (PR #117017)

2024-11-20 Thread Justin Bogner via cfe-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/117017 This introduces `__builtin_hlsl_resource_getpointer`, which lowers to `llvm.dx.resource.getpointer` and is used to implement indexing into resources. This will only work through the backend for typed buffers at

[clang] [llvm] [AArch64] Implement intrinsics for F1CVTL/F2CVTL and BF1CVTL/BF2CVTL (PR #116959)

2024-11-20 Thread via cfe-commits
https://github.com/SpencerAbson updated https://github.com/llvm/llvm-project/pull/116959 >From 296492155525985942e1a0fc56b6f0db34e8a7a4 Mon Sep 17 00:00:00 2001 From: Spencer Abson Date: Wed, 20 Nov 2024 10:57:49 + Subject: [PATCH 1/3] [AArch64] Add intrinsics for F1CVTL/F2CVTL and BF1CVTL

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Farzon Lotfi via cfe-commits
@@ -1949,24 +1955,48 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg, return Result; } +bool SPIRVInstructionSelector::selectWaveNOpInst(Register ResVReg, + const SPIRVType *ResType, +

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Finn Plummer via cfe-commits
@@ -2848,7 +2819,7 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, case Intrinsic::spv_wave_active_countbits: return selectWaveActiveCountBits(ResVReg, ResType, I); case Intrinsic::spv_wave_any: -return selectWaveActiveAnyTrue(ResVReg, ResType,

[clang] [llvm] [ARM] Emit an error when the hard-float ABI is enabled but can't be used. (PR #111334)

2024-11-20 Thread Peter Smith via cfe-commits
@@ -16,7 +16,7 @@ // RUN: %clang --target=arm-none-eabi -mcpu=cortex-m33 -mfloat-abi=hard -O1 %s -flto=thin -c -o %t.call_thin.bc -DCALL_LIB // RUN: %clang --target=arm-none-eabi -mcpu=cortex-m33 -mfloat-abi=hard -O1 %s -flto=thin -c -o %t.define_thin.bc -DDEFINE_LIB -// RUN

[clang] [llvm] [ARM] Emit an error when the hard-float ABI is enabled but can't be used. (PR #111334)

2024-11-20 Thread Peter Smith via cfe-commits
https://github.com/smithp35 commented: Apologies for the delay in responding. I don't have much to add over davemgreen and ostannard. Leaving aside whether this should be an error in the front or back-end. As mentioned before I haven't worked in this area for a long time, and there are enough

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -5214,9 +5215,10 @@ unsigned RecordDecl::getODRHash() { // Only calculate hash on first call of getODRHash per record. ODRHash Hash; Hash.AddRecordDecl(this); - // For RecordDecl the ODRHash is stored in the remaining 26 - // bit of RecordDeclBits, adjust the hash to

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt updated https://github.com/llvm/llvm-project/pull/115902 >From 845256b2ed971a4e42f7f871e8b51e711486261a Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Mon, 11 Nov 2024 16:34:23 -0700 Subject: [PATCH 01/18] [HLSL] Implement WaveActiveAnyTrue intrinsic --- clang/

[clang] [llvm] [SystemZ] Add support for __builtin_setjmp and __builtin_longjmp (PR #116642)

2024-11-20 Thread Eli Friedman via cfe-commits
@@ -4619,6 +4619,12 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, // Buffer is a void**. Address Buf = EmitPointerWithAlignment(E->getArg(0)); +if (getTarget().getTriple().getArch() == llvm::Triple::systemz) { + // Call L

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this! The changes should come with a release note in `clang/docs/ReleaseNotes.rst` as well so users know about the new functionality. https://github.com/llvm/llvm-project/pull/102040 ___ cfe-com

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -1472,3 +1472,105 @@ template struct Outer { }; }; Outer::Inner outerinner; + +void aggregate() { + struct NonAgg { +NonAgg() { } +[[clang::requires_explicit_initialization]] int na; // expected-warning {{'requires_explicit_initialization' attribute is ignored i

[clang] [llvm] [HLSL] Implement WaveActiveAnyTrue intrinsic (PR #115902)

2024-11-20 Thread Finn Plummer via cfe-commits
@@ -86,6 +86,7 @@ let TargetPrefix = "spv" in { def int_spv_dot4add_i8packed : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>; def int_spv_dot4add_u8packed : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i3

[clang] Add a testcase for riscv64-linux-android triple (PR #116892)

2024-11-20 Thread Dan Albert via cfe-commits
@@ -311,3 +311,19 @@ // CHECK-X86_64-GCC: Found candidate GCC installation: {{.*}}i686-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Found candidate GCC installation: {{.*}}x86_64-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Selected GCC installation: {{.*}}x86_

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/102040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -2331,6 +2335,9 @@ def err_init_reference_member_uninitialized : Error< "reference member of type %0 uninitialized">; def note_uninit_reference_member : Note< "uninitialized reference member is here">; +def warn_field_requires_explicit_init : Warning< + "field %select{%

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -3141,6 +3148,10 @@ def warn_attribute_ignored_no_calls_in_stmt: Warning< "statement">, InGroup; +def warn_attribute_needs_aggregate : Warning< AaronBallman wrote: Thank you for your patience, sorry it took so long to get to this PR in my queue! I th

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -6919,6 +6923,9 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL, case ParsedAttr::AT_NoMerge: handleNoMergeAttr(S, D, AL); break; + case ParsedAttr::AT_ExplicitInit: +handleExplicitInitAttr(S, D, AL); AaronBallman

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-20 Thread Aaron Ballman via cfe-commits
@@ -,6 +1116,10 @@ void CXXRecordDecl::addedMember(Decl *D) { } else if (!T.isCXX98PODType(Context)) data().PlainOldData = false; +if (Field->hasAttr() && !Field->hasInClassInitializer()) { + setHasUninitializedExplicitInitFields(true); +} -

[clang] [llvm] [LLVM][NFC] Use `used`'s element type if available (PR #116804)

2024-11-20 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/116804 >From 02a607446bf23781255f401d880b67c705cf11fd Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 19 Nov 2024 13:42:54 + Subject: [PATCH 1/3] Use `used`'s element type if it's available. --- llvm/lib/Bit

[clang] [llvm] [LLVM][NFC] Use `used`'s element type if available (PR #116804)

2024-11-20 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/116804 >From 02a607446bf23781255f401d880b67c705cf11fd Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 19 Nov 2024 13:42:54 + Subject: [PATCH 1/3] Use `used`'s element type if it's available. --- llvm/lib/Bit

[clang] [TBAA] Don't emit pointer tbaa for unnamed structs or unions. (PR #116596)

2024-11-20 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/116596 >From 1026043edbc1cb3e31c626ad7a1e621c595917f2 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Sun, 17 Nov 2024 20:07:57 + Subject: [PATCH 1/2] [TBAA] Don't emit pointer tbaa for unnamed structs or unions.

[clang] [TBAA] Don't emit pointer tbaa for unnamed structs or unions. (PR #116596)

2024-11-20 Thread Florian Hahn via cfe-commits
@@ -230,6 +230,15 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { ->getString(); TyName = Name; } else { + // For unnamed structs or unions C's compatible types rule applies. Two + // compatible types in different compilation

<    1   2   3   4   5   6   >