[clang] [llvm] [Clang][LLVM][AArch64]Add new feature SSVE-BitPerm (PR #121947)

2025-01-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-mc Author: None (CarolineConcatto) Changes The 20204-12 ISA update release adds a new feature: FEAT_SSVE_BitPerm, which allows the sve-bitperm instructions to run in streaming mode. It also removes the requirement of FEAT_SVE2 for FEAT_SVE_BitPerm. The

[clang] [llvm] [Clang][LLVM][AArch64]Add new feature SSVE-BitPerm (PR #121947)

2025-01-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: None (CarolineConcatto) Changes The 20204-12 ISA update release adds a new feature: FEAT_SSVE_BitPerm, which allows the sve-bitperm instructions to run in streaming mode. It also removes the requirement of FEAT_SVE2 for FEAT_SVE_Bi

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2025-01-07 Thread Oliver Stannard via cfe-commits
ostannard wrote: Updated version: #121943 https://github.com/llvm/llvm-project/pull/120449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][LLVM][AArch64]Add new feature SSVE-BitPerm (PR #121947)

2025-01-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: None (CarolineConcatto) Changes The 20204-12 ISA update release adds a new feature: FEAT_SSVE_BitPerm, which allows the sve-bitperm instructions to run in streaming mode. It also removes the requirement of FEAT_SVE2 for FEAT_SVE

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-07 Thread Erich Keane via cfe-commits
erichkeane wrote: I think I wrote the original patch. The point for allowing the 'aux' target to enable a builtin that is not supported on the 'default' target is for languages where 2-pass compilation is necessary for device/host, and the 'aux' target is used to capture that this is a 2-pass

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

2025-01-07 Thread Paul Kirth via cfe-commits
ilovepi wrote: Is there any known issue w/ the NDK 13 bot? The log cuts out midway through tests, so I assume this is some kind of timeout or another issue w/ the emulator. the complete log only shows some warnings when launching the emulator, but IDK if those are relevant. They seem benign to

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

2025-01-07 Thread Sean Perry via cfe-commits
perry-ca wrote: build failures were from time outs uploading to the artifactory. Is unrelated to change. ``` 2025-01-06 21:33:11 ERROR Error uploading artifact states: PUT https://agent.buildkite.com/v3/jobs/01943cd5-d77e-4011-a1f4-08aabba24f73/artifacts: 504 Gateway Time-out --   | fatal: f

[clang] 57b80e8 - [SystemZ][z/OS] Add z/OS customization file (#111182)

2025-01-07 Thread via cfe-commits
Author: Sean Perry Date: 2025-01-07T11:52:36-05:00 New Revision: 57b80e8b1a7eaa5b8b9114e4bb2395e0d05c75a5 URL: https://github.com/llvm/llvm-project/commit/57b80e8b1a7eaa5b8b9114e4bb2395e0d05c75a5 DIFF: https://github.com/llvm/llvm-project/commit/57b80e8b1a7eaa5b8b9114e4bb2395e0d05c75a5.diff LO

[clang] [llvm] [HLSL] Add SPIR-V version of getPointer. (PR #121963)

2025-01-07 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/121963 Use the spv version of the resource.getpointeri intrinsic when targeting SPIR-V. >From 8e182fe89678e98ebba3664f4c1878301e57445a Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Tue, 3 Dec 2024 11:00:44 -050

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

2025-01-07 Thread Sean Perry via cfe-commits
https://github.com/perry-ca closed https://github.com/llvm/llvm-project/pull/82 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Add SPIR-V version of getPointer. (PR #121963)

2025-01-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Steven Perron (s-perron) Changes Use the spv version of the resource.getpointeri intrinsic when targeting SPIR-V. --- Full diff: https://github.com/llvm/llvm-project/pull/121963.diff 4 Files Affected: - (modified) clang/lib/CodeGen/CGB

[clang] ab5133b - Revert "[Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (#120507)"

2025-01-07 Thread Nico Weber via cfe-commits
Author: Nico Weber Date: 2025-01-07T09:23:50-05:00 New Revision: ab5133bbc62af4686f305a3c7d85f74b9f5b949f URL: https://github.com/llvm/llvm-project/commit/ab5133bbc62af4686f305a3c7d85f74b9f5b949f DIFF: https://github.com/llvm/llvm-project/commit/ab5133bbc62af4686f305a3c7d85f74b9f5b949f.diff LO

[clang] [llvm] [Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (PR #120507)

2025-01-07 Thread Nico Weber via cfe-commits
nico wrote: Also fails here: http://45.33.8.238/linux/156731/step_6.txt http://45.33.8.238/macm1/98544/step_6.txt https://github.com/llvm/llvm-project/pull/120507 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-07 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > `CodeGenHipStdPar/unsupported-builtins.cpp` is pretty interesting actually, > it looks like it tests for some behavior in CodeGen that seems like it's > trying to fix the exact same problem > > The other two tests seem to be actually unrelated breakages though. It is not quit

[clang] [llvm] [LLVM][AArch64] Add new feature +sme-mop4 and +sme-tmop (PR #121935)

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

[clang] [AArch64][SME] Add diagnostics for SME attributes on lambda functions (PR #121777)

2025-01-07 Thread via cfe-commits
@@ -1328,4 +1328,57 @@ void SemaARM::handleInterruptAttr(Decl *D, const ParsedAttr &AL) { ARMInterruptAttr(getASTContext(), AL, Kind)); } +// Check if the function definition uses any AArch64 SME features without +// having the '+sme' feature enabled and warn

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

2025-01-07 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > this requires dataflow analysis to get a low false-positive rate > > I think it might be possible to have low false positive rates without > dataflow analysis. Currently, it looks like the check is looking for > syntactically identical subexpressions. Those tend to over

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-07 Thread via cfe-commits
https://github.com/gbMattN updated https://github.com/llvm/llvm-project/pull/119387 >From 8781ff2355750ae61d140620b1f6862537de07e3 Mon Sep 17 00:00:00 2001 From: gbMattN Date: Tue, 10 Dec 2024 15:01:37 + Subject: [PATCH 1/5] [ASan] Add metadata to renamed instructions so ASan doesn't use t

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-01-07 Thread Erich Keane via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier Message-ID: In-Reply-To: erichkeane wrote: > As an update, I've been adding more tests and I found that I can make > improvements with follow-up work. Since these aren't stability problems or > false positives, and we think the change i

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2025-01-07 Thread Timm Baeder via cfe-commits
tbaederr wrote: Yep, that's what I was pinging for :) https://github.com/llvm/llvm-project/pull/117732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][LLVM][AArch64]Add new feature SSVE-BitPerm (PR #121947)

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

[clang] [TySan] Don't report globals with incomplete types. (PR #121922)

2025-01-07 Thread Florian Hahn via cfe-commits
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/121922 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] 473cdb9 - [TySan] Don't report globals with incomplete types. (#121922)

2025-01-07 Thread via cfe-commits
Author: Florian Hahn Date: 2025-01-07T15:06:26Z New Revision: 473cdb93e55deeea6a7f654e192f5227d85cee08 URL: https://github.com/llvm/llvm-project/commit/473cdb93e55deeea6a7f654e192f5227d85cee08 DIFF: https://github.com/llvm/llvm-project/commit/473cdb93e55deeea6a7f654e192f5227d85cee08.diff LOG:

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-07 Thread James Y Knight via cfe-commits
@@ -3911,14 +3926,31 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange, } } - // Pointer to object of size zero is not allowed. - if (RequireCompleteType(Ptr->getBeginLoc(), AtomTy, - diag::err_incomplete_type))

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-07 Thread James Y Knight via cfe-commits
https://github.com/jyknight commented: Looks basically good to me, just a couple suggestions to improve the code clarity. https://github.com/llvm/llvm-project/pull/121943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-07 Thread James Y Knight via cfe-commits
@@ -3686,12 +3687,18 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange, C11CmpXchg, // bool __atomic_compare_exchange(A *, C *, CP, bool, int, int) -GNUCmpXchg +GNUCmpXchg, + +// bool __atomic_test_and_set(A *, int) +Test

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-07 Thread James Y Knight via cfe-commits
@@ -3963,8 +3995,8 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange, return ExprError(); } - if (!IsC11 && !AtomTy.isTriviallyCopyableType(Context) && - !AtomTy->isScalarType()) { + if (!IsC11 && Form != TestAndSet && Form != Clear

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-07 Thread James Y Knight via cfe-commits
https://github.com/jyknight edited https://github.com/llvm/llvm-project/pull/121943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-07 Thread James Y Knight via cfe-commits
@@ -1977,16 +1977,16 @@ def AtomicNandFetch : AtomicBuiltin { let Prototype = "void(...)"; } -def AtomicTestAndSet : Builtin { +def AtomicTestAndSet : AtomicBuiltin { let Spellings = ["__atomic_test_and_set"]; - let Attributes = [NoThrow]; - let Prototype = "bool(void v

[clang] [diagtool] Make the BuiltinDiagnosticsByID table sorted (PR #120321)

2025-01-07 Thread Karl-Johan Karlsson via cfe-commits
@@ -23,28 +23,29 @@ llvm::ArrayRef diagtool::getBuiltinDiagnosticsByName() { return llvm::ArrayRef(BuiltinDiagnosticsByName); } - // FIXME: Is it worth having two tables, especially when this one can get // out of sync easily? +// clang-format off static const Diagnostic

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -0,0 +1,584 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s + +#define __counted_by(f) __attribute__((counted_by(f))) + +// =

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I don't think it makes any sense for `__has_builtin` to return true when the target does not in-fact have the builtin. Most of the time this is used to guard target specific code, which will then be wrong if it's compiled on the device. Realistically the solution that makes sens

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -8192,6 +8192,14 @@ ExprResult InitializationSequence::Perform(Sema &S, Kind.getRange().getEnd()); } else { CurInit = new (S.Context) ImplicitValueInitExpr(Step->Type); +// Note the return value isn't used to return early +// to pres

[clang] [llvm] [HLSL] Root Signature Parser (PR #120811)

2025-01-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/120811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -8238,6 +8246,15 @@ ExprResult InitializationSequence::Perform(Sema &S, } } + // Note the return value isn't used to return early so that additional + // diagnostics can be emitted and to preserve the AST as best as possible + // even though an

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-07 Thread Erich Keane via cfe-commits
erichkeane wrote: > I don't think it makes any sense for `__has_builtin` to return true when the > target does not in-fact have the builtin. Most of the time this is used to > guard target specific code, which will then be wrong if it's compiled on the > device. Realistically the solution that

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-07 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > > I don't think it makes any sense for `__has_builtin` to return true when > > the target does not in-fact have the builtin. Most of the time this is used > > to guard target specific code, which will then be wrong if it's compiled on > > the device. Realistically the solution

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > I don't think it makes any sense for `__has_builtin` to return true when > > the target does not in-fact have the builtin. Most of the time this is used > > to guard target specific code, which will then be wrong if it's compiled on > > the device. Realistically the solution

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

2025-01-07 Thread CHANDRA GHALE via cfe-commits
https://github.com/chandraghale updated https://github.com/llvm/llvm-project/pull/121741 >From 0c790fc2768d58634e0455adf9f797a2456a7335 Mon Sep 17 00:00:00 2001 From: Chandra Ghale Date: Mon, 6 Jan 2025 03:35:46 -0600 Subject: [PATCH 1/3] codegen support for masked combined construct parallel

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

2025-01-07 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. LG 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] [OpenMP] codegen support for masked combined construct parallel masked taskloop (PR #121741)

2025-01-07 Thread CHANDRA GHALE via cfe-commits
chandraghale wrote: > Also update ReleaseNotes.rst here and in other patches @alexey-bataev release notes updated. Updated for other patches as well in this PR. https://github.com/llvm/llvm-project/pull/121741 ___ cfe-commits mailing list cfe-commi

[clang] [llvm] [Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (PR #120507)

2025-01-07 Thread Mikael Holmén via cfe-commits
mikaelholmen wrote: > LLVM Buildbot has detected a new failure on builder `fuchsia-x86_64-linux` > running on `fuchsia-debian-64-us-central1-a-1` while building `clang,llvm` at > step 4 "annotate". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/11/builds/10589 >

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-07 Thread via cfe-commits
@@ -3430,13 +3430,15 @@ void FunctionStackPoisoner::processStaticAllocas() { SmallVector SVD; SVD.reserve(AllocaVec.size()); for (AllocaInst *AI : AllocaVec) { -ASanStackVariableDescription D = {AI->getName().data(), - ASan.getAllo

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

2025-01-07 Thread CHANDRA GHALE via cfe-commits
https://github.com/chandraghale updated https://github.com/llvm/llvm-project/pull/121741 >From 0c790fc2768d58634e0455adf9f797a2456a7335 Mon Sep 17 00:00:00 2001 From: Chandra Ghale Date: Mon, 6 Jan 2025 03:35:46 -0600 Subject: [PATCH 1/2] codegen support for masked combined construct parallel

[clang] [analyzer] Simplify PositiveAnalyzerOption handling (PR #121910)

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

[clang] [llvm] [AArch64] Improve bcvtn2 and remove aarch64_neon_bfcvt intrinsics (PR #120363)

2025-01-07 Thread David Green via cfe-commits
https://github.com/davemgreen updated https://github.com/llvm/llvm-project/pull/120363 >From deaf0a754d72c2aa3777fe0ba963aa88031182c0 Mon Sep 17 00:00:00 2001 From: David Green Date: Tue, 7 Jan 2025 13:10:16 + Subject: [PATCH] [AArch64] Improve bcvtn2 and remove aarch64_neon_bfcvt intrinsc

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2025-01-07 Thread Jan Voung via cfe-commits
@@ -58,6 +63,106 @@ ast_matchers::StatementMatcher isSmartPointerLikeOperatorArrow(); ast_matchers::StatementMatcher isSmartPointerLikeValueMethodCall(); ast_matchers::StatementMatcher isSmartPointerLikeGetMethodCall(); +// Common transfer functions. + +/// Returns the "canon

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

2025-01-07 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/121781 >From 08b838adf275f1e0eaf2ab3e3d4b2b6d89bf4ed6 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Mon, 6 Jan 2025 14:37:08 +0100 Subject: [PATCH 01/12] [NFC] Replace getRegionValueSymbol with get This sho

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

2025-01-07 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -525,14 +527,14 @@ class SymbolManager { static bool canSymbolicate(QualType T); - /// Make a unique symbol for MemRegion R according to its kind. - const SymbolRegionValue* getRegionValueSymbol(const TypedValueRegion* R); + template const T *get(Args &&...args); ---

[clang] [llvm] [RISCV] Add riscv_atomic.h and Zawrs builtins (PR #96283)

2025-01-07 Thread Craig Topper via cfe-commits
@@ -0,0 +1,33 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=riscv32 -mattr=+zawrs -verify-machineinstrs < %s \ +; RUN: | FileCheck %s -check-prefix=RV32 +; RUN: llc -mtriple=riscv64 -mattr=+zawrs -verify-machineinstrs < %s

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
https://github.com/delcypher edited https://github.com/llvm/llvm-project/pull/106321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -8207,6 +8207,14 @@ ExprResult InitializationSequence::Perform(Sema &S, Kind.getRange().getEnd()); } else { CurInit = new (S.Context) ImplicitValueInitExpr(Step->Type); +// Note the return value isn't used to return early +// to pres

[clang] [llvm] [RISCV] Add riscv_atomic.h and Zawrs builtins (PR #96283)

2025-01-07 Thread Craig Topper via cfe-commits
@@ -0,0 +1,42 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv32 -target-feature +zawrs -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -pas

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2025-01-07 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/118475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-07 Thread Nick Sarnie via cfe-commits
sarnex wrote: @bader Do you mind reviewing this as a member of the SPIR-V team (you already reviewed this internally) or recommend someone else to review, I'm having trouble finding someone :) https://github.com/llvm/llvm-project/pull/120266 ___ cfe-

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-07 Thread via cfe-commits
gbMattN wrote: @vitalybuka manually pinging you for a last review since you were active on the [bugzilla ticket](https://bugs.llvm.org/show_bug.cgi?id=47982) https://github.com/llvm/llvm-project/pull/119387 ___ cfe-commits mailing list cfe-commits@lis

[clang] [clang][Darwin] Remove legacy framework search path logic in the frontend (PR #120149)

2025-01-07 Thread Louis Dionne via cfe-commits
@@ -2539,6 +2550,18 @@ void DarwinClang::AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs llvm::sys::path::append(P, "usr", "include"); addExternCSystemInclude(DriverArgs, CC1Args, P.str()); } + + // Add default framework search paths + auto addFramew

[clang] 56c5a6b - [NFC][analyzer][docs] Crosslink MallocChecker's ownership attributes (#121939)

2025-01-07 Thread via cfe-commits
Author: Kristóf Umann Date: 2025-01-07T17:08:21+01:00 New Revision: 56c5a6ba836065a6e3be9d04e2c64aa8a758a3f4 URL: https://github.com/llvm/llvm-project/commit/56c5a6ba836065a6e3be9d04e2c64aa8a758a3f4 DIFF: https://github.com/llvm/llvm-project/commit/56c5a6ba836065a6e3be9d04e2c64aa8a758a3f4.diff

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2025-01-07 Thread via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/cor3ntin approved this pull request. Can you add a release note? LGTM otherwise https://github.com/llvm/llvm-project/pull/118475

[clang] [NFC][analyzer][docs] Crosslink MallocChecker's ownership attributes (PR #121939)

2025-01-07 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/121939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Evaluate constant initializers in C as well (PR #121950)

2025-01-07 Thread via cfe-commits
cor3ntin wrote: Can you add a description/ test/changelog/C23 wording quote? https://github.com/llvm/llvm-project/pull/121950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] add option to make all main program variable static (PR #121968)

2025-01-07 Thread via cfe-commits
https://github.com/jeanPerier created https://github.com/llvm/llvm-project/pull/121968 None >From f8683e46b58eee5828fced9a31294d72fc247baf Mon Sep 17 00:00:00 2001 From: Jean Perier Date: Tue, 7 Jan 2025 09:30:17 -0800 Subject: [PATCH] [flang][driver] add option to make all main program variab

[clang] [flang] [flang][driver] add option to make all main program variable static (PR #121968)

2025-01-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (jeanPerier) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/121968.diff 5 Files Affected: - (modified) clang/include/clang/Driver/Options.td (+3) - (modified) clang/lib/Driver/ToolChains/Flang.cpp (+2-1) - (mod

[clang] [X86] Return illegal vectors in memory (PR #121944)

2025-01-07 Thread Pranav Kant via cfe-commits
pranavk wrote: Took a look at failing tests -- they need to be modified to conform to the new ABI. Should be easy to do. https://github.com/llvm/llvm-project/pull/121944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [Clang] Added nullptr check to getFriendDecl access (PR #121056)

2025-01-07 Thread via cfe-commits
@@ -886,6 +886,7 @@ Bug Fixes to C++ Support out of a module (which is the case e.g. in MSVC's implementation of ``std`` module). (#GH118218) - Fixed a pack expansion issue in checking unexpanded parameter sizes. (#GH17042) - Fixed a bug where captured structured bindings w

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [flang] [flang][driver] add option to make all main program variable static (PR #121968)

2025-01-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-flang-fir-hlfir Author: None (jeanPerier) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/121968.diff 5 Files Affected: - (modified) clang/include/clang/Driver/Options.td (+3) - (modified) clang/li

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -19,13 +19,12 @@ struct on_member_pointer_complete_ty { }; struct on_member_pointer_incomplete_ty { - struct size_unknown * buf __counted_by(count); // expected-error{{'counted_by' cannot be applied to a pointer with pointee of unknown size because 'struct size_unknown'

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -2068,13 +2068,55 @@ class Sema final : public SemaBase { bool CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, bool OrNull); + /// Perform Bounds Safety Semantic checks for assigning to a `__counted_by` or + /// `__

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,584 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s + +#define __counted_by(f) __attribute__((counted_by(f))) + +// =

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -13559,6 +13562,27 @@ QualType Sema::CheckAssignmentOperands(Expr *LHSExpr, ExprResult &RHS, QualType LHSType = LHSExpr->getType(); QualType RHSType = CompoundType.isNull() ? RHS.get()->getType() : CompoundType; + + if (RHS.

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -3907,6 +3923,31 @@ CountAttributedType::CountAttributedType( DeclSlot[i] = CoupledDecls[i]; } +StringRef CountAttributedType::getAttributeName(bool WithMacroPrefix) const { +// TODO: This method isn't really ideal because it doesn't return the spelling +// of the attri

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -102,7 +105,36 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, // only `PointeeTy->isStructureTypeWithFlexibleArrayMember()` is reachable // when `FieldTy->isArrayType()`. bool ShouldWarn = false; - if (PointeeTy->isIncompleteType()

[clang] [clang] Fix implicit integer conversion for opaque enums declared in class templates (PR #121039)

2025-01-07 Thread via cfe-commits
=?utf-8?q?André?= Brand Message-ID: In-Reply-To: https://github.com/thebrandre edited https://github.com/llvm/llvm-project/pull/121039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -3907,6 +3923,31 @@ CountAttributedType::CountAttributedType( DeclSlot[i] = CoupledDecls[i]; } +StringRef CountAttributedType::getAttributeName(bool WithMacroPrefix) const { +// TODO: This method isn't really ideal because it doesn't return the spelling

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Aaron Ballman via cfe-commits
@@ -186,4 +218,206 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +static void EmitIncompleteCountedByPointeeNotes(Sema &S, +const CountAttributedType *CATy, +

[clang] [flang] [flang][driver] add option to make all main program variable static (PR #121968)

2025-01-07 Thread Kiran Chandramohan via cfe-commits
https://github.com/kiranchandramohan edited https://github.com/llvm/llvm-project/pull/121968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] add option to make all main program variable static (PR #121968)

2025-01-07 Thread Kiran Chandramohan via cfe-commits
@@ -6945,6 +6945,9 @@ defm unsigned : OptInFC1FFlag<"unsigned", "Enables UNSIGNED type">; def fno_automatic : Flag<["-"], "fno-automatic">, Group, HelpText<"Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE">; +def fsave_main_progra

[clang] [flang] [flang][driver] add option to make all main program variable static (PR #121968)

2025-01-07 Thread Kiran Chandramohan via cfe-commits
https://github.com/kiranchandramohan approved this pull request. LG. Thanks @jeanPerier. https://github.com/llvm/llvm-project/pull/121968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

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

2025-01-07 Thread Matheus Izvekov via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -1228,35 +1228,45 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL, NonTypeTemplateParmDecl *NewConstrainedParm,

[clang] [llvm] [FMV][AArch64] Simplify version selection according to ACLE. (PR #121921)

2025-01-07 Thread Jon Roelofs via cfe-commits
@@ -49,16 +49,11 @@ std::optional AArch64::ArchInfo::findBySubArch(StringRef SubA } unsigned AArch64::getFMVPriority(ArrayRef Features) { jroelofs wrote: I'm not sure that this interface can correctly describe the new rule. ISTM it would have to be a compar

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-01-07 Thread Erich Keane via cfe-commits
=?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier Message-ID: In-Reply-To: https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/116708 ___

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-07 Thread Shilei Tian via cfe-commits
@@ -94,43 +94,43 @@ typedef double __attribute__((ext_vector_type(16))) double16; // CHECK-LABEL: @local_memory_alignment_global( // CHECK: store volatile i8 0, ptr addrspace(3) @local_memory_alignment_global.lds_i8, align 1 // CHECK: store volatile <2 x i8> zeroinitializer,

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-07 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/104661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -102,7 +105,36 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, // only `PointeeTy->isStructureTypeWithFlexibleArrayMember()` is reachable // when `FieldTy->isArrayType()`. bool ShouldWarn = false; - if (PointeeTy->isIncompleteType()

[clang] [clang] Fix implicit integer conversion for opaque enums declared in class templates (PR #121039)

2025-01-07 Thread via cfe-commits
=?utf-8?q?Andr=C3=A9?= Brand , =?utf-8?q?Andr=C3=A9?= Brand ,thebrandre , =?utf-8?q?Andr=C3=A9?= Brand Message-ID: In-Reply-To: @@ -938,6 +938,9 @@ Miscellaneous Clang Crashes Fixed - Fixed internal assertion firing when a declaration in the implicit global module is found

[clang] [clang] Fix implicit integer conversion for opaque enums declared in class templates (PR #121039)

2025-01-07 Thread via cfe-commits
=?utf-8?q?André?= Brand , =?utf-8?q?André?= Brand ,thebrandre , =?utf-8?q?André?= Brand Message-ID: In-Reply-To: @@ -938,6 +938,9 @@ Miscellaneous Clang Crashes Fixed - Fixed internal assertion firing when a declaration in the implicit global module is found through ADL. (

[clang] [clang] Emit @llvm.assume when we know the streaming mode of the function (PR #121917)

2025-01-07 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I really don't see why we'd want to implement the optimization this way; can't we just add an instcombine for calls to `llvm.aarch64.sme.in.streaming.mode`? https://github.com/llvm/llvm-project/pull/121917 ___ cfe-commits mailing

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

2025-01-07 Thread Alexander Richardson via cfe-commits
@@ -122,6 +122,11 @@ def parse_clang_ast_json(node, loc, search): if search is None: search = spell mangled = node.get("mangledName", spell) +# Strip leading underscore from globals, so the name matches the LLVM one arichard

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-07 Thread Alexey Bader via cfe-commits
https://github.com/bader approved this pull request. LGTM. @svenvh, do you have any objections? https://github.com/llvm/llvm-project/pull/120266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2025-01-07 Thread via cfe-commits
pirama-arumuga-nainar wrote: Does this pattern still occur while doing `echo "#include " | clang-19 -E -O2 -xc - -MM -H`? That is idiomatic compared to including `/usr/include/limits.h` directly. It also doesn't seem correct to depend on the `_LIBC_LIMITS_H_` macro which is defined in glibc.

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -3907,6 +3923,31 @@ CountAttributedType::CountAttributedType( DeclSlot[i] = CoupledDecls[i]; } +StringRef CountAttributedType::getAttributeName(bool WithMacroPrefix) const { +// TODO: This method isn't really ideal because it doesn't return the spelling +// of the attri

[clang] [llvm] [OpenMP][OMPIRBuilder] Handle non-failing calls properly (PR #115863)

2025-01-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. The compromise with `cantFail` is fine. Most will run those tests with assertions enabled and undefined behaviour is one of the things a unittests should be regularly tested for (e.g. with undefined-behaviour sanitizer). https://github.

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

2025-01-07 Thread Alexander Richardson via cfe-commits
arichardson wrote: So it looks like this happens to work if we already mapped the function to another mangled name previously which is why the macho happens to work if we generated CHECK lines for ELF already. https://github.com/llvm/llvm-project/pull/121800 ___

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-01-07 Thread Dan Liew via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [clang] Fix implicit integer conversion for opaque enums declared in class templates (PR #121039)

2025-01-07 Thread via cfe-commits
=?utf-8?q?André?= Brand , =?utf-8?q?André?= Brand ,thebrandre , =?utf-8?q?André?= Brand ,thebrandre Message-ID: In-Reply-To: @@ -938,6 +938,9 @@ Miscellaneous Clang Crashes Fixed - Fixed internal assertion firing when a declaration in the implicit global module is found t

<    1   2   3   4   5   >