[clang] [flang] [flang] Align `-x f95[-cpp-input]` language modes with `gfortran` (PR #127986)

2025-02-21 Thread Iñaki Amatria Barral via cfe-commits
https://github.com/inaki-amatria edited https://github.com/llvm/llvm-project/pull/127986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-02-21 Thread via cfe-commits
https://github.com/realqhc edited https://github.com/llvm/llvm-project/pull/123271 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][OpenMP] Upstream `do concurrent` loop-nest detection. (PR #127595)

2025-02-21 Thread Kareem Ergawy via cfe-commits
ergawy wrote: Thanks @skatrak and @bhandarkar-pranav for the approval. @kiranchandramohan @clementval I think there is a pretty simple solution that enables us to mark multi-range loop nests. I think we can add an optional attribute to the `fir::DoLoopOp` to store the loop nest depth: `nest_de

[clang] [clang-tools-extra] [Clang] Default the warning for chained comparison to an error. (PR #128145)

2025-02-21 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/128145 >From 55dcf33ba907e8c273ee3dfe196b71bc4b70c325 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Fri, 21 Feb 2025 08:41:07 +0100 Subject: [PATCH] [Clang] Default the warning for chained comparison to an erro

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/18556

[clang] [clang][LoongArch] Add OHOS target (PR #127555)

2025-02-21 Thread Lu Weining via cfe-commits
SixWeining wrote: > > Could you add some tests in ohos.c with the `--sysroot` option specified? > > Could I confirm what the test targeting the `--sysroot` option is for? Is it > also intended to test the `page-size`? I mean the purpose is to check whether clang driver passes correct options t

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/128141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 97ed201 - [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (#128141)

2025-02-21 Thread via cfe-commits
Author: Timm Baeder Date: 2025-02-21T09:47:08+01:00 New Revision: 97ed2019c41f2c0208699ab3593b681487754d58 URL: https://github.com/llvm/llvm-project/commit/97ed2019c41f2c0208699ab3593b681487754d58 DIFF: https://github.com/llvm/llvm-project/commit/97ed2019c41f2c0208699ab3593b681487754d58.diff L

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `arc-builder` running on `arc-worker` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/3/builds/12085 Here is the relevant piece of

[clang] [clang-tools-extra] [Clang] Default the warning for chained comparison to an error. (PR #128145)

2025-02-21 Thread via cfe-commits
cor3ntin wrote: I wonder if we should remove the `bugprone-chained-comparison` tidy check - not sure there is value in both clang and clang tidy having the same warning. But I don't know what our policy is in that regard. https://github.com/llvm/llvm-project/pull/128145 ___

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-x86_64-debian-dylib` running on `gribozavr4` while building `clang` at step 6 "test-build-unified-tree-check-clang". Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/20112 Here is the r

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-quick` running on `linaro-clang-aarch64-quick` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/65/builds/12598 Here is the relevant pie

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-x86_64-debian-fast` running on `gribozavr4` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/56/builds/19108 Here is the rel

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-sles-build-only` running on `rocm-worker-hw-04-sles` while building `clang` at step 6 "Add check check-clang". Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/17437 Here is

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-m68k-linux-cross` running on `suse-gary-m68k-cross` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/6449 Here is the relevant piece o

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-02-21 Thread Oliver Hunt via cfe-commits
ojhunt wrote: These updates in principle bring the major semantics up to match P2719r4 Primary changes: * CV qualifiers are dropped * size and alignment parameters become mandatory, semantics for placement cleanup are updated to permit this, and to permit cleanup when the cleanup operator dele

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-21 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Thank you very much for checking! If you have any other comments please let me know. https://github.com/llvm/llvm-project/pull/127837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-21 Thread David Green via cfe-commits
davemgreen wrote: It probably needs to not happen with -fno-unaligned-access (or +strict-align), unless the load / store is known to be 16byte aligned. See https://github.com/llvm/llvm-project/issues/119732 from recently. (Also I guess they shouldn't work in BE, but I believe that is not suppo

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-21 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Thanks for the pointer, @davemgreen. You're right, with `+strict-align` this has to be 16B aligned. This is also only valid for LE, but this should already be enforced. https://github.com/llvm/llvm-project/pull/127837 ___ cfe-commits m

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-21 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -179,8 +181,41 @@ bool CoreEngine::ExecuteWorkList(const LocationContext *L, unsigned MaxSteps, return WList->hasWork(); } -void CoreEngine::dispatchWorkItem(ExplodedNode* Pred, ProgramPoint Loc, - const WorkListUnit& WU) { +static std::s

[clang] [clang][LoongArch] Add OHOS target (PR #127555)

2025-02-21 Thread via cfe-commits
@@ -235,3 +235,24 @@ // CHECK-OHOS-PTHREAD-NOT: -lpthread +// RUN: %clang -### --target=aarch64-linux-ohos %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-MAXPAGESIZE-4KB %s +// RUN: %clang -### --target=aarch64-none-linux-gnu %s 2>&1 | \ +// RUN: FileCheck --check-pr

[clang] [clang][LoongArch] Add OHOS target (PR #127555)

2025-02-21 Thread via cfe-commits
Ami-zhang wrote: > Could you add some tests in ohos.c with the `--sysroot` option specified? Could I confirm what the test targeting the `--sysroot` option is for? Is it also intended to test the `page-size`? https://github.com/llvm/llvm-project/pull/127555

[clang] [clang][LoongArch] Add OHOS target (PR #127555)

2025-02-21 Thread Lu Weining via cfe-commits
@@ -235,3 +235,24 @@ // CHECK-OHOS-PTHREAD-NOT: -lpthread +// RUN: %clang -### --target=aarch64-linux-ohos %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-MAXPAGESIZE-4KB %s +// RUN: %clang -### --target=aarch64-none-linux-gnu %s 2>&1 | \ +// RUN: FileCheck --check-pr

[clang] ad3f7d2 - [clang][bytecode][test] Qualify a std::move call

2025-02-21 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2025-02-21T09:57:16+01:00 New Revision: ad3f7d2c71b062dd1c2fb1fa78e81cc7b3ba53e9 URL: https://github.com/llvm/llvm-project/commit/ad3f7d2c71b062dd1c2fb1fa78e81cc7b3ba53e9 DIFF: https://github.com/llvm/llvm-project/commit/ad3f7d2c71b062dd1c2fb1fa78e81cc7b3ba53e9.diff LO

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `premerge-monolithic-linux` running on `premerge-linux-1` while building `clang` at step 7 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/23495 Here is

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-armv8-quick` running on `linaro-clang-armv8-quick` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/154/builds/12194 Here is the relevant piece o

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-02-21 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127568 >From 2c9e6e45944891af54cba9648297a996bb4d8cca Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 18 Feb 2025 14:03:35 +0800 Subject: [PATCH 1/2] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-co

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-cmake-x86_64-avx512-linux` running on `avx512-intel64` while building `clang` at step 7 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/133/builds/11681 Here is the relevant pi

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-win` running on `sie-win-worker` while building `clang` at step 7 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/46/builds/12418 Here is th

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-aarch64-darwin` running on `doug-worker-4` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/15046 Here is th

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-02-21 Thread A. Jiang via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -verify -fms-compatibility frederick-vs-ja wrote: Added. I decided to add the positive and negative tests together. Luckily, UCRT's `` selects `__builtin_offsetof` when `_MSC_VER` isn't

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-gcc-ubuntu` running on `sie-linux-worker3` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/13387 Her

[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-02-21 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/128150 Currently, clang-tidy processes the entire TranslationUnit, including declarations in system headers. However, the work done in system headers is discarded at the very end when presenting results, unless

[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-02-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy @llvm/pr-subscribers-clang-tools-extra Author: Carlos Galvez (carlosgalvezp) Changes Currently, clang-tidy processes the entire TranslationUnit, including declarations in system headers. However, the work done in system headers is discarded

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-debian-cpp20` running on `clang-debian-cpp20` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/108/builds/9569 Here is the r

[clang] [flang] [flang][Driver] Add support of -fd-lines-as-comments and -fd-lines-as-code flags (PR #127605)

2025-02-21 Thread Jean-Didier PAILLEUX via cfe-commits
https://github.com/JDPailleux updated https://github.com/llvm/llvm-project/pull/127605 >From 75c8eb0bf27529c629da02b140502e7557b9be46 Mon Sep 17 00:00:00 2001 From: Jean-Didier Pailleux Date: Tue, 18 Feb 2025 10:12:32 +0100 Subject: [PATCH] [flang][Driver] Add support of -fd-lines-as-comments a

[clang] [clang][bytecode] Use ExtendingDecl mechanism for primitives as well (PR #128141)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-ppc64le-linux-test-suite` running on `ppc64le-clang-test-suite` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/95/builds/987

[clang] [Clang] Implement CWG2918 'Consideration of constraints for address of overloaded function' (PR #127773)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -1773,20 +1773,19 @@ bool Sema::IsAtLeastAsConstrained(NamedDecl *D1, NamedDecl *D2, MutableArrayRef AC2, bool &Result) { +#ifndef NDEBUG if (const auto *FD1 = dyn_cast(D

[clang] Reapply "[Analyzer][CFG] Correctly handle rebuilt default arg and default init expression" (PR #127338)

2025-02-21 Thread Jan Voung via cfe-commits
jvoung wrote: In case others notice similar in ClangTidy (`bugprone-unchecked-optional-access`), we are seeing crashes after this change https://github.com/llvm/llvm-project/issues/128068 I'm not yet sure the best fix. https://github.com/llvm/llvm-project/pull/127338 _

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -331,9 +335,38 @@ FuncType FuncType::clone(TypeRange inputs, TypeRange results) const { return get(llvm::to_vector(inputs), results[0], isVarArg()); } -mlir::ParseResult parseFuncTypeArgs(mlir::AsmParser &p, -llvm::SmallVector ¶ms, -

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-21 Thread Denis Mikhailov via cfe-commits
@@ -0,0 +1,130 @@ +//===--- AmbiguousSmartptrResetCallCheck.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: Ap

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -2862,6 +2862,30 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const { } } +bool QualType::isCppTriviallyRelocatableType(const ASTContext &Context) const { + QualType BaseElementType = Context.getBaseElementType(*this); + if (BaseElementType->

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -1057,12 +1057,24 @@ def ext_ms_abstract_keyword : ExtWarn< "'abstract' keyword is a Microsoft extension">, InGroup; +def ext_relocatable_keyword : ExtWarn< + "'%select{trivially_relocatable|replaceable}0_if_eligible' " + "keyword is a C++2c extension">, + InGroup; +

[clang] 4d6167e - [Clang] [Tests] Canonicalise CLANG_ENABLE_OBJC_REWRITER properly (#125117)

2025-02-21 Thread via cfe-commits
Author: Sirraide Date: 2025-02-21T15:37:57+01:00 New Revision: 4d6167ed96d324cb1decb350c6d6d31090182040 URL: https://github.com/llvm/llvm-project/commit/4d6167ed96d324cb1decb350c6d6d31090182040 DIFF: https://github.com/llvm/llvm-project/commit/4d6167ed96d324cb1decb350c6d6d31090182040.diff LOG:

[clang] [Clang] [Tests] Canonicalise CLANG_ENABLE_OBJC_REWRITER properly (PR #125117)

2025-02-21 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/125117 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -7258,6 +7261,221 @@ void Sema::CheckCompletedCXXClass(Scope *S, CXXRecordDecl *Record) { } } +static bool hasSuitableConstructorForReplaceability(CXXRecordDecl *D, +bool Implicit) { + assert(D->hasDefinition() && !D->

[clang] b732e14 - [Clang] Default the warning for chained comparison to an error. (#128145)

2025-02-21 Thread via cfe-commits
Author: cor3ntin Date: 2025-02-21T15:52:09+01:00 New Revision: b732e14cb5681abff78e3873987a2a8b39549c83 URL: https://github.com/llvm/llvm-project/commit/b732e14cb5681abff78e3873987a2a8b39549c83 DIFF: https://github.com/llvm/llvm-project/commit/b732e14cb5681abff78e3873987a2a8b39549c83.diff LOG:

[clang] [Clang] [Tests] Canonicalise CLANG_ENABLE_OBJC_REWRITER properly (PR #125117)

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

[clang] [clang-tools-extra] [Clang] Default the warning for chained comparison to an error. (PR #128145)

2025-02-21 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/128145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-02-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! When landing, please add a release note to `clang/docs/ReleaseNotes.rst` so users know about the change. https://github.com/llvm/llvm-project/pull/127568 ___ cfe-commits mailing list cf

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -0,0 +1,272 @@ +// RUN: %clang_cc1 -std=c++2c -verify %s + +class Trivial {}; +struct NonRelocatable { +~NonRelocatable(); +}; +static NonRelocatable NonRelocatable_g; + +class A trivially_relocatable_if_eligible {}; +class B trivially_relocatable_if_eligible : Trivial{}; +

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -0,0 +1,272 @@ +// RUN: %clang_cc1 -std=c++2c -verify %s + +class Trivial {}; +struct NonRelocatable { +~NonRelocatable(); +}; +static NonRelocatable NonRelocatable_g; + +class A trivially_relocatable_if_eligible {}; +class B trivially_relocatable_if_eligible : Trivial{}; +

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -1875,6 +1875,54 @@ static ExprResult BuiltinIsWithinLifetime(Sema &S, CallExpr *TheCall) { << 0; return ExprError(); } + return TheCall; +} + +static ExprResult BuiltinTriviallyRelocate(Sema &S, CallExpr *TheCall) { + if (S.checkArgCount(TheCall, 3)) +r

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -2692,16 +2693,75 @@ bool Parser::isCXX11FinalKeyword() const { Specifier == VirtSpecifiers::VS_Sealed; } +bool Parser::isCXX2CTriviallyRelocatableKeyword(Token Tok) const { + if (!getLangOpts().CPlusPlus || Tok.isNot(tok::identifier)) +return false; + if (!I

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -1875,6 +1875,54 @@ static ExprResult BuiltinIsWithinLifetime(Sema &S, CallExpr *TheCall) { << 0; return ExprError(); } + return TheCall; +} + +static ExprResult BuiltinTriviallyRelocate(Sema &S, CallExpr *TheCall) { + if (S.checkArgCount(TheCall, 3)) +r

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -7258,6 +7261,221 @@ void Sema::CheckCompletedCXXClass(Scope *S, CXXRecordDecl *Record) { } } +static bool hasSuitableConstructorForReplaceability(CXXRecordDecl *D, +bool Implicit) { + assert(D->hasDefinition() && !D->

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -0,0 +1,272 @@ +// RUN: %clang_cc1 -std=c++2c -verify %s + +class Trivial {}; +struct NonRelocatable { +~NonRelocatable(); +}; +static NonRelocatable NonRelocatable_g; + +class A trivially_relocatable_if_eligible {}; +class B trivially_relocatable_if_eligible : Trivial{}; +

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -0,0 +1,272 @@ +// RUN: %clang_cc1 -std=c++2c -verify %s + +class Trivial {}; +struct NonRelocatable { +~NonRelocatable(); +}; +static NonRelocatable NonRelocatable_g; + +class A trivially_relocatable_if_eligible {}; +class B trivially_relocatable_if_eligible : Trivial{}; +

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/127636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-21 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/127191 From 1f2ad6d5ce6f11fb031ec2175527f56ea86761ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Feb 2025 15:35:31 +0100 Subject: [PATCH 1/5] [clang][analyzer] Add checker 'alpha.c

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -7258,6 +7261,221 @@ void Sema::CheckCompletedCXXClass(Scope *S, CXXRecordDecl *Record) { } } +static bool hasSuitableConstructorForReplaceability(CXXRecordDecl *D, +bool Implicit) { + assert(D->hasDefinition() && !D->

[clang] [clang-tools-extra] [Clang] Default the warning for chained comparison to an error. (PR #128145)

2025-02-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I think this is a great idea to do now, if we have to revert it, it is information for the WG21 paper. BUT I think this is completely reasonable. https://github.com/llvm/llvm-project/pull/128145 _

[clang] [CIR] Initial implementation of lowering CIR to MLIR (PR #127835)

2025-02-21 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,201 @@ +//- LowerCIRToMLIR.cpp - Lowering from CIR to MLIR ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] Reapply "[Analyzer][CFG] Correctly handle rebuilt default arg and default init expression" (PR #127338)

2025-02-21 Thread via cfe-commits
yronglin wrote: > In case others notice similar in ClangTidy > (`bugprone-unchecked-optional-access`), we are seeing crashes after this > change #128068 > > I'm not yet sure the best fix. Can you try to revert this change to see if the crash issue can be fixed? It looks like I missing some c

[clang] [CIR] Initial implementation of lowering CIR to MLIR (PR #127835)

2025-02-21 Thread Andrzej Warzyński via cfe-commits
@@ -2958,6 +2958,8 @@ defm clangir : BoolFOption<"clangir", BothFlags<[], [ClangOption, CC1Option], "">>; def emit_cir : Flag<["-"], "emit-cir">, Visibility<[ClangOption, CC1Option]>, Group, HelpText<"Build ASTs and then lower to ClangIR">; +def emit_cir_mlir : Flag<["-"],

[clang] [clang][dataflow] Add test repro for a crash (PR #128065)

2025-02-21 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/128065 >From a7002fb5a61c2f6f3c4df2347b6d5f861bf45f8e Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 20 Feb 2025 19:40:16 + Subject: [PATCH 1/3] [clang][dataflow] Add test repro for a crash An issue with looki

[clang] Reapply "[Analyzer][CFG] Correctly handle rebuilt default arg and default init expression" (PR #127338)

2025-02-21 Thread via cfe-commits
yronglin wrote: > Thanks for the warning! It's a cool feature, but the diagnostic is IMHO not > super great at the moment. > > I'm doing the cleanup for the warning in Chromium at the moment, and here's > an example that's now analyzed (from > https://source.chromium.org/chromium/chromium/src

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -127,6 +127,33 @@ class AccessSpecDecl : public Decl { static bool classofKind(Kind K) { return K == AccessSpec; } }; +enum class RelocatableOrReplaceableClassSpecifierKind { + Relocatable, + Replaceable +}; + +template +class BasicRelocatableOrReplaceableClassSpecifie

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -2692,16 +2693,75 @@ bool Parser::isCXX11FinalKeyword() const { Specifier == VirtSpecifiers::VS_Sealed; } +bool Parser::isCXX2CTriviallyRelocatableKeyword(Token Tok) const { + if (!getLangOpts().CPlusPlus || Tok.isNot(tok::identifier)) +return false; + if (!I

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-21 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > As for next steps, I think we need a broader community discussion on this, so > I would recommend an RFC proposing an approach. I don't know whether that's > changing the behavior of `__has_builtin`, proposing `__can_use_builtin` and > deprecating `__has_builtin`, or something

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -3808,13 +3866,39 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, SourceLocation AbstractLoc; bool IsFinalSpelledSealed = false; bool IsAbstract = false; + TriviallyRelocatableSpecifier TriviallyRelocatable; + ReplaceableSpecifier Replacable;

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -3808,13 +3866,39 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, SourceLocation AbstractLoc; bool IsFinalSpelledSealed = false; bool IsAbstract = false; + TriviallyRelocatableSpecifier TriviallyRelocatable; + ReplaceableSpecifier Replacable;

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -1057,12 +1057,24 @@ def ext_ms_abstract_keyword : ExtWarn< "'abstract' keyword is a Microsoft extension">, InGroup; +def ext_relocatable_keyword : ExtWarn< + "'%select{trivially_relocatable|replaceable}0_if_eligible' " + "keyword is a C++2c extension">, + InGroup; +

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -1057,12 +1057,24 @@ def ext_ms_abstract_keyword : ExtWarn< "'abstract' keyword is a Microsoft extension">, InGroup; +def ext_relocatable_keyword : ExtWarn< + "'%select{trivially_relocatable|replaceable}0_if_eligible' " erichkeane wrote: Please put th

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -1826,6 +1827,12 @@ The following type trait primitives are supported by Clang. Those traits marked functionally equivalent to copying the underlying bytes and then dropping the source object on the floor. This is true of trivial types and types which were made trivia

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +409,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +409,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [llvm] [Clang][LLVM] Implement single-single vectors MOP4{A/S} (PR #127797)

2025-02-21 Thread Virginia Cangelosi via cfe-commits
https://github.com/virginia-cangelosi converted_to_draft https://github.com/llvm/llvm-project/pull/127797 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -1826,6 +1827,12 @@ The following type trait primitives are supported by Clang. Those traits marked functionally equivalent to copying the underlying bytes and then dropping the source object on the floor. This is true of trivial types and types which were made trivia

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -3808,13 +3866,39 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, SourceLocation AbstractLoc; bool IsFinalSpelledSealed = false; bool IsAbstract = false; + TriviallyRelocatableSpecifier TriviallyRelocatable; + ReplaceableSpecifier Replacable;

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-21 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,130 @@ +//===--- AmbiguousSmartptrResetCallCheck.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: Ap

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread via cfe-commits
@@ -2862,6 +2862,30 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const { } } +bool QualType::isCppTriviallyRelocatableType(const ASTContext &Context) const { + QualType BaseElementType = Context.getBaseElementType(*this); Sirraid

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -3625,6 +3632,21 @@ Query for this feature with ``__has_builtin(__builtin_operator_new)`` or replaceable global (de)allocation functions, but do support calling at least ``::operator new(size_t)`` and ``::operator delete(void*)``. + +``__builtin_trivially_relocate

[clang] [llvm] [polly] [DAG] shouldReduceLoadWidth - hasOneUse should check just the loaded value - not the chain (PR #128167)

2025-02-21 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/128167 >From e73c264d0937a11fd3b08ac18a6465c6826d31f1 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 21 Feb 2025 11:57:07 + Subject: [PATCH 1/3] [DAG] shouldReduceLoadWidth - hasOneUse check for just be f

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-21 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,130 @@ +//===--- AmbiguousSmartptrResetCallCheck.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: Ap

[clang] [CLANG-CL] Remove the 'static' declaration specifier for _FUNCTION_ in (PR #128184)

2025-02-21 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/128184 MSVC mode. >From bcf2a4708c3f9ae88f5fddafe02c95533601c887 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Fri, 21 Feb 2025 07:14:02 -0800 Subject: [PATCH] [CLANG-CL] Remove the 'static' declaration sp

[clang] [CLANG-CL] Remove the 'static' specifier for _FUNCTION_ in MSVC mode. (PR #128184)

2025-02-21 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/128184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Check for mutability better (PR #127843)

2025-02-21 Thread Devon Loehr via cfe-commits
https://github.com/DKLoehr updated https://github.com/llvm/llvm-project/pull/127843 >From 7a919e29b221f1070c420e263760b7071dc01da8 Mon Sep 17 00:00:00 2001 From: Devon Loehr Date: Thu, 20 Feb 2025 15:19:13 + Subject: [PATCH 1/3] Implement mutable check in Sema --- clang/lib/Sema/SemaDecl.

[clang] Remove xbegin and _xend (PR #126952)

2025-02-21 Thread Devon Loehr via cfe-commits
DKLoehr wrote: Just checking in, this was approved a few days ago but hasn't been merged yet. https://github.com/llvm/llvm-project/pull/126952 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] Check for mutability better (PR #127843)

2025-02-21 Thread Devon Loehr via cfe-commits
DKLoehr wrote: Good call, changed. https://github.com/llvm/llvm-project/pull/127843 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Default the warning for chained comparison to an error. (PR #128145)

2025-02-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-cmake-x86_64-avx512-linux` running on `avx512-intel64` while building `clang-tools-extra,clang` at step 13 "test-suite". Full details are available at: https://lab.llvm.org/buildbot/#/builders/133/builds/11692 Here is

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

2025-02-21 Thread Haojian Wu via cfe-commits
hokein wrote: Another thought for supporting the `emplace_back(Args...)` case (for STL only). The underlying implementation of the `emplace_back` relies on `std::allocator_traits::construct(Alloc& a, T* p, Args&&... args)`, so we could use the `lifetime_capture_by` annotation in the instantia

[clang] d2d1f14 - [z/OS] Add option to target older versions of LE on z/OS (#123399)

2025-02-21 Thread via cfe-commits
Author: Sean Perry Date: 2025-02-21T10:30:35-05:00 New Revision: d2d1f143e5087e9490416bd98e49fd2f8fb5dd01 URL: https://github.com/llvm/llvm-project/commit/d2d1f143e5087e9490416bd98e49fd2f8fb5dd01 DIFF: https://github.com/llvm/llvm-project/commit/d2d1f143e5087e9490416bd98e49fd2f8fb5dd01.diff LO

[clang] [z/OS] Add option to target older versions of LE on z/OS (PR #123399)

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

[clang] [CLANG-CL] Remove the 'static' specifier for _FUNCTION_ in MSVC mode. (PR #128184)

2025-02-21 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/128184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-02-21 Thread via cfe-commits
@@ -339,6 +339,35 @@ class ClangTidyASTConsumer : public MultiplexConsumer { void anchor() override {}; }; +/// ASTConsumer that filters top-level declarations that are in system headers, +/// and sets the AST traversal scope to only cover the declarations in user +/// heade

[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-02-21 Thread via cfe-commits
@@ -339,6 +339,35 @@ class ClangTidyASTConsumer : public MultiplexConsumer { void anchor() override {}; }; +/// ASTConsumer that filters top-level declarations that are in system headers, +/// and sets the AST traversal scope to only cover the declarations in user +/// heade

[clang] 6dca33c - Check for mutability better (#127843)

2025-02-21 Thread via cfe-commits
Author: Devon Loehr Date: 2025-02-21T16:41:04+01:00 New Revision: 6dca33ce20693381beab9817c12d512dfdac0b02 URL: https://github.com/llvm/llvm-project/commit/6dca33ce20693381beab9817c12d512dfdac0b02 DIFF: https://github.com/llvm/llvm-project/commit/6dca33ce20693381beab9817c12d512dfdac0b02.diff L

[clang] Check for mutability better (PR #127843)

2025-02-21 Thread Hans Wennborg via cfe-commits
https://github.com/zmodem closed https://github.com/llvm/llvm-project/pull/127843 ___ 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 new check `readability-use-numeric-limits` (PR #127430)

2025-02-21 Thread Katherine Whitlock via cfe-commits
@@ -0,0 +1,164 @@ +//===--- UseNumericLimitsCheck.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: Ap

  1   2   3   4   5   >