[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-06 Thread Eli Friedman via cfe-commits
@@ -14585,11 +14585,18 @@ void Sema::CheckAddressOfPackedMember(Expr *rhs) { _2, _3, _4)); } +static ExprResult UsualUnaryConversionsNoPromoteInt(Sema &S, Expr *E) { + // Don't promote integer types + if (QualType Ty = E->getType(); S.getASTContext().is

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Vitaly Buka via cfe-commits
@@ -1463,17 +1504,18 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, } SanitizerMask parseArgValues(const Driver &D, const llvm::opt::Arg *A, vitalybuka wrote: Instead of extending this function, it would be cleaner to cre

[clang] 90b04bf - [NFC] fix up typos (#121842)

2025-01-06 Thread via cfe-commits
Author: Farzon Lotfi Date: 2025-01-06T19:57:30-05:00 New Revision: 90b04bf84ec3315f803a2ba846e3086ba5e3 URL: https://github.com/llvm/llvm-project/commit/90b04bf84ec3315f803a2ba846e3086ba5e3 DIFF: https://github.com/llvm/llvm-project/commit/90b04bf84ec3315f803a2ba846e3086ba5e3.diff

[clang] [llvm] [NFC] fix up typos (PR #121842)

2025-01-06 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl closed https://github.com/llvm/llvm-project/pull/121842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Adding Flatten and Branch if attributes (PR #116331)

2025-01-06 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/116331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Move length support out of the DirectX Backend (PR #121611)

2025-01-06 Thread Farzon Lotfi via cfe-commits
@@ -1297,27 +1297,16 @@ float4 lerp(float4, float4, float4); /// /// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + ...). -_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) -_HLSL_BUILTIN_ALIAS(__builtin_hlsl_length) -half length(half); -_HLSL_16BIT_AVAILABILITY(sha

[clang] [AArch64][SME] Add diagnostics to CheckConstexprFunctionDefinition (PR #121777)

2025-01-06 Thread via cfe-commits
@@ -1854,6 +1855,9 @@ bool Sema::CheckConstexprFunctionDefinition(const FunctionDecl *NewFD, } } + if (Context.getTargetInfo().getTriple().isAArch64()) +ARM().CheckSMEFunctionDefAttributes(NewFD); + cor3ntin wrote: This seems like a weird place to

[clang] [llvm] [Driver][SYCL] Add initial SYCL offload compilation support (PR #117268)

2025-01-06 Thread Paul Kirth via cfe-commits
ilovepi wrote: We're seeing SYCL tests fail on Linux builders after this patch https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-host-linux-x64/b8726474372098645345/overview ``` Exit Code: 1 Command Output (stderr): -- RUN: at line 1: /b/s/w/ir/x/w/llvm_build/bin/clang -### -fsy

[clang] [llvm] [HLSL] Move length support out of the DirectX Backend (PR #121611)

2025-01-06 Thread Farzon Lotfi via cfe-commits
@@ -1,73 +1,151 @@ -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -

[clang] [OpenMP] codegen support for masked combined construct parallel masked taskloop simd. (PR #121746)

2025-01-06 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Please update OpenMPSupport.rst https://github.com/llvm/llvm-project/pull/121746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-06 Thread via cfe-commits
https://github.com/leijurv updated https://github.com/llvm/llvm-project/pull/118046 >From 1caf823165b16f6701993d586df51d5cdbf0885e Mon Sep 17 00:00:00 2001 From: Leijurv Date: Fri, 29 Nov 2024 21:54:36 -0600 Subject: [PATCH 1/4] [clang-format] Add BreakBeforeTemplateClose option --- clang/doc

[clang] [SystemZ][z/OS] Add z/OS customization file (PR #111182)

2025-01-06 Thread Sean Perry via cfe-commits
https://github.com/perry-ca updated https://github.com/llvm/llvm-project/pull/82 >From 360bab981d8ec36e17aa4fbadbb4feef42c5d135 Mon Sep 17 00:00:00 2001 From: Sean Perry Date: Fri, 4 Oct 2024 10:09:32 -0500 Subject: [PATCH 1/2] Add z/OS customization file --- clang/include/clang/Driver/Dr

[clang] [llvm] [HLSL] Move length support out of the DirectX Backend (PR #121611)

2025-01-06 Thread Greg Roth via cfe-commits
pow2clk wrote: Will this go in with no description? https://github.com/llvm/llvm-project/pull/121611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Move length support out of the DirectX Backend (PR #121611)

2025-01-06 Thread Farzon Lotfi via cfe-commits
@@ -1,32 +1,53 @@ -// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -disable-llvm-passes -verify -verify-ignore-unexpected - +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-h

[clang] [OpenMP] codegen support for masked combined construct parallel masked taskloop (PR #121741)

2025-01-06 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Update OpenMPSupport.rst https://github.com/llvm/llvm-project/pull/121741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement parsing of `RootFlags` (PR #121799)

2025-01-06 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,88 @@ +//===- HLSLRootSignature.h - HLSL Root Signature helper objects ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-06 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson requested changes to this pull request. Code needs formatting and missing tests. https://github.com/llvm/llvm-project/pull/121800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-06 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/98756 From 7d65b133b5f04e078b3b26cee2b4be0fe78d01e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Mon, 6 Jan 2025 21:06:10 +0100 Subject: [PATCH] [clang] implement P3309 atomic builtin

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
@@ -3615,9 +3616,12 @@ void CodeGenFunction::EmitCheck( if (!CGM.getCodeGenOpts().SanitizeMergeHandlers.has(Checked[i].second)) NoMerge = true; + +if (!CGM.getCodeGenOpts().NoSanitizeTopHot.has(Checked[i].second)) + SanitizeGuardChecks = true; } - if (

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Vitaly Buka via cfe-commits
@@ -3602,6 +3602,7 @@ void CodeGenFunction::EmitCheck( llvm::Value *RecoverableCond = nullptr; llvm::Value *TrapCond = nullptr; bool NoMerge = false; + bool SanitizeGuardChecks = ClSanitizeGuardChecks; vitalybuka wrote: Usually we parse Cls as `if (ClSa

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Vitaly Buka via cfe-commits
@@ -3615,9 +3616,12 @@ void CodeGenFunction::EmitCheck( vitalybuka wrote: maybe we can keep the patch Driver only, because we need: passing fractions array into LLVM passes: ubsan and hwasan https://github.com/llvm/llvm-project/pull/121619 ___

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -0,0 +1,563 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown -target-feature +fullbf16 -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK ---

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
https://github.com/jcranmer-intel commented: I haven't fully reviewed this, but here's some comments to start with: https://github.com/llvm/llvm-project/pull/78503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -470,8 +470,16 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI, if (LangOpts.CPlusPlus26) // FIXME: Use correct value for C++26. Builder.defineMacro("__cplusplus", "202400L"); -else if (LangOpts.CPlusPlus23) +else if (LangOpts.

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -132,6 +133,70 @@ template <> struct llvm::DenseMapInfo { return LHS == RHS; } }; +constexpr unsigned CXX23FloatRankToIndex(clang::BuiltinType::Kind Kind) { + switch (Kind) { + case clang::BuiltinType::Float16: +return 0; + case clang::BuiltinType::BFloat16: +

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -132,6 +133,70 @@ template <> struct llvm::DenseMapInfo { return LHS == RHS; } }; +constexpr unsigned CXX23FloatRankToIndex(clang::BuiltinType::Kind Kind) { + switch (Kind) { + case clang::BuiltinType::Float16: +return 0; + case clang::BuiltinType::BFloat16: +

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
https://github.com/jcranmer-intel edited https://github.com/llvm/llvm-project/pull/78503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -7670,27 +7739,68 @@ static FloatingRank getFloatingRank(QualType T) { } } +/// C++23 6.8.5 [conv.rank] /// getFloatingTypeOrder - Compare the rank of the two specified floating /// point types, ignoring the domain of the type (i.e. 'double' == -/// '_Complex double').

[clang-tools-extra] Add bugprone-sprintf-argument-overlap (PR #114244)

2025-01-06 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Sorry for the late review, but isn't this already covered by `-Wall` with GCC? At least the example from the check documentation: https://godbolt.org/z/es37ozqe9 ``` warning: 'sprintf' argument 3 overlaps destination object 'buf' ``` If this check is not redundant given t

[clang] [HLSL] Fix build warning after #116331 (PR #121852)

2025-01-06 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/121852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][NFC] Rework Timer.cpp globals to ensure valid lifetimes (PR #121663)

2025-01-06 Thread via cfe-commits
https://github.com/macurtis-amd updated https://github.com/llvm/llvm-project/pull/121663 >From 4500df21b2085dfb84228d399126eb65281297da Mon Sep 17 00:00:00 2001 From: Matthew Curtis Date: Sat, 4 Jan 2025 13:38:57 -0600 Subject: [PATCH 1/2] [llvm][NFC] Rework Timer.cpp globals to ensure valid l

[clang] [HLSL] Fix build warning after #116331 (PR #121852)

2025-01-06 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/121852 After #116331 is always SpellingNotCalculated, so I assume doing nothing is expected. >From d5cedbc7b822671f5ac45e1f4d49ed91c13858e3 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 6 Jan 2025 14:48:15

[clang] [HLSL] Fix build warning after #116331 (PR #121852)

2025-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Vitaly Buka (vitalybuka) Changes After #116331 is always SpellingNotCalculated, so I assume doing nothing is expected. --- Full diff: https://github.com/llvm/llvm-project/pull/121852.diff 1 Files Affec

[clang] [llvm] [HLSL][RootSignature] Implement parsing of `RootFlags` (PR #121799)

2025-01-06 Thread Finn Plummer via cfe-commits
inbelic wrote: I didn't implement the tokenizer because I found that the extra level of abstraction to be redundant/not beneficial with the StringRef operations. Looking at the DXC implementation, the usage of the Tokenizer is either GetAndMatchToken, or, getToken for an identifier with a swi

[clang] [HLSL] Fix build warning after #116331 (PR #121852)

2025-01-06 Thread via cfe-commits
https://github.com/joaosaffran approved this pull request. LGTM. Thanks for fixing this https://github.com/llvm/llvm-project/pull/121852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][NFC] Rework Timer.cpp globals to ensure valid lifetimes (PR #121663)

2025-01-06 Thread via cfe-commits
@@ -38,63 +38,40 @@ using namespace llvm; -// This ugly hack is brought to you courtesy of constructor/destructor ordering -// being unspecified by C++. Basically the problem is that a Statistic object -// gets destroyed, which ends up calling 'GetLibSupportInfoOutputFile()'

[clang] [llvm] [llvm][NFC] Rework Timer.cpp globals to ensure valid lifetimes (PR #121663)

2025-01-06 Thread via cfe-commits
@@ -284,18 +250,22 @@ NamedRegionTimer::NamedRegionTimer(StringRef Name, StringRef Description, /// ctor/dtor and is protected by the TimerLock lock. static TimerGroup *TimerGroupList = nullptr; -TimerGroup::TimerGroup(StringRef Name, StringRef Description) - : Name(Name.beg

[clang] 1a435fe - [HLSL] Fix build warning after #116331 (#121852)

2025-01-06 Thread via cfe-commits
Author: Vitaly Buka Date: 2025-01-06T14:50:57-08:00 New Revision: 1a435feffcd85c1e7fe30daf1a3995e95860b300 URL: https://github.com/llvm/llvm-project/commit/1a435feffcd85c1e7fe30daf1a3995e95860b300 DIFF: https://github.com/llvm/llvm-project/commit/1a435feffcd85c1e7fe30daf1a3995e95860b300.diff L

[clang] [llvm] [llvm][NFC] Rework Timer.cpp globals to ensure valid lifetimes (PR #121663)

2025-01-06 Thread via cfe-commits
macurtis-amd wrote: > Thanks for working on this. > > I have a couple of questions about inconsistent casing. Other than that, this > looks reasonable to me. But I don't have a great deal of experience with this > part of LLVM, so please wait for other reviewers. @tarunprabhu Thanks for takin

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-06 Thread Chris B via cfe-commits
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - if (Args.hasArg(options::OPT_forder_file_instrumentation)) { - CmdArgs.push_back("-forder-file-instrumentation"); - // Enable order file instrumentation when ThinLTO is

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Tristan Ross via cfe-commits
@@ -1531,7 +1531,7 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { // Check if the environment version is valid except wasm case. llvm::Triple Triple = TC.getTriple(); - if (!Triple.isWasm()) { + if (!Triple.isWasm() && Triple.getEnvironment() != llvm::Tripl

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + std::pair getBranchCounterPair(const Stmt *S, + Counter ParentCnt) { +Counter ExecCnt = getRegionCounter(S); +

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2025-01-06 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @efriedma-quic no idea, I would just rebase and hope that's it https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { ornata wrote: A doxygen comment here might be useful. https://github.com/llvm/llvm-project/pull/112702

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { +Counter Executed; ornata wrote: Comments on member variables? E.g. ``` /// Counter tracking number of times the b

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { ornata wrote: IIUC the point of this pair is given: ``` if (x) { // ... do something } else if (y) { // ... somethin

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Fangrui Song via cfe-commits
MaskRay wrote: NAK. While llvm libc can be used an overlay, it is not complete for standalone Linux server/desktop usage. Introducing a target triple has large ecosystem implication and should not be taken lightly. https://github.com/llvm/llvm-project/pull/121123 _

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/121123 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { +Counter Executed; +Counter Skipped; + }; + + BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) { +Co

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { +Counter Executed; +Counter Skipped; + }; + + BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) { ---

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Tristan Ross via cfe-commits
RossComputerGuy wrote: Why close? LLVM libc is maturing and one of the goals I had was to try using it in Nixpkgs to build whatever I can. LLVM libc doesn't work well in an overlay mode so we have to use full builds. It's true that a lot of functions are still missing or not implemented but by

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -1592,6 +1605,13 @@ struct CounterCoverageMappingBuilder llvm::EnableSingleByteCoverage ? getRegionCounter(S->getCond()) : addCounters(ParentCount, BackedgeCount, BC.ContinueCount); +auto [ExecCount, ExitCount] = +(llvm::EnableSing

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Joseph Huber via cfe-commits
jhuber6 wrote: You can compile and run static C applications, I'm not sure what the threshold is before we can start adding support to make it usable in `clang`. https://github.com/llvm/llvm-project/pull/121123 ___ cfe-commits mailing list cfe-commits

[libunwind] [libunwind][cmake] Compile _Unwind* routines with -fexceptions (PR #121819)

2025-01-06 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. The second paragraph can mention `_Unwind_Resume` explicitly. https://github.com/llvm/llvm-project/pull/121819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang-tools-extra] Add bugprone-sprintf-argument-overlap (PR #114244)

2025-01-06 Thread Chris Cotter via cfe-commits
ccotter wrote: Oh, you are entirely right. I completely missed that gcc had this check. All of my test cases are covered by gcc's check, and gcc's check is a bit smarter than mine (`sprintf(stp->buf, "%s", st1.buf)` is caught by gcc, but not my check). Is this still worth adding here? I didn't

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Carlo Cabrera via cfe-commits
carlocab wrote: > Introducing a target triple has large ecosystem implication and should not be > taken lightly. To be fair this patch doesn't introduce a target triple, it only makes it more easily usable in Clang. That said, I tend to agree with the review at https://github.com/llvm/llvm-

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2025-01-06 Thread Younan Zhang via cfe-commits
@@ -174,6 +174,26 @@ static_assert(!__is_layout_compatible(StructWithAnonUnion, StructWithAnonUnion3) #endif } // namespace cwg2759 +#if __cplusplus >= 202002L +namespace cwg2770 { // cwg2770: 20 zyn0217 wrote: Yes, I implemented what that issue proposed. I

[clang] [analyzer] Retry UNDEF Z3 queries at most "crosscheck-with-z3-retries-on-timeout" times (PR #120239)

2025-01-06 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/120239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Retry UNDEF Z3 queries at most "crosscheck-with-z3-retries-on-timeout" times (PR #120239)

2025-01-06 Thread Donát Nagy via cfe-commits
@@ -77,16 +80,32 @@ void Z3CrosscheckVisitor::finalizeVisitor(BugReporterContext &BRC, RefutationSolver->addConstraint(SMTConstraints); } - // And check for satisfiability - llvm::TimeRecord Start = llvm::TimeRecord::getCurrentTime(/*Start=*/true); - std::optional Is

[clang] [analyzer] Retry UNDEF Z3 queries at most "crosscheck-with-z3-retries-on-timeout" times (PR #120239)

2025-01-06 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I'm really grateful that you implemented my request about defining this option as a positive value; especially considering that it ended up being more work than what I expected. (I guessed that we must already had precedent(s) for positive (or at least o

[clang-tools-extra] Add bugprone-sprintf-argument-overlap (PR #114244)

2025-01-06 Thread Chris Cotter via cfe-commits
https://github.com/ccotter edited https://github.com/llvm/llvm-project/pull/114244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add bugprone-undefined-sprintf-overlap (PR #114244)

2025-01-06 Thread Chris Cotter via cfe-commits
ccotter wrote: Ok, all comments should be addressed. The check now uses `areStatementsIdentical` to more generically find buggy patterns (thanks for that suggestion!). https://github.com/llvm/llvm-project/pull/114244 ___ cfe-commits mailing list cfe-

[clang-tools-extra] Add bugprone-sprintf-argument-overlap (PR #114244)

2025-01-06 Thread Chris Cotter via cfe-commits
https://github.com/ccotter updated https://github.com/llvm/llvm-project/pull/114244 >From fd914cc82688b122654d2d7ada72007541b197c0 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 30 Oct 2024 10:54:49 -0400 Subject: [PATCH 01/21] Add bugprone-sprintf-overlap --- .../bugprone/BugproneTid

[clang] [analyzer] Retry UNDEF Z3 queries at most "crosscheck-with-z3-retries-on-timeout" times (PR #120239)

2025-01-06 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM, thanks for the updates! If the updated test passes, feel free to merge it. https://github.com/llvm/llvm-project/pull/120239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [analyzer] Retry UNDEF Z3 queries at most "crosscheck-with-z3-retries-on-timeout" times (PR #120239)

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

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
@@ -174,6 +174,26 @@ static_assert(!__is_layout_compatible(StructWithAnonUnion, StructWithAnonUnion3) #endif } // namespace cwg2759 +#if __cplusplus >= 202002L +namespace cwg2770 { // cwg2770: 20 Endilll wrote: > Yes, I implemented what that issue proposed.

[clang] [analyzer] Retry UNDEF Z3 queries 2 times by default (PR #120239)

2025-01-06 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/120239 >From f7041f5f6f0127f335bedf081f648e769007a827 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Tue, 17 Dec 2024 15:35:27 +0100 Subject: [PATCH 1/6] [analyzer] Retry UNDEF Z3 queries at most "crosscheck-with

[clang] [analyzer] Retry UNDEF Z3 queries 2 times by default (PR #120239)

2025-01-06 Thread Balazs Benics via cfe-commits
@@ -213,6 +215,15 @@ ANALYZER_OPTION( "400'000 should on average make Z3 queries run for up to 100ms on modern " "hardware. Set 0 for unlimited.", 0) +ANALYZER_OPTION( +unsigned, Z3CrosscheckRetriesOnTimeout, +"crosscheck-with-z3-retries-on-timeout", +"Set

[clang] [analyzer] Retry UNDEF Z3 queries 2 times by default (PR #120239)

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

[clang] [analyzer] Retry UNDEF Z3 queries 2 times by default (PR #120239)

2025-01-06 Thread Balazs Benics via cfe-commits
steakhal wrote: > LGTM, thanks for the updates! > > If the updated test passes, feel free to merge it. The uploaded tests never run in the CI due to the `REQUIRES: Z3`. I double checked locally and everything passes. Thanks for the review. https://github.com/llvm/llvm-project/pull/120239 ___

[clang] [clang][CodeGen][SPIRV] Translate `amdgpu_flat_work_group_size` into `reqd_work_group_size`. (PR #116820)

2025-01-06 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/116820 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-06 Thread via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -1235,15 +1235,24 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL, << NewConstrainedParm->getTypeSourceInfo() ->getTypeLoc() .getSourceRange(); +NewConstrainedParm->setP

[clang] [analyzer] Retry UNDEF Z3 queries at most "crosscheck-with-z3-retries-on-timeout" times (PR #120239)

2025-01-06 Thread Balazs Benics via cfe-commits
@@ -77,16 +80,32 @@ void Z3CrosscheckVisitor::finalizeVisitor(BugReporterContext &BRC, RefutationSolver->addConstraint(SMTConstraints); } - // And check for satisfiability - llvm::TimeRecord Start = llvm::TimeRecord::getCurrentTime(/*Start=*/true); - std::optional Is

[clang] [analyzer] Retry UNDEF Z3 queries 2 times by default (PR #120239)

2025-01-06 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. https://github.com/llvm/llvm-project/pull/120239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Retry UNDEF Z3 queries 2 times by default (PR #120239)

2025-01-06 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/120239 >From f7041f5f6f0127f335bedf081f648e769007a827 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Tue, 17 Dec 2024 15:35:27 +0100 Subject: [PATCH 1/7] [analyzer] Retry UNDEF Z3 queries at most "crosscheck-with

[clang] [NFC] [analyzer] Factor out SymbolManager::get<*> (PR #121781)

2025-01-06 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto created https://github.com/llvm/llvm-project/pull/121781 Replace the family of `SymbolManager::get*Symbol(...)` member functions with a single generic `SymbolManager::get<*>` member function. >From 08b838adf275f1e0eaf2ab3e3d4b2b6d89bf4ed6 Mon Sep 17 00:00:00 2001 From:

[clang] [llvm] [SPIRV] Add Target Builtins using Distance ext as an example (PR #121598)

2025-01-06 Thread Farzon Lotfi via cfe-commits
@@ -20440,6 +20442,26 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, } } +Value *CodeGenFunction::EmitSPIRVBuiltinExpr(unsigned BuiltinID, + const CallExpr *E) { + switch (BuiltinID) { + case SPIRV::BI__bui

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -1389,6 +1389,68 @@ Query for this attribute with ``__has_attribute(overloadable)``. }]; } +def OwnershipDocs : Documentation { + let Heading = "ownership_holds, ownership_returns, ownership_takes (Clang " +

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: steakhal wrote: You have a build error: https://github.com/llvm/llvm-project/actions/runs/12634515572/job/35202412861#step:10:773 https://github.com/llvm/llvm-project/pull/121759 ___ cfe-commits mai

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-06 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/119423 >From 3f007d702922db63e128e3c0f72dff2f600e0879 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 10 Dec 2024 17:41:07 + Subject: [PATCH 1/5] [clang] Fix sub-integer __builtin_elementwise_(add|sub

[clang] [NFC] [analyzer] Factor out SymbolManager::get<*> (PR #121781)

2025-01-06 Thread Arseniy Zaostrovnykh via cfe-commits
necto wrote: @NagyDonat Here is the refactoring you suggested in https://github.com/llvm/llvm-project/pull/121551 I made sure `check-clang-analysis` passes after each commit, so I think reviewing it by commit should be easier than all at once. https://github.com/llvm/llvm-project/pull/121781

[clang] [NFC] [analyzer] Factor out SymbolManager::get<*> (PR #121781)

2025-01-06 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 9ce8f4b70b31b031ac9b4818a268bfc8c67a7a8e 824649120ac51ac75ad22a7276f7380f801e6db6 --e

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -1389,6 +1389,68 @@ Query for this attribute with ``__has_attribute(overloadable)``. }]; } +def OwnershipDocs : Documentation { + let Heading = "ownership_holds, ownership_returns, ownership_takes (Clang " +

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-06 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > Would be good to also update the documentation for the builtins the clarify > the behavior. I've added some words to that effect. Is that what you had in mind? https://github.com/llvm/llvm-project/pull/119423 ___ cfe-commits mail

[clang-tools-extra] [clang-tidy] fix false positives when using name-independent variables after C++26 for bugprone-unused-local-non-trivial-variable (PR #121783)

2025-01-06 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/121783 Fixed: #121731 According to https://eel.is/c++draft/basic.scope.scope#5, name independent declaration should not be warned as unused >From b8cd88ce9174476da90cbf1a2407976b99114a9f Mon Sep 17 00:00:00 2001

[clang-tools-extra] [clang-tidy] fix false positives when using name-independent variables after C++26 for bugprone-unused-local-non-trivial-variable (PR #121783)

2025-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Congcong Cai (HerrCai0907) Changes Fixed: #121731 According to https://eel.is/c++draft/basic.scope.scope#5, name independent declaration should not be warned as unused --- Full diff: https://github.com/llvm/llvm-project/pull/121783.

[clang] [clang] Lower non-builtin sincos[f|l] calls to llvm.sincos.* when -fno-math-errno is set (PR #121763)

2025-01-06 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/121763 >From 2cadacae4359f8d67bdff850738441fba455a8bc Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 6 Jan 2025 11:49:48 + Subject: [PATCH 1/2] [clang] Lower non-builtin sincos[f|l] calls to llvm.sincos

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -1407,8 +1407,17 @@ These attributes are used by the Clang Static Analyzer's dynamic memory modeling facilities to mark custom allocating/deallocating functions. A

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/121759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Balazs Benics via cfe-commits
=?utf-8?q?Krist=C3=B3f?= Umann , =?utf-8?q?Krist=C3=B3f?= Umann , =?utf-8?q?Krist=C3=B3f?= Umann Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. Looks truly awesome https://github.com/llvm/llvm-project/pull/121759 __

[clang] [llvm] [Driver][SYCL] Add initial SYCL offload compilation support (PR #117268)

2025-01-06 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux` running on `sanitizer-buildbot7` while building `clang,llvm` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/51/builds/8566 Here is the relevant piece o

[clang] [llvm] [Arm] Regenerate tests (NFC) (PR #121801)

2025-01-06 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 7cb6e6bced8ca5767c3e609f4826982638fd9543...67ba481f809abdc85a90fed5ff11ca48c6578e3e llvm/

[clang] 55391f8 - [analyzer] Retry UNDEF Z3 queries 2 times by default (#120239)

2025-01-06 Thread via cfe-commits
Author: Balazs Benics Date: 2025-01-06T18:08:12+01:00 New Revision: 55391f85acc7e7a14ea2ef3c1a4bd8f3df990426 URL: https://github.com/llvm/llvm-project/commit/55391f85acc7e7a14ea2ef3c1a4bd8f3df990426 DIFF: https://github.com/llvm/llvm-project/commit/55391f85acc7e7a14ea2ef3c1a4bd8f3df990426.diff

[clang] [analyzer] Retry UNDEF Z3 queries 2 times by default (PR #120239)

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

[clang] [clang] Lower non-builtin sincos[f|l] calls to llvm.sincos.* when -fno-math-errno is set (PR #121763)

2025-01-06 Thread Benjamin Maxwell via cfe-commits
@@ -1,5 +1,19 @@ -// RUN: %clang_cc1 -triple=aarch64-gnu-linux -emit-llvm -O1 %s -o - | FileCheck --check-prefix=NO-MATH-ERRNO %s -// RUN: %clang_cc1 -triple=aarch64-gnu-linux -emit-llvm -fmath-errno %s -o - | FileCheck --check-prefix=MATH-ERRNO %s +// RUN: %clang_cc1 -triple=aa

[clang] [llvm] [Arm] Regenerate tests (NFC) (PR #121801)

2025-01-06 Thread Jonathan Thackray via cfe-commits
https://github.com/jthackray approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/121801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: steakhal wrote: Could you please check the generated html prior merging this, just to be on the safe side it looks as intended. https://github.com/llvm/llvm-project/pull/121759

[clang] [llvm] [Arm] Generate explicit bitcasts in NeonEmitter (PR #121802)

2025-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Momchil Velikov (momchil-velikov) Changes The `arm_neon.h` does a lot of vector-to-vector "conversions" using the C cast operator in some cases or a round trip through memory in some other cases. The latt

[clang] [llvm] [Arm] Generate explicit bitcasts in NeonEmitter (PR #121802)

2025-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: Momchil Velikov (momchil-velikov) Changes The `arm_neon.h` does a lot of vector-to-vector "conversions" using the C cast operator in some cases or a round trip through memory in some other cases. The latter is especially troublin

[clang] [llvm] [HLSL][RootSignature] Implement parsing of `RootParamter`s (PR #121803)

2025-01-06 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/121803 ``` - Implement the ParseRootParameter methods in ParseHLSLRootSignature - Define the in-memory represenation of the various RootParameters and adds it to the RootElement structure - Add testing of valid inputs t

<    1   2   3   4   5   6   >