[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Utkarsh Saxena via cfe-commits
@@ -0,0 +1,49 @@ +.. title:: clang-tidy - misc-coroutine-hostile-raii + +misc-coroutine-hostile-raii + + +This check detects hostile-RAII objects which should not persist across a +suspension point in a coroutine. + +Some objects require that they be

[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/68738 >From f9e29053a7a8fd8222cfbdf579776fafd6564b89 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Tue, 10 Oct 2023 21:53:37 +0200 Subject: [PATCH 1/9] [clang-tidy] Add check to flag objects hostile to suspension

[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Utkarsh Saxena via cfe-commits
@@ -0,0 +1,117 @@ +//===--- CoroutineHostileRAII.cpp - clang-tidy ===// +// +// 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:

[libunwind] [libc++] Implement ranges::contains (PR #65148)

2023-10-17 Thread via cfe-commits
https://github.com/ZijunZhaoCCK updated https://github.com/llvm/llvm-project/pull/65148 >From 02e9afd761228f401df4d9f8dfaaca44ffae0c6e Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Thu, 31 Aug 2023 20:08:32 + Subject: [PATCH 01/15] [libc++] Implement ranges::contains Differential

[clang] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

2023-10-17 Thread via cfe-commits
goldsteinn wrote: > > > We should update LangRef and require that the integer arg has the size of > > > the pointer index type > > > > > > As in disallow say `ptrmask.p0.i32` on typical systems with 64-bit pointer > > index? (So a lot of the current usages). Or something else? > > Yes,

[clang] [RFC] Perform lifetime bound checks for arguments to coroutine (PR #69360)

2023-10-17 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 4480e650b3cf7cc63cfd3767cd6b120f8bfad2ac be3f5faa6cd17d76f26fb1bc6d6b59a8a78ffe82 --

[clang] [AIX][clang][driver] fix no-pthread option (PR #69363)

2023-10-17 Thread David Tenty via cfe-commits
https://github.com/daltenty created https://github.com/llvm/llvm-project/pull/69363 We don't properly check the boolean pthread option in the AIX toolchain, so we don't respect the no- form of the option. >From 560bf7329998e88d0ba12a2030b376d4a5aa173b Mon Sep 17 00:00:00 2001 From: David

[libunwind] [Clang] Add __builtin_vectorelements to get number of elements in vector (PR #69010)

2023-10-17 Thread Lawrence Benson via cfe-commits
https://github.com/lawben updated https://github.com/llvm/llvm-project/pull/69010 >From df8d0a53a31e1351bb6cd3b340e9012b489e9885 Mon Sep 17 00:00:00 2001 From: Lawrence Benson Date: Wed, 11 Oct 2023 17:26:11 +0200 Subject: [PATCH 01/10] Add __builtin_vectorelements to get the number of

[clang] [Clang] Add __builtin_vectorelements to get number of elements in vector (PR #69010)

2023-10-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/69010 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [Clang] Add __builtin_vectorelements to get number of elements in vector (PR #69010)

2023-10-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I'm good with it if the pre-commit is, and no one comes out and really needs the mangling done in this patch. https://github.com/llvm/llvm-project/pull/69010 ___ cfe-commits mailing list

[clang-tools-extra] [MLIR][Presburger] Implement matrix inverse (PR #67382)

2023-10-17 Thread via cfe-commits
@@ -432,4 +432,138 @@ MPInt IntMatrix::normalizeRow(unsigned row, unsigned cols) { MPInt IntMatrix::normalizeRow(unsigned row) { return normalizeRow(row, getNumColumns()); +} + +MPInt IntMatrix::determinant() { + unsigned r = getNumRows(); + unsigned c = getNumColumns();

[clang] [analyzer][clangsa] Add new option to alpha.security.cert.InvalidPtrChecker (PR #67663)

2023-10-17 Thread Endre Fülöp via cfe-commits
@@ -84,33 +104,70 @@ class InvalidPtrChecker REGISTER_SET_WITH_PROGRAMSTATE(InvalidMemoryRegions, const MemRegion *) // Stores the region of the environment pointer of 'main' (if present). -REGISTER_TRAIT_WITH_PROGRAMSTATE(EnvPtrRegion, const MemRegion *)

[clang-tools-extra] [MLIR][Presburger] Implement matrix inverse (PR #67382)

2023-10-17 Thread via cfe-commits
@@ -432,4 +432,138 @@ MPInt IntMatrix::normalizeRow(unsigned row, unsigned cols) { MPInt IntMatrix::normalizeRow(unsigned row) { return normalizeRow(row, getNumColumns()); +} + +MPInt IntMatrix::determinant() { + unsigned r = getNumRows(); + unsigned c = getNumColumns();

[clang-tools-extra] Port Swift's merge function pass to llvm: merging functions that differ in constants (PR #68235)

2023-10-17 Thread Manman Ren via cfe-commits
https://github.com/manman-ren updated https://github.com/llvm/llvm-project/pull/68235 >From 7e422cecbd5fc28fb0ec699b702d6bccf321f93f Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Mon, 2 Oct 2023 11:16:58 -0700 Subject: [PATCH] Preliminary patch for merging functions that differ in constants

[libunwind] [libc++] Implement ranges::contains (PR #65148)

2023-10-17 Thread via cfe-commits
https://github.com/ZijunZhaoCCK updated https://github.com/llvm/llvm-project/pull/65148 >From 02e9afd761228f401df4d9f8dfaaca44ffae0c6e Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Thu, 31 Aug 2023 20:08:32 + Subject: [PATCH 01/15] [libc++] Implement ranges::contains Differential

[libunwind] [Clang] Add __builtin_vectorelements to get number of elements in vector (PR #69010)

2023-10-17 Thread Erich Keane via cfe-commits
@@ -5126,6 +5126,14 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity, Diags.Report(DiagID); return; } +case UETT_VectorElements: { erichkeane wrote: OK, SGTM at least, I just know this pattern of 'cannot yet

[clang] [Clang] Add __builtin_vectorelements to get number of elements in vector (PR #69010)

2023-10-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I'm good with it if the pre-commit is, and no one comes out and really needs the mangling done in this patch. https://github.com/llvm/llvm-project/pull/69010 ___ cfe-commits mailing list

[PATCH] D151081: [Clang][SVE2.1] Add svpext builtins

2023-10-17 Thread Caroline via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7cad5a9eb48e: [Clang][SVE2.1] Add svpext builtins (authored by CarolineConcatto). Changed prior to commit: https://reviews.llvm.org/D151081?vs=557730=557737#toc Repository: rG LLVM Github Monorepo

[clang] 7cad5a9 - [Clang][SVE2.1] Add svpext builtins

2023-10-17 Thread Caroline Concatto via cfe-commits
Author: Caroline Concatto Date: 2023-10-17T16:15:22Z New Revision: 7cad5a9eb48e44a10121044d0342ccfbdd8df672 URL: https://github.com/llvm/llvm-project/commit/7cad5a9eb48e44a10121044d0342ccfbdd8df672 DIFF: https://github.com/llvm/llvm-project/commit/7cad5a9eb48e44a10121044d0342ccfbdd8df672.diff

[clang] [NVPTX] Fixed some wmma store builtins that had non-const src param. (PR #69354)

2023-10-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (JackAKirk) Changes Now all wmma store builtins have src param marked const. Summary: Signed-off-by: JackAKirk jack.kirk@codeplay.com --- Full diff: https://github.com/llvm/llvm-project/pull/69354.diff 1 Files Affected: -

[clang] [AArch64] Stack probing for dynamic allocas in GlobalISel (PR #67123)

2023-10-17 Thread Oskar Wirga via cfe-commits
https://github.com/oskarwirga approved this pull request. https://github.com/llvm/llvm-project/pull/67123 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D151197: [Clang][SVE2p1] Add svpsel builtins

2023-10-17 Thread Caroline via Phabricator via cfe-commits
CarolineConcatto updated this revision to Diff 557739. CarolineConcatto added a comment. -Remove immediate+base from psel and rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151197/new/ https://reviews.llvm.org/D151197 Files:

[clang] [clang] [unittest] Add a test for Generic_GCC::GCCVersion::Parse (PR #69078)

2023-10-17 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs approved this pull request. https://github.com/llvm/llvm-project/pull/69078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC] Perform lifetime bound checks for arguments to coroutine (PR #69360)

2023-10-17 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 created https://github.com/llvm/llvm-project/pull/69360 None >From be3f5faa6cd17d76f26fb1bc6d6b59a8a78ffe82 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Tue, 17 Oct 2023 19:37:28 +0200 Subject: [PATCH] Lifetime bound check for coroutine ---

[clang] [AIX][clang][driver] fix no-pthread option (PR #69363)

2023-10-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: David Tenty (daltenty) Changes We don't properly check the boolean pthread option in the AIX toolchain, so we don't respect the no- form of the option. --- Full diff: https://github.com/llvm/llvm-project/pull/69363.diff 2 Files

[clang-tools-extra] Fix #41439: Update the documentation with the correct information. (PR #69377)

2023-10-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: None (Da-Viper) Changes Fixes #41439 The documentation is update to say it is allowed to have omitted parameter names if the variable is not used --- Full diff: https://github.com/llvm/llvm-project/pull/69377.diff 1 Files

[clang] [SystemZ][z/OS] This change adds support for the PPA2 section in zOS (PR #68926)

2023-10-17 Thread Yusra Syeda via cfe-commits
@@ -1296,6 +1372,124 @@ void SystemZAsmPrinter::emitPPA1(MCSymbol *FnEndSym) { 4); } +void SystemZAsmPrinter::emitStartOfAsmFile(Module ) { + if (TM.getTargetTriple().isOSzOS()) +emitPPA2(M); + AsmPrinter::emitStartOfAsmFile(M); +}

[clang] [SystemZ][z/OS] This change adds support for the PPA2 section in zOS (PR #68926)

2023-10-17 Thread Yusra Syeda via cfe-commits
@@ -976,6 +976,24 @@ void CodeGenModule::Release() { Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity(); getModule().addModuleFlag(llvm::Module::Error, "wchar_size", WCharWidth); + if (getTriple().isOSzOS()) { +int32_t ProductVersion,

[clang] [SystemZ][z/OS] This change adds support for the PPA2 section in zOS (PR #68926)

2023-10-17 Thread Yusra Syeda via cfe-commits
@@ -10,9 +10,49 @@ #include "clang/Config/config.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/FormatVariadic.h" #include "llvm/TargetParser/Triple.h" using namespace clang; +const char

[clang] [SystemZ][z/OS] This change adds support for the PPA2 section in zOS (PR #68926)

2023-10-17 Thread Yusra Syeda via cfe-commits
@@ -1026,6 +1036,68 @@ void SystemZAsmPrinter::emitADASection() { OutStreamer->popSection(); } +static uint32_t getProductVersion(Module ) { + if (auto *VersionVal = cast_or_null( + M.getModuleFlag("Product Major Version"))) +return

[clang] [SystemZ][z/OS] This change adds support for the PPA2 section in zOS (PR #68926)

2023-10-17 Thread Yusra Syeda via cfe-commits
@@ -976,6 +976,24 @@ void CodeGenModule::Release() { Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity(); getModule().addModuleFlag(llvm::Module::Error, "wchar_size", WCharWidth); + if (getTriple().isOSzOS()) { +int32_t ProductVersion,

[clang-tools-extra] [libc++] Add assertions for potential OOB reads in std::nth_element (PR #67023)

2023-10-17 Thread Louis Dionne via cfe-commits
ldionne wrote: > That depends on what we want to do with these kinds of issues in general. I > think we should avoid making functions so complex. If we have a general > consensus there, I think we should just suppress the warning with a todo that > the function should be split up (or

[clang] [CUDA][HIP] Fix deduction guide (PR #69366)

2023-10-17 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/69366 >From b28384d33f858a6d4139da931b436cbf1a0a426a Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Sat, 14 Oct 2023 17:28:13 -0400 Subject: [PATCH] [CUDA][HIP] Fix deduction guide Currently clang assumes

[clang] [Driver][DragonFly] Fixes for linker path and command-line option handling (PR #69095)

2023-10-17 Thread Brad Smith via cfe-commits
https://github.com/brad0 edited https://github.com/llvm/llvm-project/pull/69095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][DragonFly] Fixes for linker path and command-line option handling (PR #69095)

2023-10-17 Thread Brad Smith via cfe-commits
https://github.com/brad0 updated https://github.com/llvm/llvm-project/pull/69095 >From 7009758fba9b7053f6ea76033de7221f25722ed6 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sun, 15 Oct 2023 04:00:56 -0400 Subject: [PATCH] [Driver][DragonFly] Fixes for linker path and command-line option

[libunwind] [libunwind] Fix running tests with MSan (PR #67860)

2023-10-17 Thread Louis Dionne via cfe-commits
@@ -115,6 +121,18 @@ extern int unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t) LIBUNWIND_AVAIL extern int unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t) LIBUNWIND_AVAIL; extern int unw_resume(unw_cursor_t *) LIBUNWIND_AVAIL; +#ifdef LIBUNWIND_HAVE_MSAN +//

[clang] Correctly link and optimize device libraries with -mlink-builtin-bitcode (PR #69371)

2023-10-17 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > sincos() is just one example. There are several other cases that can trigger > this issue. fold_rootn() generates new function calls for square and cubic > roots, fold_pow() does a similar thing for specific powers (ex 2), etc. > > We did try disabling -amdgpu-prelink, and it

[clang-tools-extra] Fix #41439: Update the documentation with the correct information. (PR #69377)

2023-10-17 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/69377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc++] Fix inconsistency between is_lock_free and is_always_lock_free (PR #68109)

2023-10-17 Thread Louis Dionne via cfe-commits
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/68109 >From 84ae453ad32cad94038bdb1e91b4b5c422f3ceb3 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 3 Oct 2023 10:06:12 -0400 Subject: [PATCH 1/2] [libc++] Fix inconsistency between is_lock_free and

[clang-tools-extra] [libc++] Fix inconsistency between is_lock_free and is_always_lock_free (PR #68109)

2023-10-17 Thread Louis Dionne via cfe-commits
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/68109 >From 84ae453ad32cad94038bdb1e91b4b5c422f3ceb3 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 3 Oct 2023 10:06:12 -0400 Subject: [PATCH 1/2] [libc++] Fix inconsistency between is_lock_free and

[clang] [Driver] Remove identifier with the comment (PR #68351)

2023-10-17 Thread Brad Smith via cfe-commits
https://github.com/brad0 updated https://github.com/llvm/llvm-project/pull/68351 >From 4cf784b8e73515c3120793ac0ec1cf59ef6da767 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Thu, 5 Oct 2023 16:23:58 -0400 Subject: [PATCH] [Driver][NFC] Remove identifier with the comment MaskRay suggested

[clang] ed1d290 - [Driver][NFC] Remove identifier with the comment (#68351)

2023-10-17 Thread via cfe-commits
Author: Brad Smith Date: 2023-10-17T23:27:07-04:00 New Revision: ed1d29028492b28b4790690b275b3a095f56fa47 URL: https://github.com/llvm/llvm-project/commit/ed1d29028492b28b4790690b275b3a095f56fa47 DIFF: https://github.com/llvm/llvm-project/commit/ed1d29028492b28b4790690b275b3a095f56fa47.diff

[clang] [Driver][NFC] Remove identifier with the comment (PR #68351)

2023-10-17 Thread Brad Smith via cfe-commits
https://github.com/brad0 closed https://github.com/llvm/llvm-project/pull/68351 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][NFC] Remove identifier with the comment (PR #68351)

2023-10-17 Thread Brad Smith via cfe-commits
https://github.com/brad0 edited https://github.com/llvm/llvm-project/pull/68351 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Implement shadow stack on shadow stack mode with Zicfiss. (PR #68075)

2023-10-17 Thread Craig Topper via cfe-commits
@@ -106,9 +111,14 @@ static void emitSCSEpilogue(MachineFunction , MachineBasicBlock , CSI, [&](CalleeSavedInfo ) { return CSR.getReg() == RAReg; })) return; + const RISCVInstrInfo *TII = STI.getInstrInfo(); + if (STI.hasFeature(RISCV::FeatureStdExtZicfiss))

[clang-tools-extra] Fix #41439: Update the documentation with the correct information. (PR #69377)

2023-10-17 Thread via cfe-commits
https://github.com/Da-Viper created https://github.com/llvm/llvm-project/pull/69377 Fixes #41439 The documentation is update to say it is allowed to have omitted parameter names if the variable is not used >From 0e0a3e7ad1a0a7098e05a5164413369eaa58c55b Mon Sep 17 00:00:00 2001 From: Ezike

[clang] [RISCV] Implement shadow stack on shadow stack mode with Zicfiss. (PR #68075)

2023-10-17 Thread Paul Kirth via cfe-commits
@@ -106,9 +111,14 @@ static void emitSCSEpilogue(MachineFunction , MachineBasicBlock , CSI, [&](CalleeSavedInfo ) { return CSR.getReg() == RAReg; })) return; + const RISCVInstrInfo *TII = STI.getInstrInfo(); + if (STI.hasFeature(RISCV::FeatureStdExtZicfiss))

[clang-tools-extra] Fix #41439: Update the documentation with the correct information. (PR #69377)

2023-10-17 Thread Piotr Zegar via cfe-commits
@@ -10,7 +10,12 @@ Guide: https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions -All parameters should be named, with identical names in the declaration and -implementation. +A parameter name may be omitted only if the parameter is not used

[clang-tools-extra] Fix #41439: Update the documentation with the correct information. (PR #69377)

2023-10-17 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/69377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall commented: Sorry to arrive late with this. This looks pretty solid, all comments optional, happy to stamp a followup commit if you find them useful. https://github.com/llvm/llvm-project/pull/68738 ___ cfe-commits

[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Sam McCall via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - misc-coroutine-hostile-raii + +misc-coroutine-hostile-raii + + +Detects when objects of certain hostile RAII types persists across suspension +points in a coroutine. Such hostile types include scoped-lockable types and

[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Sam McCall via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - misc-coroutine-hostile-raii + +misc-coroutine-hostile-raii + + +Detects when objects of certain hostile RAII types persists across suspension +points in a coroutine. Such hostile types include scoped-lockable types and

[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Sam McCall via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - misc-coroutine-hostile-raii + +misc-coroutine-hostile-raii + + +Detects when objects of certain hostile RAII types persists across suspension +points in a coroutine. Such hostile types include scoped-lockable types and

[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Sam McCall via cfe-commits
@@ -0,0 +1,98 @@ +//===--- CoroutineHostileRAII.cpp - clang-tidy ===// +// +// 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:

[clang-tools-extra] [libc++] Add assertions for potential OOB reads in std::nth_element (PR #67023)

2023-10-17 Thread via cfe-commits
philnik777 wrote: You can use `// NOLINT(check-name)` or `// NOLINTNEXTLINE(check-name)` to disable clang-tidy warnings. I would probably put a `// NOLINTNEXTLINE(readability-function-cognitive-complexity)` above the function. https://github.com/llvm/llvm-project/pull/67023

[clang] [libc++] Add assertions for potential OOB reads in std::nth_element (PR #67023)

2023-10-17 Thread via cfe-commits
philnik777 wrote: You can use `// NOLINT(check-name)` or `// NOLINTNEXTLINE(check-name)` to disable clang-tidy warnings. I would probably put a `// NOLINTNEXTLINE(readability-function-cognitive-complexity)` above the function. https://github.com/llvm/llvm-project/pull/67023

[clang] [flang][driver] support -dumpversion and -dumpmachine (PR #68896)

2023-10-17 Thread Yuanfang Chen via cfe-commits
yuanfang-chen wrote: > Could this be implemented without any updates to Clang (beyond Options.td)? The options could work by changing options.td only. However, `CLANG_VERSION_STRING` and `FLANG_VERSION_STRING` could be different. This is to handle that.

[libunwind] [RISCV][GlobalISel] Select G_FRAME_INDEX (PR #68254)

2023-10-17 Thread Nitin John Raj via cfe-commits
https://github.com/nitinjohnraj closed https://github.com/llvm/llvm-project/pull/68254 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][RFC] Support AVX10 options (PR #67278)

2023-10-17 Thread Evgenii Kudriashov via cfe-commits
@@ -130,17 +131,35 @@ bool X86TargetInfo::initFeatureMap( continue; } -if (!HasAVX512F && Feature.substr(0, 7) == "+avx512") +if (Feature.substr(0, 7) == "+avx10.") { + HasAVX10 = true; HasAVX512F = true; -if (HasAVX512F && Feature ==

[clang] [X86][RFC] Support AVX10 options (PR #67278)

2023-10-17 Thread Evgenii Kudriashov via cfe-commits
@@ -130,17 +131,35 @@ bool X86TargetInfo::initFeatureMap( continue; } -if (!HasAVX512F && Feature.substr(0, 7) == "+avx512") +if (Feature.substr(0, 7) == "+avx10.") { + HasAVX10 = true; HasAVX512F = true; -if (HasAVX512F && Feature ==

[clang-tools-extra] [X86][RFC] Support AVX10 options (PR #67278)

2023-10-17 Thread Evgenii Kudriashov via cfe-commits
@@ -130,17 +131,35 @@ bool X86TargetInfo::initFeatureMap( continue; } -if (!HasAVX512F && Feature.substr(0, 7) == "+avx512") +if (Feature.substr(0, 7) == "+avx10.") { + HasAVX10 = true; HasAVX512F = true; -if (HasAVX512F && Feature ==

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

2023-10-17 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/69249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

2023-10-17 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/69249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

2023-10-17 Thread Björn Schäpers via cfe-commits
@@ -3497,6 +3497,15 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const { Tok->setType(TT_TrailingReturnArrow); break; } +if (Tok->isNot(TT_TrailingAnnotation)) HazardyKnusperkeks wrote: But why?

[clang] Correctly link and optimize device libraries with -mlink-builtin-bitcode (PR #69371)

2023-10-17 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > This approach assumes that whatever the function call was transformed into > > also exists in the same library, which isn't necessarily true. > > True, good point. But I don't think it's necessarily due to this approach, > but more of how AMDGPULibCalls is implemented. It

[clang] Reapply "[clang analysis][thread-safety] Handle return-by-reference..… (PR #68572)

2023-10-17 Thread Aaron Puchert via cfe-commits
@@ -2278,7 +2303,7 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext ) { PostOrderCFGView::CFGBlockSet VisitedBlocks(CFGraph); CFGBlockInfo = BlockInfo[CFGraph->getEntry().getBlockID()]; - CFGBlockInfo= BlockInfo[CFGraph->getExit().getBlockID()]; +

[clang] Reapply "[clang analysis][thread-safety] Handle return-by-reference..… (PR #68572)

2023-10-17 Thread Aaron Puchert via cfe-commits
@@ -1061,11 +1061,13 @@ def Most : DiagGroup<"most", [ ]>; // Thread Safety warnings -def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">; -def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">; -def ThreadSafetyPrecise:

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

2023-10-17 Thread Owen Pan via cfe-commits
owenca wrote: @HazardyKnusperkeks any other concerns? https://github.com/llvm/llvm-project/pull/69249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Remove identifier with the comment (PR #68351)

2023-10-17 Thread Brad Smith via cfe-commits
brad0 wrote: @MaskRay Ping. https://github.com/llvm/llvm-project/pull/68351 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix #41439: Update the documentation with the correct information. (PR #69377)

2023-10-17 Thread Piotr Zegar via cfe-commits
@@ -10,7 +10,12 @@ Guide: https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions -All parameters should be named, with identical names in the declaration and -implementation. +A parameter name may be omitted only if the parameter is not used

[clang] [clang][CodeGen] Emit annotations for function declarations. (PR #66716)

2023-10-17 Thread Brendan Dahl via cfe-commits
brendandahl wrote: @AaronBallman or @efriedma-quic ping are you able to add reviewers? https://github.com/llvm/llvm-project/pull/66716 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] Fix host/device context in concept (PR #67721)

2023-10-17 Thread Yaxun Liu via cfe-commits
@@ -176,3 +176,34 @@ Predefined Macros * - ``HIP_API_PER_THREAD_DEFAULT_STREAM`` - Alias to ``__HIP_API_PER_THREAD_DEFAULT_STREAM__``. Deprecated. +C++20 Concepts with HIP and CUDA + + +In Clang, when working with HIP or CUDA, it's

[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall edited https://github.com/llvm/llvm-project/pull/68738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add check to diagnose coroutine-hostile RAII objects (PR #68738)

2023-10-17 Thread Sam McCall via cfe-commits
@@ -0,0 +1,98 @@ +//===--- CoroutineHostileRAII.cpp - clang-tidy ===// +// +// 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:

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

2023-10-17 Thread Owen Pan via cfe-commits
@@ -3497,6 +3497,15 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const { Tok->setType(TT_TrailingReturnArrow); break; } +if (Tok->isNot(TT_TrailingAnnotation)) owenca wrote: Before: look for _any_

[clang] Correctly link and optimize device libraries with -mlink-builtin-bitcode (PR #69371)

2023-10-17 Thread Jacob Lambert via cfe-commits
lamb-j wrote: > This approach assumes that whatever the function call was transformed into > also exists in the same library, which isn't necessarily true. True, good point. But I don't think it's necessarily due to this approach, but more of how AMDGPULibCalls is implemented. It seems like

[clang] [clang][Sema] Use original template pattern when declaring implicit deduction guides for nested template classes (PR #68379)

2023-10-17 Thread Paul Kirth via cfe-commits
ilovepi wrote: I think your analysis and approach sounds correct, but probably worth checking with someone a bit more familiar with all of the C++ nuance here. https://github.com/llvm/llvm-project/pull/68379 ___ cfe-commits mailing list

[clang] Reapply "[clang analysis][thread-safety] Handle return-by-reference..… (PR #68572)

2023-10-17 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert edited https://github.com/llvm/llvm-project/pull/68572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[clang analysis][thread-safety] Handle return-by-reference..… (PR #68572)

2023-10-17 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert approved this pull request. Assuming that this is otherwise identical to the Phab review. I would suggest to add some release notes (in a separate change). https://github.com/llvm/llvm-project/pull/68572 ___

[clang] [CUDA][HIP] Fix deduction guide (PR #69366)

2023-10-17 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: nvcc behavior can be seen here https://godbolt.org/z/sY1vdYWKe https://godbolt.org/z/vTer7xa3j https://github.com/llvm/llvm-project/pull/69366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [HIP] Document func ptr and virtual func (PR #68126)

2023-10-17 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/68126 >From 52fa4eac701a411699ac0ffa8386b1b23ba9977e Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 3 Oct 2023 12:21:10 -0400 Subject: [PATCH 1/2] [HIP] Document func ptr and virtual func Document clang

[clang] [HIP] Document func ptr and virtual func (PR #68126)

2023-10-17 Thread via cfe-commits
https://github.com/b-sumner commented: Looks good to me. https://github.com/llvm/llvm-project/pull/68126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Implement shadow stack on shadow stack mode with Zicfiss. (PR #68075)

2023-10-17 Thread Craig Topper via cfe-commits
@@ -106,9 +111,14 @@ static void emitSCSEpilogue(MachineFunction , MachineBasicBlock , CSI, [&](CalleeSavedInfo ) { return CSR.getReg() == RAReg; })) return; + const RISCVInstrInfo *TII = STI.getInstrInfo(); + if (STI.hasFeature(RISCV::FeatureStdExtZicfiss))

[clang] [clang][Sema] Use original template pattern when declaring implicit deduction guides for nested template classes (PR #68379)

2023-10-17 Thread via cfe-commits
antangelo wrote: When `SubstType` is called on the `const inner &` parameter to substitute the outer template args, it eventually calls `FindInstantiatedDecl` on the inner template pattern. The presence of the explicit deduction guide causes the outer template to already be instantiated at

[clang] Correctly link and optimize device libraries with -mlink-builtin-bitcode (PR #69371)

2023-10-17 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > You could potentially link in all the symbols and internalize them That probably won't work. After they are internalized, they have internal linkage and cannot be used to resolve newly added call of the same function. The purpose of internalization is to allow you to

[libunwind] [libunwind][test] Avoid calling back into libunwind on sanitizer errors (PR #67861)

2023-10-17 Thread Louis Dionne via cfe-commits
https://github.com/ldionne edited https://github.com/llvm/llvm-project/pull/67861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind][test] Avoid calling back into libunwind on sanitizer errors (PR #67861)

2023-10-17 Thread Louis Dionne via cfe-commits
https://github.com/ldionne requested changes to this pull request. > The underlying issues is fixed in > https://github.com/llvm/llvm-project/pull/67860 but if we ever introduce an > new MSan error inside libunwind we will see the same infinite recursion > because MSan diagnotics try to print

[libunwind] [libunwind][test] Avoid calling back into libunwind on sanitizer errors (PR #67861)

2023-10-17 Thread Louis Dionne via cfe-commits
@@ -28,6 +28,14 @@ if @LIBUNWIND_USES_ARM_EHABI@: if not @LIBUNWIND_ENABLE_THREADS@: config.available_features.add('libunwind-no-threads') +config.extra_executor_env = "" ldionne wrote: Could we instead do something like this? ```diff diff --git

[clang] [clang-format]: Split alignment of declarations around assignment (PR #69340)

2023-10-17 Thread Björn Schäpers via cfe-commits
@@ -18783,6 +18783,15 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) { " \"bb\"};\n" "int bbb = 0;", Alignment); + // http://llvm.org/PR68079 + verifyFormat("using Fn = int (A::*)();\n" +

[clang] [clang-format]: Split alignment of declarations around assignment (PR #69340)

2023-10-17 Thread Björn Schäpers via cfe-commits
@@ -973,13 +974,51 @@ void WhitespaceManager::alignConsecutiveShortCaseStatements() { Changes); } -void WhitespaceManager::alignConsecutiveDeclarations() { +void WhitespaceManager::alignConsecutiveDeclarationsPreAssignment() { if

[clang] [RISCV] Implement shadow stack on shadow stack mode with Zicfiss. (PR #68075)

2023-10-17 Thread Paul Kirth via cfe-commits
@@ -106,9 +111,14 @@ static void emitSCSEpilogue(MachineFunction , MachineBasicBlock , CSI, [&](CalleeSavedInfo ) { return CSR.getReg() == RAReg; })) return; + const RISCVInstrInfo *TII = STI.getInstrInfo(); + if (STI.hasFeature(RISCV::FeatureStdExtZicfiss))

[clang] [SystemZ][z/OS] This change adds support for the PPA2 section in zOS (PR #68926)

2023-10-17 Thread Yusra Syeda via cfe-commits
https://github.com/ysyeda updated https://github.com/llvm/llvm-project/pull/68926 >From 5ea8bea2bdf345e2baee07e0a94ac40bd0f109c4 Mon Sep 17 00:00:00 2001 From: Yusra Syeda Date: Thu, 12 Oct 2023 16:56:27 -0400 Subject: [PATCH 1/7] This change adds support for the PPA2 section in zOS ---

[clang] [Driver] Remove identifier with the comment (PR #68351)

2023-10-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/68351 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Remove identifier with the comment (PR #68351)

2023-10-17 Thread Fangrui Song via cfe-commits
MaskRay wrote: Add `NFC`? https://github.com/llvm/llvm-project/pull/68351 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP] Document func ptr and virtual func (PR #68126)

2023-10-17 Thread Yaxun Liu via cfe-commits
@@ -176,3 +176,95 @@ Predefined Macros * - ``HIP_API_PER_THREAD_DEFAULT_STREAM`` - Alias to ``__HIP_API_PER_THREAD_DEFAULT_STREAM__``. Deprecated. +Compilation Modes += + +Each HIP source file contains intertwined device and host code. Depending on

<    1   2   3