[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-03 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,173 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +namespace clang { +namespace hlsl { + +// Lexer Definitions + +static bool IsNumberChar(char C) { + // TODO(#120472): extend for float support exponents + return isdigit(C); // integer support +} + +bool RootS

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-03 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,134 @@ +//=== ParseHLSLRootSignatureTest.cpp - Parse Root Signature tests -===// +// +// 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] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-03 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,173 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +namespace clang { +namespace hlsl { + +// Lexer Definitions + +static bool IsNumberChar(char C) { + // TODO(#120472): extend for float support exponents + return isdigit(C); // integer support +} + +bool RootS

[clang] [llvm] [X86] Extend kCFI with a 3-bit arity indicator (PR #121070)

2025-02-03 Thread Sami Tolvanen via cfe-commits
https://github.com/samitolvanen approved this pull request. Thank you for adding the command line flag. I agree that this should be sufficient to address compatibility concerns. https://github.com/llvm/llvm-project/pull/121070 ___ cfe-commits mailing

[clang] [Clang] Remove unnecessary Decl transform & profiles for SizeOfPackExpr (PR #124533)

2025-02-03 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Thank you for the explanation, that makes more sense to me. https://github.com/llvm/llvm-project/pull/124533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-03 Thread Artem Belevich via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_amdgcn -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s Artem-B wrote: >

[clang] [Clang][counted_by] Don't treat a __bdos argument as an array if it isn't (PR #125298)

2025-02-03 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Sorry I didn't get around to re-reviewing #122198 earlier... it looks like this is the with lvalue-to-rvalue conversions I mentioned on the review. You do not want to look through lvalue-to-rvalue conversions; the StructFieldAccess visitor should bail out if it sees one.

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-02-03 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/125320 >From f6b91ae8062ce1b8d1b6bb39b631a6971c06612b Mon Sep 17 00:00:00 2001 From: "Daniel Paoliello (HE/HIM)" Date: Fri, 31 Jan 2025 16:47:23 -0800 Subject: [PATCH] [aarch64][x86][win] Add support for MSVC's /fun

[clang] CodeGen: support static linking for libclosure (PR #125384)

2025-02-03 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd updated https://github.com/llvm/llvm-project/pull/125384 >From 33f361fda5b27964037c061d7944c01d3891d914 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 1 Feb 2025 15:04:04 -0800 Subject: [PATCH] CodeGen: support static linking for libclosure When buildi

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

2025-02-03 Thread Sarah Spall 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() -

[clang] [Hexagon][Docs] document the change in the default target (PR #125584)

2025-02-03 Thread Ikhlas Ajbar via cfe-commits
https://github.com/iajbar created https://github.com/llvm/llvm-project/pull/125584 None >From 59b76081f1c15c38f2b58ffce062dadce12d5811 Mon Sep 17 00:00:00 2001 From: Ikhlas Ajbar Date: Mon, 3 Feb 2025 12:47:22 -0800 Subject: [PATCH] [Hexagon][Docs] document the change in the default target --

[clang] [Hexagon][Docs] document the change in the default target (PR #125584)

2025-02-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ikhlas Ajbar (iajbar) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/125584.diff 1 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+5) ``diff diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/

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

2025-02-03 Thread Balazs Benics via cfe-commits
steakhal 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. Yea, my idea was to give a bit of context of how it compares to the resr of the

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-02-03 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from the missing release note. https://github.com/llvm/llvm-project/pull/105789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

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

2025-02-03 Thread Artem Belevich via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_amdgcn -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s Artem-B wrote: M

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

2025-02-03 Thread Artem Belevich via cfe-commits
@@ -1697,19 +1721,17 @@ llvm::opt::DerivedArgList *ToolChain::TranslateXarchArgs( } else if (A->getOption().matches(options::OPT_Xarch_host)) { NeedTrans = !IsDevice; Skip = IsDevice; -} else if (A->getOption().matches(options::OPT_Xarch__) && IsDevice) { -

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

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

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

2025-02-03 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B commented: LGTM overall, with a few nits. https://github.com/llvm/llvm-project/pull/125421 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-03 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_amdgcn -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s jhuber6 wrote: W

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

2025-02-03 Thread Joseph Huber 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]>, jhuber6 wrote: Overloa

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

2025-02-03 Thread Brooks Davis via cfe-commits
brooksdavis wrote: rtsan seems like something we'd want on FreeBSD. If this is all that's required it seems like a no-brainer. https://github.com/llvm/llvm-project/pull/125389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

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

2025-02-03 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_amdgcn -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s jhuber6 wrote: I

[clang] [Clang] Introduce '--offload-targets=' to generically target toolchains (PR #125556)

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

[clang] [Clang][counted_by] Don't treat a __bdos argument as an array if it isn't (PR #125298)

2025-02-03 Thread Bill Wendling via cfe-commits
bwendling wrote: @efriedma-quic Thanks, I'll send a patch. https://github.com/llvm/llvm-project/pull/125298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-03 Thread Shilei Tian 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]>, shiltian wrote: then @

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-02-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/115099 >From e5f485ad8000c296229794346fdd627b90e504d2 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 5 Nov 2024 16:05:53 -0800 Subject: [PATCH 1/7] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-03 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125630)

2025-02-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Litera

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125630)

2025-02-03 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/125630 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Literal migration

[clang] [libclang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125631)

2025-02-03 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/125631 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Literal migration

[clang] [libclang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125631)

2025-02-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Litera

[clang] Remove some false negatives in StackAddrEscapeChecker (PR #125638)

2025-02-03 Thread Michael Flanders via cfe-commits
https://github.com/Flandini created https://github.com/llvm/llvm-project/pull/125638 Fixes https://github.com/llvm/llvm-project/issues/123459. Previously, when the StackAddrEscapeChecker checked return values, it did not scan into the structure of the return SVal. Now it does, and we can catch

[clang] [analyzer] Remove some false negatives in StackAddrEscapeChecker (PR #125638)

2025-02-03 Thread Michael Flanders via cfe-commits
https://github.com/Flandini edited https://github.com/llvm/llvm-project/pull/125638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-03 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/125327 >From af3d964d74634f0dd9f7216572c1d852b7a549dc Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 31 Jan 2025 18:32:33 -0800 Subject: [PATCH 1/3] [clang-format] Hanlde qualified type names Fixes #125178. --- cl

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

2025-02-03 Thread Owen Pan via cfe-commits
@@ -412,6 +414,15 @@ const FormatToken *LeftRightQualifierAlignmentFixer::analyzeLeft( // The case `const long long volatile int` -> `const volatile long long int` // The case `long volatile long int const` -> `const volatile long long int` if (TypeToken->isTypeName(Lang

[clang] [clang] Force AttributedStmtClass to not be scope parents (PR #125370)

2025-02-03 Thread David Blaikie via cfe-commits
dwblaikie wrote: Could you add a test case - check in clang/test to see if other tests for the diagnostic text in the original bug, and add a test case for that nearby (maybe the same file the diagnostic is already tested in)? https://github.com/llvm/llvm-project/pull/125370 __

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

2025-02-03 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/125520 This WIP PR explores the idea of introducing `[[clang::lifetimebound_if()]]`, a built-in attribute that conditionally applies `[[clang::lifetimebound]]` based on the given boolean expression. One of the key

[clang] [analyzer] Do not destruct fields of unions (PR #122330)

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

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

2025-02-03 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,119 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define __CLC_CONVERT_TY(X, TY) __builtin_convertvector(X, TY) + +// Macro for defining mad_sat variants for char/uchar/short/ushort +// FIXME: Once using __clc_

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

2025-02-03 Thread Chris Apple via cfe-commits
cjappl 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] [clang] handle fp options in __builtin_convertvector (PR #125522)

2025-02-03 Thread Jakub Ficek via cfe-commits
https://github.com/ficol created https://github.com/llvm/llvm-project/pull/125522 None >From fc40a0fddd830aa1fdfaafa1618acc5c2d0ee5fa Mon Sep 17 00:00:00 2001 From: "Ficek, Jakub" Date: Mon, 3 Feb 2025 16:45:17 +0100 Subject: [PATCH] [clang] handle fp options in __builtin_convertvector --- c

[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)

2025-02-03 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

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

2025-02-03 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > My preference would be to not have NFC tags for off by default features. OK, I removed the [NFC] tag from the PR title and adjusted the description accordingly. https://github.com/llvm/llvm-project/pull/125494 ___ cfe-commits maili

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

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

[clang] [analyzer] 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] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-03 Thread Oliver Stöneberg via cfe-commits
firewave wrote: Does this also work when CSA is called through clang-tidy? The analyzer profiling data in missing in the `--enable-check-profile` output - see #73673? https://github.com/llvm/llvm-project/pull/125508 ___ cfe-commits mailing list cfe-co

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-03 Thread via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

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

2025-02-03 Thread Devon Loehr via cfe-commits
DKLoehr wrote: Thanks @zmodem for merging (and also reverting). Follow-up PR with the fix is #125526. https://github.com/llvm/llvm-project/pull/117622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

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

2025-02-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Devon Loehr (DKLoehr) Changes This is attempt 2 to merge this, the first one is #117622. This properly disables the tests when building for playstation, since the warning is disabled there. When a hidden object is built into multiple sha

[clang] [llvm] [Hexagon] Set the default compilation target to V68 (PR #125239)

2025-02-03 Thread Brian Cain via cfe-commits
androm3da wrote: > Done. Thanks Brian. Are you sure the release notes change has landed? I don't see a commit on `main` with it yet. https://github.com/llvm/llvm-project/blob/main/llvm/docs/ReleaseNotes.md#changes-to-the-hexagon-backend Is there a pull req open for this change? https://gith

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

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

[clang] [llvm] [Hexagon] Set the default compilation target to V68 (PR #125239)

2025-02-03 Thread Brian Cain via cfe-commits
androm3da wrote: > > Done. Thanks Brian. > > Are you sure the release notes change has landed? I don't see a commit on > `main` with it yet. > > https://github.com/llvm/llvm-project/blob/main/llvm/docs/ReleaseNotes.md#changes-to-the-hexagon-backend > > Is there a pull req open for this change

[clang] [analyzer] Do not destruct fields of unions (PR #122330)

2025-02-03 Thread Jameson Nash via cfe-commits
https://github.com/vtjnash updated https://github.com/llvm/llvm-project/pull/122330 >From 829e1c89ce869f782cb802a1d618003770c0d074 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 9 Jan 2025 17:10:08 + Subject: [PATCH 1/3] [Sema] do not destruct fields of unions The C++ standard proh

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-03 Thread Aaron Ballman via cfe-commits
@@ -50,8 +50,8 @@ struct testRecoverStrictnessStruct { }; #pragma clang attribute pop -#pragma clang attribute push (__attribute__((abi_tag("a"))), apply_to = any(function, record(unless(is_union)), variable, enum)) -// expected-error@-1 {{attribute 'abi_tag' cannot be appli

[clang] [analyzer] Do not destruct fields of unions (PR #122330)

2025-02-03 Thread Jameson Nash via cfe-commits
@@ -377,3 +377,27 @@ void directUnknownSymbol() { } } + +void testUnionDtor() { + static int unionDtorCalled; + InlineDtor::cnt = 0; + InlineDtor::dtorCalled = 0; + unionDtorCalled = 0; + { + union UnionDtor { + InlineDtor kind1; + char kind2; +

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

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 b8734797a3f605c4aaa37fcb5007baa273565460 8052b1553eb05767db6f080d6ee4bbd515994f93 --e

[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)

2025-02-03 Thread Jakub Ficek via cfe-commits
https://github.com/ficol ready_for_review https://github.com/llvm/llvm-project/pull/125522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][counted_by] Don't treat a __bdos argument as an array if it isn't (PR #125298)

2025-02-03 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/125298 >From df6b80c82f1a9ce4f1eef580f008c86fd691ba71 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 31 Jan 2025 12:48:36 -0800 Subject: [PATCH 1/4] [Clang][counted_by] Don't treat a pointer as an array If

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

2025-02-03 Thread Sarah Spall 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() -

[clang] [Clang][counted_by] Don't treat a __bdos argument as an array if it isn't (PR #125298)

2025-02-03 Thread Bill Wendling via cfe-commits
@@ -0,0 +1,85 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -triple aarch64-unknown-linux-gnu -DCOUNTED_BY -O2 -Wall -Wno-int-conversion -fsanitize=array-bounds,object-size,local-bounds -fstrict-flex-

[clang] [C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

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

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -1096,6 +1100,177 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +/// Atomic control options +class AtomicOptionsOverride; +class AtomicOptions { +public: + using storage_type = uint16_t; + + static constexpr unsign

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -1096,6 +1100,177 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +/// Atomic control options +class AtomicOptionsOverride; +class AtomicOptions { +public: + using storage_type = uint16_t; + + static constexpr unsign

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -5958,6 +5968,58 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, RenderFloatingPointOptions(TC, D, OFastEnabled, Args, CmdArgs, JA); + if (Arg *AtomicArg = Args.getLastArg(options::OPT_fatomic_EQ)) { erichkeane wrote: IMO, we need a s

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -764,6 +764,73 @@ void Parser::ParseGNUAttributeArgs( ScopeLoc, Form); } +void Parser::ParseAtomicAttribute( erichkeane wrote: I'm very much beginning to dislike the syntax for this, if it needs this much special handling. We s

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -0,0 +1,19 @@ +//===--- AtomicOptions.def - Atomic Options database -*- C++ -*-===// +// +// 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] [HLSL] Make memory representation of boolean vectors in HLSL, vectors of i32. Add support for boolean swizzling. (PR #123977)

2025-02-03 Thread Eli Friedman via cfe-commits
@@ -1984,6 +1984,15 @@ llvm::Constant *ConstantEmitter::emitForMemory(CodeGenModule &CGM, return Res; } + // In HLSL bool vectors are stored in memory as a vector of i32 + if (destType->isExtVectorBoolType() && CGM.getContext().getLangOpts().HLSL) { +llvm::Type *b

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

2025-02-03 Thread Eli Friedman 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() -

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

2025-02-03 Thread Artem Belevich via cfe-commits
Artem-B wrote: > Summary: Currently, `-Xarch_` is used to forward argument specially to > certain toolchains. Currently, this is only supported by the Darwin > toolchain. We want to be able to use this generically, and for offloading > too. This patch moves the handling out of the Darwin Toolc

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-03 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/124920 >From bd731e4be65fc9c1746aa6a8f63d206eb54bb2be Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Wed, 29 Jan 2025 15:17:06 +0200 Subject: [PATCH 1/9] [Clang] disallow attributes on void parameters --- clang/

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

2025-02-03 Thread Joseph Huber 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]>, jhuber6 wrote: I don't

[clang] 070c338 - Fix "not all control paths return a value" warning; NFC

2025-02-03 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2025-02-03T15:15:33-05:00 New Revision: 070c3386618f1edffefe6519dc2741bba7938ae9 URL: https://github.com/llvm/llvm-project/commit/070c3386618f1edffefe6519dc2741bba7938ae9 DIFF: https://github.com/llvm/llvm-project/commit/070c3386618f1edffefe6519dc2741bba7938ae9.diff

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-03 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/124920 >From bd731e4be65fc9c1746aa6a8f63d206eb54bb2be Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Wed, 29 Jan 2025 15:17:06 +0200 Subject: [PATCH 1/9] [Clang] disallow attributes on void parameters --- clang/

[clang] [compiler-rt] [profile] Add `%b` `LLVM_PROFILE_FILE` option for binary ID (PR #123963)

2025-02-03 Thread David Li via cfe-commits
@@ -855,6 +856,15 @@ static int parseFilenamePattern(const char *FilenamePat, FilenamePat); return -1; } + } else if (FilenamePat[I] == 'b') { +if (!NumBinaryIds++) { + if (__llvm_write_binary_ids(NULL) <= 0) { ---

[clang] [compiler-rt] [profile] Add `%b` `LLVM_PROFILE_FILE` option for binary ID (PR #123963)

2025-02-03 Thread David Li via cfe-commits
@@ -0,0 +1,37 @@ +// REQUIRES: linux +// RUN: split-file %s %t.dir +// RUN: %clang_profgen -Wl,--build-id=sha1 -o %t.dir/foo %t.dir/foo.c +// RUN: %clang_profgen -Wl,--build-id=sha1 -o %t.dir/bar %t.dir/bar.c + +// Check that foo and bar have the same signatures. +// RUN: rm -rf %

[clang] [Clang][counted-by] Bail out of visitor for LValueToRValue cast (PR #125571)

2025-02-03 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/125571 >From f5086e8af7b370aae43bee98493ded9c9f7aa9b2 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 3 Feb 2025 12:15:07 -0800 Subject: [PATCH 1/2] [Clang][counted-by] Bail out of visitor for LValueToRValue

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

2025-02-03 Thread Matheus Izvekov 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] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

2025-02-03 Thread Deric Cheung via cfe-commits
@@ -19105,6 +19105,51 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, return nullptr; switch (BuiltinID) { + case Builtin::BI__builtin_hlsl_adduint64: { Icohedron wrote: `__builtin_addc` was not able to be used to implement `AddUint

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

2025-02-03 Thread Matheus Izvekov 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] [compiler-rt] [Sanitizers] the access size (8 bytes) exceeds the max lock-free size (4 bytes) for 32-bit (PR #125388)

2025-02-03 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. for compiler-rt/lib/sanitizer_common/CMakeLists.txt https://github.com/llvm/llvm-project/pull/125388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

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

2025-02-03 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125453 >From ff34c10553ed645fc8277cb72247f6cb67a024e6 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 2 Feb 2025 23:47:15 -0300 Subject: [PATCH] [clang] print correct context for diagnostics suppressed by d

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2025-02-03 Thread Chandler Carruth via cfe-commits
chandlerc wrote: Thanks @rnk ! I've fixed the one style nit (doh!) and a few surrounding variables. I'm working on rebasing everything now. But one specific question: would you prefer me to land as a series of commits or a single squashed commit for the entire PR? I'm happy either way. My mil

[clang] [llvm] [llvm] Create() functions for ConvergenceControlInst (PR #125627)

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 6303563b40f9d7896f0d44380f397560143da26b 5d6d4fbbfabf5e33ec366ea113a0e6c93ba46bf4 --e

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2025-02-03 Thread Chandler Carruth via cfe-commits
@@ -482,17 +488,42 @@ void clang::EmitClangBuiltins(const RecordKeeper &Records, raw_ostream &OS) { for (const auto *BuiltinRecord : Records.getAllDerivedDefinitions("AtomicBuiltin")) collectBuiltins(BuiltinRecord, Builtins); - unsigned NumAtomicBuiltins = Buil

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

2025-02-03 Thread Devon Loehr via cfe-commits
https://github.com/DKLoehr updated https://github.com/llvm/llvm-project/pull/125526 >From 486c3297f1a316a103c6583daf732af2d00d0b96 Mon Sep 17 00:00:00 2001 From: Devon Loehr Date: Thu, 21 Nov 2024 19:29:00 + Subject: [PATCH 1/6] Warn when unique objects might be duplicated in shared librar

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

2025-02-03 Thread Artem Belevich via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_amdgcn -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s Artem-B wrote: C

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

2025-02-03 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_amdgcn -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s jhuber6 wrote: W

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

2025-02-03 Thread Artem Belevich via cfe-commits
@@ -1697,19 +1721,17 @@ llvm::opt::DerivedArgList *ToolChain::TranslateXarchArgs( } else if (A->getOption().matches(options::OPT_Xarch_host)) { NeedTrans = !IsDevice; Skip = IsDevice; -} else if (A->getOption().matches(options::OPT_Xarch__) && IsDevice) { -

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

2025-02-03 Thread Shilei Tian 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]>, shiltian wrote: If tha

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-03 Thread Arthur Eubanks via cfe-commits
https://github.com/aeubanks updated https://github.com/llvm/llvm-project/pull/124834 >From 7c40169ec7430ec64aaeb053e423eca1ceff7f0d Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Tue, 28 Jan 2025 20:36:58 + Subject: [PATCH 1/5] [clang][X86] Support __attribute__((model("small"/"large"

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-03 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: I've allowed the attribute for NVPTX targets and ignored it in SemaDeclAttr rather than figure out how to conditionally emit a warning during codegen, does that work? https://github.com/llvm/llvm-project/pull/124834 ___ cfe-commits ma

[clang] [Clang] Introduce '--offload-targets=' to genericall target toolchains (PR #125556)

2025-02-03 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Contains two dependent commits, last one is the patch. Might need to have some additional error handling to reject known broken architectures, also need to correctly handle things like `--offload-targets=spirv64-amd-amdhsa,amdgcn-amd-amdhsa` in the new driver. https://github.co

[clang] [CUDA] Increment VTable index for device thunks (PR #124989)

2025-02-03 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > _ No description provided. _ Pls add a commit message about the issue this PR is addressing and a summary of what it does. https://github.com/llvm/llvm-project/pull/124989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [CUDA] Increment VTable index for device thunks (PR #124989)

2025-02-03 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -target-cpu gfx942 \ +// RUN: -emit-llvm -xhip %s -o - | FileCheck %s --check-prefix=GCN +// RUN: %clang_cc1 -fcuda-is-device -triple spirv64-amd-amdhsa \ +// RUN: -emit-llvm -xhip %s -o - | FileC

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

2025-02-03 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Thank you for tackling this longstanding issue! How much does saving this > extra state add to the runtime and memory usage on a template-heavy > compilation? I tried building stdexec, the difference is within the noise. Do you have any other examples of template-heavy code i

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

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

[clang] ee92122 - [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (#115099)

2025-02-03 Thread via cfe-commits
Author: Reid Kleckner Date: 2025-02-03T14:05:58-08:00 New Revision: ee92122b53c7af26bb766e89e1d30ceb2fd5bb93 URL: https://github.com/llvm/llvm-project/commit/ee92122b53c7af26bb766e89e1d30ceb2fd5bb93 DIFF: https://github.com/llvm/llvm-project/commit/ee92122b53c7af26bb766e89e1d30ceb2fd5bb93.diff

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

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

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-02-03 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-fuzzer` running on `sanitizer-buildbot12` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/159/builds/15333 Here is the relevant pi

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-02-03 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-x86_64-debian` running on `lldb-x86_64-debian` while building `clang` at step 4 "build". Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/15504 Here is the relevant piece of the build l

  1   2   3   4   5   >