[clang] 8af8602 - [NFC] [Serialization] Unify how LocalDeclID can be created

2024-06-19 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-06-19T15:18:01+08:00 New Revision: 8af86025af2456c70c84aec309cca9a069124671 URL: https://github.com/llvm/llvm-project/commit/8af86025af2456c70c84aec309cca9a069124671 DIFF: https://github.com/llvm/llvm-project/commit/8af86025af2456c70c84aec309cca9a069124671.diff LO

[clang] [llvm] Split fmv and extensions (PR #92882)

2024-06-19 Thread Tomas Matheson via cfe-commits
https://github.com/tmatheson-arm updated https://github.com/llvm/llvm-project/pull/92882 >From b3e9e2f313d3c3a51b7b6690a5cca67a3ec87dd6 Mon Sep 17 00:00:00 2001 From: Tomas Matheson Date: Tue, 18 Jun 2024 22:23:11 +0100 Subject: [PATCH 1/2] [AArch64][TargetParser] Split FMV and extensions ---

[clang] [llvm] [AArch64][TargetParser] Split FMV and extensions (PR #92882)

2024-06-19 Thread Tomas Matheson via cfe-commits
https://github.com/tmatheson-arm edited https://github.com/llvm/llvm-project/pull/92882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][TargetParser] Split FMV and extensions (PR #92882)

2024-06-19 Thread Alexandros Lamprineas via cfe-commits
@@ -13683,9 +13683,9 @@ static std::vector getFMVBackendFeaturesFor( const llvm::SmallVectorImpl &FMVFeatStrings) { std::vector BackendFeats; for (StringRef F : FMVFeatStrings) { -if (auto FMVExt = llvm::AArch64::parseArchExtension(F)) { +if (auto FMVExt = llvm

[clang] [clang][Interp] Implement dynamic memory allocation handling (PR #70306)

2024-06-19 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/70306 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Storing DeclID separately (PR #95897)

2024-06-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/95897 >From b6d1326fdee4f31c6f6e32783c690b7ae2a4dedb Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 18 Jun 2024 11:28:03 +0800 Subject: [PATCH] Draft --- clang/include/clang/AST/DeclID.h | 2 +

[clang] [clang] Fix `static_cast` to array of unknown bound (PR #96041)

2024-06-19 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon created https://github.com/llvm/llvm-project/pull/96041 Per P1975R0 an expression like static_cast(...) defines the type of the expression as U[1]. Fixes https://github.com/llvm/llvm-project/issues/62863 >From df58be94be017265b16999525bed8eb75d4d94d8 Mon Sep 17 00

[clang] [clang] Fix `static_cast` to array of unknown bound (PR #96041)

2024-06-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mariya Podchishchaeva (Fznamznon) Changes Per P1975R0 an expression like static_cast(...) defines the type of the expression as U[1]. Fixes https://github.com/llvm/llvm-project/issues/62863 --- Full diff: https://github.com/llvm/llv

[clang] [Clang][AArch64] Use 'uint64_t*' for _arm_get_sme_state builtin. (PR #95982)

2024-06-19 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/95982 >From a41a740d5e77303febbd4e0cb4d8def2010e32ed Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Tue, 18 Jun 2024 16:04:08 + Subject: [PATCH 1/2] [Clang][AArch64] Use 'uint64_t*' for _arm_get_sme_st

[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-19 Thread Lucas Duarte Prates via cfe-commits
@@ -19,3 +19,19 @@ // RUN: %clang --target=arm64 -mlittle-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s // RUN: %clang --target=arm64 -mlittle-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s // ARM

[clang] [clang] Fix `static_cast` to array of unknown bound (PR #96041)

2024-06-19 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/96041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Refine unused-member-function diagnostic message for constructors (PR #84515)

2024-06-19 Thread via cfe-commits
https://github.com/guillem-bartina-sonarsource updated https://github.com/llvm/llvm-project/pull/84515 >From 473e8bbeaa8bcb4fb313a5cc75cc7a5de5367879 Mon Sep 17 00:00:00 2001 From: guillem-bartina-sonarsource Date: Fri, 8 Mar 2024 17:16:56 +0100 Subject: [PATCH 1/4] [clang][Sema] Refine unused-

[clang] [clang][analyzer] Add notes to PointerSubChecker (PR #95899)

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

[clang] [clang][analyzer] Add notes to PointerSubChecker (PR #95899)

2024-06-19 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM, thanks for the update. I added two minor edit suggestions, but after that the commit can be merged. https://github.com/llvm/llvm-project/pull/95899 ___ cfe-commits mailing list cfe-commits

[clang] [clang][analyzer] Add notes to PointerSubChecker (PR #95899)

2024-06-19 Thread Donát Nagy via cfe-commits
@@ -154,12 +154,14 @@ void PointerSubChecker::checkPreStmt(const BinaryOperator *B, auto R = std::make_unique(BT, Msg_MemRegionDifferent, N); R->addRange(B->getSourceRange()); -if (DiffDeclL) - R->addNote("Array at the left-hand side of subtraction",

[clang] [clang][analyzer] Add notes to PointerSubChecker (PR #95899)

2024-06-19 Thread Donát Nagy via cfe-commits
@@ -32,3 +32,20 @@ void different_2() { int d = p2 - p1; // expected-warning{{Subtraction of two pointers that do not point into the same array is undefined behavior}} \ // expected-note{{Subtraction of two pointers that do not point into the same array is

[clang] [clang][analyzer] Add notes to PointerSubChecker (PR #95899)

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

[clang] [llvm] [RISCV] Add Syntacore SCR3 processor definition (PR #95953)

2024-06-19 Thread Anton Sidorenko via cfe-commits
https://github.com/asi-sc updated https://github.com/llvm/llvm-project/pull/95953 >From 75c4b0d1deb57fb22f9b2446aa8b368c662c38b8 Mon Sep 17 00:00:00 2001 From: Anton Sidorenko Date: Tue, 18 Jun 2024 19:40:54 +0300 Subject: [PATCH 1/2] [RISCV] Add Syntacore SCR3 processor definition Syntacore S

[clang] [llvm] [RISCV] Add Syntacore SCR3 processor definition (PR #95953)

2024-06-19 Thread Anton Sidorenko via cfe-commits
@@ -358,3 +358,21 @@ // RUN: not %clang --target=riscv32 -### -c %s 2>&1 -mcpu=generic-rv32 -march=rv64i | FileCheck -check-prefix=MISMATCH-ARCH %s // MISMATCH-ARCH: cpu 'generic-rv32' does not support rv64 + +// RUN: %clang --target=riscv32 -### -c %s 2>&1 -mcpu=syntacore-sc

[clang] [llvm] [RISCV] Add Syntacore SCR3 processor definition (PR #95953)

2024-06-19 Thread Anton Sidorenko via cfe-commits
@@ -358,3 +358,21 @@ // RUN: not %clang --target=riscv32 -### -c %s 2>&1 -mcpu=generic-rv32 -march=rv64i | FileCheck -check-prefix=MISMATCH-ARCH %s // MISMATCH-ARCH: cpu 'generic-rv32' does not support rv64 + +// RUN: %clang --target=riscv32 -### -c %s 2>&1 -mcpu=syntacore-sc

[clang] [llvm] [RISCV] Add Syntacore SCR3 processor definition (PR #95953)

2024-06-19 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp approved this pull request. https://github.com/llvm/llvm-project/pull/95953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][TargetParser] Split FMV and extensions (PR #92882)

2024-06-19 Thread Tomas Matheson via cfe-commits
https://github.com/tmatheson-arm updated https://github.com/llvm/llvm-project/pull/92882 >From b3e9e2f313d3c3a51b7b6690a5cca67a3ec87dd6 Mon Sep 17 00:00:00 2001 From: Tomas Matheson Date: Tue, 18 Jun 2024 22:23:11 +0100 Subject: [PATCH 1/2] [AArch64][TargetParser] Split FMV and extensions ---

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-19 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Now that you published P3310R0, this test can be moved to DR tests with a status `// cwg2398: 19 drafting P3310R0`. https://github.com/llvm/llvm-project/pull/94981 ___ cfe-commits mailing list cfe-comm

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-06-19 Thread Michael Buch via cfe-commits
Michael137 wrote: Ah got it, thanks for clarifying. > so we could instead just check if the field is empty. Couldn't find an existing API for this on `FieldDecl`. Here "empty" would be "field is of a type which is empty"? Which might still cause complications because a `CXXRecordDecl::isEmpty

[clang-tools-extra] e7b4b43 - [include-cleaner] Use filename as requested, not resolved path

2024-06-19 Thread Kadir Cetinkaya via cfe-commits
Author: Kadir Cetinkaya Date: 2024-06-19T12:04:42+02:00 New Revision: e7b4b437fbbf087ac4955ed5945c3e2f3dd2b702 URL: https://github.com/llvm/llvm-project/commit/e7b4b437fbbf087ac4955ed5945c3e2f3dd2b702 DIFF: https://github.com/llvm/llvm-project/commit/e7b4b437fbbf087ac4955ed5945c3e2f3dd2b702.dif

[clang] [llvm] [AArch64][TargetParser] Split FMV and extensions (PR #92882)

2024-06-19 Thread Tomas Matheson via cfe-commits
https://github.com/tmatheson-arm updated https://github.com/llvm/llvm-project/pull/92882 >From b3e9e2f313d3c3a51b7b6690a5cca67a3ec87dd6 Mon Sep 17 00:00:00 2001 From: Tomas Matheson Date: Tue, 18 Jun 2024 22:23:11 +0100 Subject: [PATCH 1/3] [AArch64][TargetParser] Split FMV and extensions ---

[clang] [flang] [flang] Implement -mcmodel flag (PR #95411)

2024-06-19 Thread Thirumalai Shaktivel via cfe-commits
Thirumalai-Shaktivel wrote: This seems to introduce a `-mcmodel` flag, thanks for that. But, when I do `flang-new -mcmodel=medium x.f90`, I get another unknown argument issue. ```console $ flang-new -mcmodel=medium x.f90 error: unknown argument: '-mlarge-data-threshold=65536' ``` What might be

[clang] [clang] Change style of superseded issues on C++ DR status page (PR #96051)

2024-06-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/96051 This patch changes how superseded issues inherit the color of the issues that superseded them. Now they reduce the opacity of the color from 1.0 to 0.65, to make them distinguishable. This was requested during t

[clang] [clang] Change style of superseded issues on C++ DR status page (PR #96051)

2024-06-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch changes how superseded issues inherit the color of the issues that superseded them. Now they reduce the opacity of the color from 1.0 to 0.65, to make them distinguishable. This was requeste

[clang] [clang-format][NFC] Add CMake target clang-format-check-format (PR #95873)

2024-06-19 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: I have no idea about cmake files and hopefully never will. So I can't say anything on how you did it, I'm fine with what you want to do. https://github.com/llvm/llvm-project/pull/95873 ___ cfe-commits mailing list cfe-commits

[clang] [clang-format] Correctly annotate l_brace after TypenameMacro (PR #96026)

2024-06-19 Thread Björn Schäpers via cfe-commits
@@ -3180,6 +3180,18 @@ TEST_F(TokenAnnotatorTest, FunctionTryBlock) { EXPECT_TOKEN(Tokens[36], tok::l_brace, TT_FunctionLBrace); } +TEST_F(TokenAnnotatorTest, TypenameMacro) { + auto Style = getLLVMStyle(); + Style.TypenameMacros.push_back("STRUCT"); + + auto Tokens = ann

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-19 Thread via cfe-commits
@@ -342,31 +342,33 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { if (DenominatorSize > CharUnits::Zero() && !NumeratorSize.isMultipleOf(DenominatorSize)) { - diag(E->getOperatorLoc(), "suspicious usage of 'sizeof(...)/sizeof(

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-19 Thread via cfe-commits
@@ -342,31 +342,33 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { if (DenominatorSize > CharUnits::Zero() && !NumeratorSize.isMultipleOf(DenominatorSize)) { - diag(E->getOperatorLoc(), "suspicious usage of 'sizeof(...)/sizeof(

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-19 Thread via cfe-commits
@@ -342,31 +342,33 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { if (DenominatorSize > CharUnits::Zero() && !NumeratorSize.isMultipleOf(DenominatorSize)) { - diag(E->getOperatorLoc(), "suspicious usage of 'sizeof(...)/sizeof(

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-19 Thread via cfe-commits
whisperity wrote: Maybe the use of the `:` is indeed problematic, even if that would be the most accurate use of English in the present form, because of its use in the normal text-diagnostic-printing output. (Speaking from the English side of things, a `-` would also be incorrect, you would ne

[clang] [clang] Implement CWG2877 "Type-only lookup for using-enum-declarator" (PR #95399)

2024-06-19 Thread Vlad Serebrennikov via cfe-commits
@@ -738,16 +738,47 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDeclaration( return nullptr; } -if (!Tok.is(tok::identifier)) { +Decl *UED = nullptr; + +if (Tok.is(tok::identifier)) { + IdentifierInfo *IdentInfo = Tok.getIdentifierInfo(); + Sourc

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-19 Thread Donát Nagy via cfe-commits
@@ -393,6 +401,173 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return stateNonNull; } +static std::optional getIndex(ProgramStateRef State, + const ElementRegion *ER, CharKind CK) { + SValBuilder &SValBuilder = St

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/95846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-19 Thread via cfe-commits
@@ -115,3 +116,39 @@ static_assert(!noexcept(typeid((Polymorphic&&) Polymorphic&) Polymorphic{}))); static_assert(!noexcept(typeid(*&(const Polymorphic&) Polymorphic{}))); static_assert(!noexcept(typeid(*&(const Polymorphic&) Polymorphic{}))); + +template +struct X { + templ

[clang] [Clang] [Sema] Ensure noexcept(typeid(E)) checks if E throws when needed (PR #95846)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. Alright, this does look like we’re handling all cases now (that I can think of at least). However, I’d like to see some comments added to `f1`–`f3`, indicating why they’re dependent, because it took me a bit of thinking to figure that out

[clang] [clang] [MinGW] Set a predefined __GXX_TYPEINFO_EQUALITY_INLINE=0 for… (PR #96062)

2024-06-19 Thread Martin Storsjö via cfe-commits
https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/96062 … MinGW targets libstdc++ requires this define to match what is predefined in GCC for the ABI of this platform; GCC hardcodes this define for all mingw configurations in gcc/config/i386/cygming.h. (It also de

[clang] [clang] [MinGW] Set a predefined __GXX_TYPEINFO_EQUALITY_INLINE=0 for… (PR #96062)

2024-06-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Martin Storsjö (mstorsjo) Changes … MinGW targets libstdc++ requires this define to match what is predefined in GCC for the ABI of this platform; GCC hardcodes this define for all mingw configurations in gcc/config/i386/cygming.h. (It a

[clang] [clang] [MinGW] Set a predefined __GXX_TYPEINFO_EQUALITY_INLINE=0 for… (PR #96062)

2024-06-19 Thread Martin Storsjö via cfe-commits
mstorsjo wrote: CC @jwakely https://github.com/llvm/llvm-project/pull/96062 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [FMV] Rectify incomplete ExtensionInfo entries in TargetParser. (PR #89106)

2024-06-19 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea closed https://github.com/llvm/llvm-project/pull/89106 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [FMV] Rectify incomplete ExtensionInfo entries in TargetParser. (PR #89106)

2024-06-19 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: This has become outdated after the recent tablegen refactoring. I'll rethink about it after https://github.com/llvm/llvm-project/pull/92882 lands https://github.com/llvm/llvm-project/pull/89106 ___ cfe-commits mailing list cfe-commits@

[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread Fanbo Meng via cfe-commits
https://github.com/fanbo-meng created https://github.com/llvm/llvm-project/pull/96063 Enabling __ptr32 keyword to support in Clang for z/OS. It is represented by addrspace(1) in LLVM IR. Unlike existing implementation, __ptr32 is not mangled into symbol names for z/OS. >From 8852cfa1c035246d9

[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-systemz @llvm/pr-subscribers-clang Author: Fanbo Meng (fanbo-meng) Changes Enabling __ptr32 keyword to support in Clang for z/OS. It is represented by addrspace(1) in LLVM IR. Unlike existing implementation, __ptr32 is not mangled into symbol n

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

2024-06-19 Thread Alexey Utkin via cfe-commits
alexey-utkin wrote: Where is the documentation for the value? CLion reports `clang-format` option as an error by the reason. No doc, no schema rule. https://github.com/llvm/llvm-project/pull/69814 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 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 0c97ac0a46d0c29fbe5168adcd32e1f25336096d 8852cfa1c035246d970f037866c2a6b290e27d43 --e

[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread Fanbo Meng via cfe-commits
https://github.com/fanbo-meng updated https://github.com/llvm/llvm-project/pull/96063 >From 8852cfa1c035246d970f037866c2a6b290e27d43 Mon Sep 17 00:00:00 2001 From: Fanbo Meng Date: Sat, 21 Mar 2020 10:45:04 -0400 Subject: [PATCH 1/2] __ptr32 support for z/OS Enabling __ptr32 support for z/OS i

[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread Fanbo Meng via cfe-commits
fanbo-meng wrote: code-formatter is complaining about the entire enum table. To be less pervasive, I'll not address that. https://github.com/llvm/llvm-project/pull/96063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang-tools-extra] [clang][include-cleaner]skip stdlib recogntion only when there are defintion with body in main file. (PR #95797)

2024-06-19 Thread kadir çetinkaya via cfe-commits
@@ -39,20 +40,24 @@ Hints declHints(const Decl *D) { } std::vector> locateDecl(const Decl &D) { - std::vector> Result; - // FIXME: Should we also provide physical locations? - if (auto SS = tooling::stdlib::Recognizer()(&D)) { -Result.push_back({*SS, Hints::CompleteSymb

[clang] Add flag to opt out of wasm-opt (PR #95208)

2024-06-19 Thread Quentin Michaud via cfe-commits
mh4ck-Thales wrote: Any opinion on whether to implement a warning or not ? https://github.com/llvm/llvm-project/pull/95208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-19 Thread via cfe-commits
https://github.com/whisperity edited https://github.com/llvm/llvm-project/pull/95550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-19 Thread via cfe-commits
whisperity wrote: (@NagyDonat FYI you have a typo in your commit message, but I think because of the squashing policy it will not matter too much.) https://github.com/llvm/llvm-project/pull/95550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-19 Thread via cfe-commits
https://github.com/whisperity edited https://github.com/llvm/llvm-project/pull/95550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 6244d87 - Avoid object libraries in the VS IDE (#93519)

2024-06-19 Thread via cfe-commits
Author: Michael Kruse Date: 2024-06-19T14:30:01+02:00 New Revision: 6244d87f42775e8d49cf758eeb1909f2ce144e3c URL: https://github.com/llvm/llvm-project/commit/6244d87f42775e8d49cf758eeb1909f2ce144e3c DIFF: https://github.com/llvm/llvm-project/commit/6244d87f42775e8d49cf758eeb1909f2ce144e3c.diff

[clang] [flang] [mlir] Avoid object libraries in the VS IDE (PR #93519)

2024-06-19 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/93519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (PR #95580)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/95580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (PR #95580)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide commented: Moving this into Sema seems like a good idea to me. While we’re at it, we might also want to add a few additional checks for things that—from what I can tell—are currently not supported anyway. https://github.com/llvm/llvm-project/pull/95580 _

[clang] [clang-tools-extra] [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (PR #95580)

2024-06-19 Thread via cfe-commits
@@ -9392,6 +9392,57 @@ ExprResult InitializationSequence::Perform(Sema &S, // Wrap it in a construction of a std::initializer_list. CurInit = new (S.Context) CXXStdInitializerListExpr(Step->Type, MTE); + if (!Step->Type->isDependentType()) { +assert(S.

[clang] [clang-tools-extra] [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (PR #95580)

2024-06-19 Thread via cfe-commits
@@ -10528,48 +10528,37 @@ bool RecordExprEvaluator::VisitCXXStdInitializerListExpr( // Get a pointer to the first element of the array. Array.addArray(Info, E, ArrayType); - auto InvalidType = [&] { -Info.FFDiag(E, diag::note_constexpr_unsupported_layout) - << E

[clang] [clang-tools-extra] [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (PR #95580)

2024-06-19 Thread via cfe-commits
@@ -9392,6 +9392,57 @@ ExprResult InitializationSequence::Perform(Sema &S, // Wrap it in a construction of a std::initializer_list. CurInit = new (S.Context) CXXStdInitializerListExpr(Step->Type, MTE); + if (!Step->Type->isDependentType()) { +assert(S.

[clang] [clang-tools-extra] [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (PR #95580)

2024-06-19 Thread via cfe-commits
@@ -9392,6 +9392,57 @@ ExprResult InitializationSequence::Perform(Sema &S, // Wrap it in a construction of a std::initializer_list. CurInit = new (S.Context) CXXStdInitializerListExpr(Step->Type, MTE); + if (!Step->Type->isDependentType()) { +assert(S.

[clang] [clang-tools-extra] [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (PR #95580)

2024-06-19 Thread via cfe-commits
@@ -12216,6 +12216,9 @@ def err_std_source_location_impl_not_found : Error< def err_std_source_location_impl_malformed : Error< "'std::source_location::__impl' must be standard-layout and have only two 'const char *' fields '_M_file_name' and '_M_function_name', and two integ

[clang] [clang-tools-extra] [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (PR #95580)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/95580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2024-06-19 Thread Sam McCall via cfe-commits
@@ -227,6 +230,7 @@ class PragmaIncludes::RecordPragma : public PPCallbacks, public CommentHandler { IncludedHeader = *File; checkForExport(HashFID, HashLine, std::move(IncludedHeader), File); sam-mccall wrote: Nice catch, thanks! https://github.com

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2024-06-19 Thread Sam McCall via cfe-commits
@@ -379,6 +379,54 @@ TEST_F(PragmaIncludeTest, IWYUKeep) { EXPECT_TRUE(PI.shouldKeep(FM.getFile("std/set").get())); } +TEST_F(PragmaIncludeTest, AssociatedHeader) { + createEmptyFiles({"foo/main.h", "bar/main.h", "bar/other.h", "std/vector"}); + auto IsKeep = [&](llvm::Str

[clang] [Sema] Use llvm::erase_if (NFC) (PR #96068)

2024-06-19 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/96068 While I am at it, I'm constructing SmallVector directly from ArrayRef. >From 85dd4232f6510055a536bd5f7f0ce21a06295dfd Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 19 Jun 2024 06:06:15 -0700 Subje

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2024-06-19 Thread Sam McCall via cfe-commits
@@ -379,6 +379,54 @@ TEST_F(PragmaIncludeTest, IWYUKeep) { EXPECT_TRUE(PI.shouldKeep(FM.getFile("std/set").get())); } +TEST_F(PragmaIncludeTest, AssociatedHeader) { + createEmptyFiles({"foo/main.h", "bar/main.h", "bar/other.h", "std/vector"}); + auto IsKeep = [&](llvm::Str

[clang] [Sema] Use llvm::erase_if (NFC) (PR #96068)

2024-06-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes While I am at it, I'm constructing SmallVector directly from ArrayRef. --- Full diff: https://github.com/llvm/llvm-project/pull/96068.diff 1 Files Affected: - (modified) clang/lib/Sema/SemaOpenACC.cp

[clang] [clang][analyzer] Add notes to PointerSubChecker (PR #95899)

2024-06-19 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/95899 From 1eb6e7ebde0e97e1cd077dc27ffd3ebd6ed0e93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Tue, 18 Jun 2024 10:09:24 +0200 Subject: [PATCH 1/3] [clang][analyzer] Add notes to PointerS

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. Thanks for doing this, LGTM! https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -63,10 +63,10 @@ class IRBuilderDefaultInserter { virtual ~IRBuilderDefaultInserter(); virtual void InsertHelper(Instruction *I, const Twine &Name, -BasicBlock *BB, BasicBlock::iterator InsertPt) const { -if (

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -1460,56 +1184,29 @@ static Value *getAISize(LLVMContext &Context, Value *Amt) { return Amt; } -static Align computeAllocaDefaultAlign(Type *Ty, BasicBlock *BB) { - assert(BB && "Insertion BB cannot be null when alignment not provided!"); +static Align computeAllocaDefa

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -120,7 +120,8 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, Alloca = Builder.CreateAlloca(Ty, ArraySize, Name); else Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), - ArraySize,

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -44,6 +44,23 @@ template <> struct ilist_alloc_traits { iterator_range::iterator> getDbgRecordRange(DbgMarker *); +class InsertPosition { + using InstListType = SymbolTableList, + ilist_parent>; + InstListType::iterator InsertAt; + +p

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -63,10 +63,10 @@ class IRBuilderDefaultInserter { virtual ~IRBuilderDefaultInserter(); virtual void InsertHelper(Instruction *I, const Twine &Name, -BasicBlock *BB, BasicBlock::iterator InsertPt) const { -if (

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2024-06-19 Thread Sam McCall via cfe-commits
sam-mccall wrote: Apologies & thanks all for the pings. I unfortunately won't be active on llvm-project for a while (other work commitments), but I can get this landed. https://github.com/llvm/llvm-project/pull/67228 ___ cfe-commits mailing list cfe-c

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-19 Thread Sander de Smalen via cfe-commits
@@ -286,10 +290,13 @@ let TargetGuard = "sve,f64mm,bf16" in { } let TargetGuard = "sve,bf16" in { + def SVBFMMLA : SInst<"svbfmmla[_{0}]", "MMdd", "b", MergeNone, "aarch64_sve_bfmmla", [IsOverloadNone]>; +} + +let TargetGuard = "(sve,bf16)|sme" in { --

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-19 Thread Sander de Smalen via cfe-commits
@@ -2264,6 +2278,18 @@ let TargetGuard = "sve2p1" in { defm SVPMOV_TO_VEC_LANE_D : PMOV_TO_VEC<"svpmov", "lUl", "aarch64_sve_pmov_to_vector_lane" ,[], ImmCheck1_7>; } +let TargetGuard = "sve2p1|sme2" in { sdesmalen-arm wrote: Good spot! https://github.com

[clang] [Clang][AArch64] Expose compatible SVE intrinsics with only +sme (PR #95787)

2024-06-19 Thread Sander de Smalen via cfe-commits
@@ -1781,7 +1781,12 @@ void SVEEmitter::createStreamingAttrs(raw_ostream &OS, ACLEKind Kind) { uint64_t VerifyRuntimeMode = getEnumValueForFlag("VerifyRuntimeMode"); uint64_t IsStreamingCompatibleFlag = getEnumValueForFlag("IsStreamingCompatible"); + for (auto &De

[clang] [clang] Change style of superseded issues on C++ DR status page (PR #96051)

2024-06-19 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/96051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread Zibi Sarbinowski via cfe-commits
@@ -107,12 +107,14 @@ namespace { KEYMSCOMPAT = 0x40, KEYSYCL = 0x80, KEYCUDA = 0x100, -KEYHLSL = 0x200, -KEYFIXEDPOINT = 0x400, +KEYZOS= 0x200, +KEYNOZOS = 0x400, +KEYHLSL = 0x80

[clang] [clang][analyzer] Add notes to PointerSubChecker (PR #95899)

2024-06-19 Thread Balázs Kéri via cfe-commits
@@ -144,9 +144,24 @@ void PointerSubChecker::checkPreStmt(const BinaryOperator *B, // Allow arithmetic on different symbolic regions. if (isa(SuperLR) || isa(SuperRR)) return; +if (const auto *SuperDLR = dyn_cast(SuperLR)) + DiffDeclL = SuperDLR->getDecl

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2024-06-19 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall updated https://github.com/llvm/llvm-project/pull/67228 >From a736ebb34a31fa0fd1c21a4f03c88d63856fb998 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Sat, 23 Sep 2023 10:44:30 +0200 Subject: [PATCH] [include-cleaner] don't consider the associated header unused Lo

[clang] [clang-format][doc] Add clarification to `PointerAlignment` (PR #96069)

2024-06-19 Thread Eberhard Beilharz via cfe-commits
https://github.com/ermshiperete created https://github.com/llvm/llvm-project/pull/96069 Clarify that `PointerAlignment` is not used if `DerivePointerAlignment` is set to `true`. So far this was only mentioned under `DerivePointerAlignment` which could lead to confusion if someone only looked a

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2024-06-19 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall closed https://github.com/llvm/llvm-project/pull/67228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 5574a58 - [include-cleaner] don't consider the associated header unused (#67228)

2024-06-19 Thread via cfe-commits
Author: Sam McCall Date: 2024-06-19T15:29:05+02:00 New Revision: 5574a5894fdb7f9a46a4fbe6c8970fd39890dc9b URL: https://github.com/llvm/llvm-project/commit/5574a5894fdb7f9a46a4fbe6c8970fd39890dc9b DIFF: https://github.com/llvm/llvm-project/commit/5574a5894fdb7f9a46a4fbe6c8970fd39890dc9b.diff LO

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2024-06-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Sam McCall (sam-mccall) Changes Loosely, the "associated header" of `foo.cpp` is `foo.h`. It should be included, many styles include it first. So far we haven't special cased it in any way, and require this include to be justif

[clang] [clang-format][doc] Add clarification to `PointerAlignment` (PR #96069)

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

[clang] [clang-format][doc] Add clarification to `PointerAlignment` (PR #96069)

2024-06-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Eberhard Beilharz (ermshiperete) Changes Clarify that `PointerAlignment` is not used if `DerivePointerAlignment` is set to `true`. So far this was only mentioned under `DerivePointerAlignment` which could lead to confusion if someone only

[clang] [clang][Interp] Implement dynamic memory allocation handling (PR #70306)

2024-06-19 Thread Timm Baeder via cfe-commits
@@ -2544,6 +2544,85 @@ bool ByteCodeExprGen::VisitCXXInheritedCtorInitExpr( return this->emitCall(F, 0, E); } +template +bool ByteCodeExprGen::VisitCXXNewExpr(const CXXNewExpr *E) { + assert(classifyPrim(E->getType()) == PT_Ptr); + const Expr *Init = E->getInitializer();

[clang] [clang] Change style of superseded issues on C++ DR status page (PR #96051)

2024-06-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/96051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

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

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-19 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat requested changes to this pull request. Thanks for the updates! Unfortunately, as I dug deeper into your function `getOriginRegion()`, I realized that it is logically incorrect (see inline comment for explanation). (I was a bit suspicious during the earlier reviews

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-19 Thread Donát Nagy via cfe-commits
@@ -393,6 +401,162 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return stateNonNull; } +static std::optional getIndex(ProgramStateRef State, + const ElementRegion *ER, CharKind CK) { + SValBuilder &SVB = State->get

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-19 Thread Donát Nagy via cfe-commits
@@ -393,6 +401,162 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return stateNonNull; } +static std::optional getIndex(ProgramStateRef State, + const ElementRegion *ER, CharKind CK) { + SValBuilder &SVB = State->get

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/89078 >From c611122688657287e8285edd9a2875e4975d26dd Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 17 Apr 2024 16:15:39 +0200 Subject: [PATCH 01/11] [Clang] Disallow explicit object parameters in more contexts

  1   2   3   >