[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
@@ -206,3 +208,124 @@ void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(::new (SemaRef.Context) SYCLKernelEntryPointAttr(SemaRef.Context, AL, TSI)); } + +static SourceLocation SourceLocationForType(QualType QT) { + Source

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
@@ -15978,6 +15988,24 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, CheckCoroutineWrapper(FD); } + // Diagnose invalid SYCL kernel entry point function declarations. + if (FD && !FD->isInvalidDecl() && !FD->isTemplated() && + FD->hasAttr()) { +

[clang] [Coverage] Introduce the type `CounterPair` for RegionCounterMap. NFC. (PR #112724)

2024-12-23 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/112724 >From e4172ca273a6fdfcbfc4662c9e37276ef34c2df4 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 17 Oct 2024 00:32:26 +0900 Subject: [PATCH 1/5] Introduce the type `CounterPair` for RegionCounterMap `Co

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-23 Thread Stephen Senran Zhang via cfe-commits
zsrkmyn wrote: > > I'm thinking if I need to add a new test mode to test the optimal lower > > (upper) bound only for AND (OR). > > If you cannot make it optimal for all non-wrapped cases, please just add some > special cases (e.g., `[7, 14) & [-1, 0) = [7, 14)`) before > `TestBinaryOpExhaust

[clang] [clang-format] Skip line splices when sorting C++ includes (PR #120680)

2024-12-23 Thread Owen Pan via cfe-commits
@@ -3246,8 +3246,15 @@ tooling::Replacements sortCppIncludes(const FormatStyle &Style, StringRef Code, SmallVector RawStringMatches; std::string RawStringTermination = ")\""; - for (;;) { -auto Pos = Code.find('\n', SearchFrom); + for (const auto Size = Code.size();

[clang] [clang][RISCV] Remove unneeded RISCV tuple code (PR #121024)

2024-12-23 Thread Brandon Wu via cfe-commits
https://github.com/4vtomat created https://github.com/llvm/llvm-project/pull/121024 These code are no longer needed because we've modeled tuple type using target extension type rather than structure of scalable vectors. >From 72401387483dd5839d09f508c1bc988325c5e456 Mon Sep 17 00:00:00 2001 Fr

[clang] [clang-format] extend clang-format directive with options to prevent formatting for one line (PR #118566)

2024-12-23 Thread Owen Pan via cfe-commits
owenca wrote: > A nice multiline example I stumbled upon is: > > ```c++ > Tree tree[] > { > {'D', tree + 1, tree + 2}, > //│ > //┌───┴┐ > //│

[clang] [clang][RISCV] Remove unneeded RISCV tuple code (PR #121024)

2024-12-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Brandon Wu (4vtomat) Changes These code are no longer needed because we've modeled tuple type using target extension type rather than structure of scalable vectors. --- Full diff: https://github.com/llvm/llvm-project/pull/121024.diff 2

[clang] [clang][RISCV] Remove unneeded RISCV tuple code (PR #121024)

2024-12-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-backend-risc-v Author: Brandon Wu (4vtomat) Changes These code are no longer needed because we've modeled tuple type using target extension type rather than structure of scalable vectors. --- Full diff: https://github

[clang] Add `pragma clang scope [push|pop]` (PR #121025)

2024-12-23 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/121025 Have you ever had that horrible realization that some header you included defines a macro that matches a commonly used word that appears throughout your codebase? What kind of horrible person would define `m

[clang] [clang][RISCV] Remove unneeded RISCV tuple code (PR #121024)

2024-12-23 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp approved this pull request. LGTM. Nice cleanup. https://github.com/llvm/llvm-project/pull/121024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add `pragma clang scope [push|pop]` (PR #121025)

2024-12-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Chris B (llvm-beanz) Changes Have you ever had that horrible realization that some header you included defines a macro that matches a commonly used word that appears throughout your codebase? What kind of horrible person would define `max

[clang] Add `pragma clang scope [push|pop]` (PR #121025)

2024-12-23 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 2c95e60df53ba1a5765b3fad9e8ddaff70f21994 5433a9134beb8faf1e2b662c96f76d7e8bc814de --e

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
@@ -12408,6 +12408,29 @@ def err_sycl_special_type_num_init_method : Error< "types with 'sycl_special_class' attribute must have one and only one '__init' " "method defined">; +// SYCL kernel entry point diagnostics +def err_sycl_entry_point_invalid : Error< + "'sycl_ker

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
@@ -206,3 +208,124 @@ void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(::new (SemaRef.Context) SYCLKernelEntryPointAttr(SemaRef.Context, AL, TSI)); } + +static SourceLocation SourceLocationForType(QualType QT) { + Source

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
@@ -206,3 +208,124 @@ void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(::new (SemaRef.Context) SYCLKernelEntryPointAttr(SemaRef.Context, AL, TSI)); } + +static SourceLocation SourceLocationForType(QualType QT) { + Source

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-23 Thread Stephen Senran Zhang via cfe-commits
zsrkmyn wrote: Ah, by applying the patch below, I just found the lower bound is still not optimal for non-wrapped cases. E.g., for 4-bit ints, given 2 ranges, ``` [0011, ] [1101, ] ``` the optimal lower bound is 1, while the algorithm gives 0. ```diff diff --git a/llvm/unittests/IR/Co

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
@@ -12408,6 +12408,29 @@ def err_sycl_special_type_num_init_method : Error< "types with 'sycl_special_class' attribute must have one and only one '__init' " "method defined">; +// SYCL kernel entry point diagnostics +def err_sycl_entry_point_invalid : Error< + "'sycl_ker

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-23 Thread Nhat Nguyen via cfe-commits
https://github.com/changkhothuychung updated https://github.com/llvm/llvm-project/pull/120920 error: too big or took too long to generate ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
@@ -206,3 +208,124 @@ void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(::new (SemaRef.Context) SYCLKernelEntryPointAttr(SemaRef.Context, AL, TSI)); } + +static SourceLocation SourceLocationForType(QualType QT) { + Source

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
@@ -1134,8 +1134,18 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { // the presence of a sycl_kernel_entry_point attribute, register it so that // associated metadata is recreated. if (FD->hasAttr()) { +const auto *SKEPAttr = FD->getAttr(); ASTContex

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

2024-12-23 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/112702 >From fc697f04fd6c9f3c217ce04e3f1dd082c1f1a705 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Wed, 16 Oct 2024 23:16:53 +0900 Subject: [PATCH 1/5] [Coverage] Introduce `getBranchCounterPair()`. NFC. This

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/120327 >From 6ed96d3bf22c5da5af995ea5ffe083baf91594bb Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Fri, 1 Nov 2024 16:03:24 -0700 Subject: [PATCH 1/6] [SYCL] Basic diagnostics for the sycl_kernel_entry_point

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-23 Thread Tom Honermann via cfe-commits
@@ -206,3 +208,124 @@ void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(::new (SemaRef.Context) SYCLKernelEntryPointAttr(SemaRef.Context, AL, TSI)); } + +static SourceLocation SourceLocationForType(QualType QT) { + Source

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-23 Thread Nhat Nguyen via cfe-commits
https://github.com/changkhothuychung updated https://github.com/llvm/llvm-project/pull/120920 error: too big or took too long to generate ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-23 Thread Stephen Senran Zhang via cfe-commits
zsrkmyn wrote: @dtcxzyw, I've updated the patch. It's quite simple. You can forget about the previous patch and start a review from scratch. unittests weren't updated with your patch, since the upper bound wasn't optimal (for AND op). I'm thinking if I need to add a new test mode to test the o

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-23 Thread Guray Ozen via cfe-commits
grypp wrote: In MLIR, we also have other NVVM metadata such as `reqntid` and `maxntid`, among others. What is the plan for these? Will they remain as metadata, or will they be expressed differently? Could you please elaborate on the compile-time improvements? https://github.com/llvm/llvm-pr

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-23 Thread Stephen Senran Zhang via cfe-commits
https://github.com/zsrkmyn updated https://github.com/llvm/llvm-project/pull/120352 >From 2cb7f076f4b101ab0503b51e84e3493ae2ba8060 Mon Sep 17 00:00:00 2001 From: Senran Zhang Date: Tue, 17 Dec 2024 16:15:25 +0800 Subject: [PATCH] [ConstantRange] Estimate tighter lower (upper) bounds for masked

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-23 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > I'm thinking if I need to add a new test mode to test the optimal lower > (upper) bound only for AND (OR). If you cannot make it optimal for all non-wrapped cases, please just add some special cases (e.g., `[7, 14) & [-1, 0) = [7, 14)`) before `TestBinaryOpExhaustive`. htt

[clang] [X86][AVX10.2] Fix wrong mask bits in cvtpbf8_ph intrinsics (PR #120927)

2024-12-23 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/120927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 113177f - [X86][AVX10.2] Fix wrong mask bits in cvtpbf8_ph intrinsics (#120927)

2024-12-23 Thread via cfe-commits
Author: Phoebe Wang Date: 2024-12-23T17:13:56+08:00 New Revision: 113177f98b9d7ac6edfa833d55ad6ad6fd4a0cbf URL: https://github.com/llvm/llvm-project/commit/113177f98b9d7ac6edfa833d55ad6ad6fd4a0cbf DIFF: https://github.com/llvm/llvm-project/commit/113177f98b9d7ac6edfa833d55ad6ad6fd4a0cbf.diff L

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2024-12-23 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/119388 From cb9b5ef4d8b0ed8e67276947525d327c547424fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 28 Nov 2024 17:22:58 +0100 Subject: [PATCH 1/6] [analyzer] Don't assume third iteration in

[clang] f70ab7d - [AArch64] Fix argument passing for SVE tuples (#118961)

2024-12-23 Thread via cfe-commits
Author: Momchil Velikov Date: 2024-12-23T09:26:24Z New Revision: f70ab7d909d6861c7eec5ab40679bde16ab826c6 URL: https://github.com/llvm/llvm-project/commit/f70ab7d909d6861c7eec5ab40679bde16ab826c6 DIFF: https://github.com/llvm/llvm-project/commit/f70ab7d909d6861c7eec5ab40679bde16ab826c6.diff LO

[clang] [AArch64] Fix argument passing for SVE tuples (PR #118961)

2024-12-23 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/118961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][AVX10.2] Fix wrong mask bits in cvtpbf8_ph intrinsics (PR #120927)

2024-12-23 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-aarch64-ubuntu` running on `linaro-lldb-aarch64-ubuntu` while building `clang` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/10268 Here is the relevant piece of the

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-23 Thread Stephen Senran Zhang via cfe-commits
@@ -1520,15 +1520,101 @@ ConstantRange ConstantRange::binaryNot() const { return ConstantRange(APInt::getAllOnes(getBitWidth())).sub(*this); } +/// Estimate the 'bit-masked AND' operation's lower bound. +/// +/// E.g., given two ranges as follows (single quotes are separator

[clang] [X86][AVX10.2] Fix wrong mask bits in cvtpbf8_ph intrinsics (PR #120927)

2024-12-23 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. https://github.com/llvm/llvm-project/pull/120927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add support of Sdext, Sdtrig extentions (PR #120936)

2024-12-23 Thread Pengcheng Wang via cfe-commits
@@ -842,6 +842,12 @@ def HasStdExtH : Predicate<"Subtarget->hasStdExtH()">, AssemblerPredicate<(all_of FeatureStdExtH), "'H' (Hypervisor)">; +// Debugger extensions wangpc-pp wrote: They are also `Superviso

[clang] [Clang] Repair the function "rParenEndsCast" to make incorrect judgments in template variable cases (PR #120904)

2024-12-23 Thread via cfe-commits
https://github.com/dty2 updated https://github.com/llvm/llvm-project/pull/120904 From 3f72b657741dc1392e3065a862e3489e800f0782 Mon Sep 17 00:00:00 2001 From: hunter <284050...@qq.com> Date: Mon, 23 Dec 2024 16:16:47 +0800 Subject: [PATCH] [Clang] Repair the functionrParenEndsCast to make incorrec

[clang] [llvm] [RISCV] Add support of Sdext, Sdtrig extentions (PR #120936)

2024-12-23 Thread Shao-Ce SUN via cfe-commits
https://github.com/sunshaoce updated https://github.com/llvm/llvm-project/pull/120936 >From 4a44a8551cc8e2c790bec2b6b4300e002216bfc0 Mon Sep 17 00:00:00 2001 From: Shao-Ce SUN Date: Mon, 23 Dec 2024 14:54:06 +0800 Subject: [PATCH 1/2] [RISCV] Add support of Sdext,Sdtrig extention The full spec

[clang] [llvm] [RISCV] Add support of Sdext, Sdtrig extentions (PR #120936)

2024-12-23 Thread Shao-Ce SUN via cfe-commits
@@ -842,6 +842,12 @@ def HasStdExtH : Predicate<"Subtarget->hasStdExtH()">, AssemblerPredicate<(all_of FeatureStdExtH), "'H' (Hypervisor)">; +// Debugger extensions sunshaoce wrote: Done. Thanks! https://g

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

2024-12-23 Thread Gábor Horváth via cfe-commits
@@ -555,24 +557,26 @@ void handleConstMemberCall(const CallExpr *CE, LatticeTransferState &State) { // If the const method returns an optional or reference to an optional. if (RecordLoc != nullptr && isSupportedOptionalType(CE->getType())) { -

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

2024-12-23 Thread Gábor Horváth via cfe-commits
@@ -71,10 +73,28 @@ template class CachedConstAccessorsLattice : public Base { /// Requirements: /// /// - `CE` should return a location (GLValue or a record type). + /// + /// DEPRECATED: switch users to the below overload which takes Callee and Type + /// directl

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2024-12-23 Thread Michael Buch via cfe-commits
@@ -2299,11 +2301,103 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( clang_type, decl, name, enum_va

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2024-12-23 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/115005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-23 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 11676da80874787a47856da87911234837c53f06 43385b7341ef6d3bd5f689670ca407f6e5f91949 --e

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-23 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand created https://github.com/llvm/llvm-project/pull/120967 This PR has 2 related goals: *Remove dependency on `llvm::Any`*. For some platforms, use of `llvm::Any` forces users to explicitly define internal details related to `Any`. Aside from aesthetics, this places an ob

[clang] [clang-tools-extra] [clangd] Make clangd run `format::cleanupAroundReplacements()` for all code actions just as clang-tidy does (PR #118569)

2024-12-23 Thread Richard Li via cfe-commits
https://github.com/chomosuke updated https://github.com/llvm/llvm-project/pull/118569 >From efc17a803c9c22543de7d5f9e960a7267ade1f2e Mon Sep 17 00:00:00 2001 From: chomosuke Date: Wed, 4 Dec 2024 14:42:24 + Subject: [PATCH 1/3] [clangd][clang-tidy] Make clangd run `format::cleanupAroundRep

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. We do not use braces for if statements with a single child statement LGTM otherwise https://github.com/llvm/llvm-project/pull/120591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread via cfe-commits
@@ -6591,27 +6591,36 @@ void CheckFormatHandler::HandleNonStandardConversionSpecifier( void CheckFormatHandler::HandlePosition(const char *startPos, unsigned posLen) { - EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard_posit

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread via cfe-commits
@@ -6591,27 +6591,36 @@ void CheckFormatHandler::HandleNonStandardConversionSpecifier( void CheckFormatHandler::HandlePosition(const char *startPos, unsigned posLen) { - EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard_posit

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread via cfe-commits
@@ -6591,27 +6591,36 @@ void CheckFormatHandler::HandleNonStandardConversionSpecifier( void CheckFormatHandler::HandlePosition(const char *startPos, unsigned posLen) { - EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard_posit

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2024-12-23 Thread Ilia Kuklin via cfe-commits
kuilpd wrote: As of now LLDB doesn't calculate enum's best promotion type when reading it from DWARF info. This change would allow to reuse the code from Sema without copying it to LLDB, which I'm working on in #115005 This function however has too many arguments right now, and also needs to

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2024-12-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ilia Kuklin (kuilpd) Changes Move the code that calculates BestWidth, BestType and BestPromotionType for an enum to a separate function which can be called from outside of Sema. --- Full diff: https://github.com/llvm/llvm-project/pull/12

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2024-12-23 Thread Ilia Kuklin via cfe-commits
https://github.com/kuilpd created https://github.com/llvm/llvm-project/pull/120965 Move the code that calculates BestWidth, BestType and BestPromotionType for an enum to a separate function which can be called from outside of Sema. >From ab8dcaef120233d0145508aaa4bf45eec22cadf1 Mon Sep 17 00:

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2024-12-23 Thread Gábor Horváth via cfe-commits
Xazax-hun wrote: Do you expect any changes for less obvious ways of looping? * Recursion * `while(true) if (cond) break;` * Like above but with gotos ? Would be nice to have some tests for those as well. https://github.com/llvm/llvm-project/pull/119388 ___

[clang] [clang-tools-extra] [clangd] Make clangd run `format::cleanupAroundReplacements()` for all code actions just as clang-tidy does (PR #118569)

2024-12-23 Thread Richard Li via cfe-commits
chomosuke wrote: Thank you for the review @llvm-beanz, I've fixed the suggestions :). https://github.com/llvm/llvm-project/pull/118569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clangd] Make clangd run `format::cleanupAroundReplacements()` for all code actions just as clang-tidy does (PR #118569)

2024-12-23 Thread Richard Li via cfe-commits
https://github.com/chomosuke updated https://github.com/llvm/llvm-project/pull/118569 >From efc17a803c9c22543de7d5f9e960a7267ade1f2e Mon Sep 17 00:00:00 2001 From: chomosuke Date: Wed, 4 Dec 2024 14:42:24 + Subject: [PATCH 1/3] [clangd][clang-tidy] Make clangd run `format::cleanupAroundRep

[clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2024-12-23 Thread Michael Buch via cfe-commits
Michael137 wrote: > > FWIW, I came across another no_unique_address-related crash today: > > ``` > > $ cat a.cc > > struct S { > > private: > > int i; > > short s; > > }; > > static_assert(sizeof(S) == 8); > > > > struct T { > > [[no_unique_address]] S s; > > char c; > > }; > > static_as

[clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2024-12-23 Thread Pavel Labath via cfe-commits
labath wrote: FWIW, I came across another no_unique_address-related crash today: ``` $ cat a.cc struct S { private: int i; short s; }; static_assert(sizeof(S) == 8); struct T { [[no_unique_address]] S s; char c; }; static_assert(sizeof(T) == 8); T t; $ clang++ -c -o /tmp/a.out /tmp/a.cc

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-23 Thread Durgadoss R via cfe-commits
@@ -556,19 +556,16 @@ llvm.func @kernel_func() attributes {nvvm.kernel} { llvm.return } -// CHECK: !nvvm.annotations = -// CHECK-NOT: {ptr @nvvm_special_regs, !"kernel", i32 1} -// CHECK: {ptr @kernel_func, !"kernel", i32 1} +// CHECK: ptx_kernel void @kernel_func --

[clang] [llvm] [openmp] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-23 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > @jhuber6, since I think this PR makes #119006 obsolete, should I merge that > one while this one's still in the works, or close it? I wouldn't say it's high priority. I would've landed this already if it weren't for the downstream fork being so divergent this isn't an easy app

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-23 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/120967 >From 27ef09ae6f7a83fa3cf9ee98a46b02880607add8 Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 23 Dec 2024 13:42:21 + Subject: [PATCH] Introduce virtual interface for lattices and remove dependen

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-23 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/120967 >From 3792a385b1ecd2dd029fc6321bacac1de5d8eb46 Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 23 Dec 2024 13:42:21 + Subject: [PATCH] Introduce virtual interface for lattices and remove dependen

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-23 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/120967 >From 2273b56b783b7923108dbb3a5857d256fc4a44ca Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 23 Dec 2024 13:42:21 + Subject: [PATCH] Introduce virtual interface for lattices and remove dependen

[clang] [llvm] [openmp] [OpenMP] Use generic IR for the OpenMP DeviceRTL (PR #119091)

2024-12-23 Thread Michał Górny via cfe-commits
mgorny wrote: @jhuber6, since I think this PR makes #119006 obsolete, should I merge that one while this one's still in the works, or close it? https://github.com/llvm/llvm-project/pull/119091 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang-tools-extra] [clang-tidy] swap cppcoreguidelines-narrowing-conversions and bugprone-narrowing-conversions (PR #120245)

2024-12-23 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: +1 https://github.com/llvm/llvm-project/pull/120245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2024-12-23 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: @namandixit it is possible. I'm not confident about the new option., @AaronBallman @erichkeane - should _unknown namespaced attributes_ be separated by the new option? https://github.com/llvm/llvm-project/pull/120925 ___ cfe-commit

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2024-12-23 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/120925 >From bce88b1bb464438828fc177c978ad2b99957530f Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 23 Dec 2024 02:35:07 +0200 Subject: [PATCH 1/2] [Clang] raise extension warning for unknown namespaced att

[clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2024-12-23 Thread Michael Buch via cfe-commits
Michael137 wrote: > FWIW, I came across another no_unique_address-related crash today: > > ``` > $ cat a.cc > struct S { > private: > int i; > short s; > }; > static_assert(sizeof(S) == 8); > > struct T { > [[no_unique_address]] S s; > char c; > }; > static_assert(sizeof(T) == 8); > >

[clang] [SYCL] Allow neon attributes for ARM host (PR #94229)

2024-12-23 Thread Harald van Dijk via cfe-commits
https://github.com/hvdijk updated https://github.com/llvm/llvm-project/pull/94229 >From b1a53997e9378954da353ea1f0d8f03a8f19736f Mon Sep 17 00:00:00 2001 From: Harald van Dijk Date: Mon, 23 Dec 2024 13:19:56 + Subject: [PATCH] [SYCL] Allow neon attributes for ARM host We permit neon attrib

[clang] [SYCL] Allow neon attributes for ARM host (PR #94229)

2024-12-23 Thread Harald van Dijk via cfe-commits
hvdijk wrote: The rebase apparently conflicted with #95224. In the test I added, I checked that I preserved the existing behaviour with `-target-feature -neon`, but that behaviour has since changed. Updated to remove that bit of the test. https://github.com/llvm/llvm-project/pull/94229 ___

[clang-tools-extra] [clang-tidy] fix incorrect argument names in documentation for ExtraArgs and ExtraArgsBefore (PR #120963)

2024-12-23 Thread via cfe-commits
https://github.com/float3 created https://github.com/llvm/llvm-project/pull/120963 None >From 5f4415685c116e4b05759b46186c34e210b7b7a3 Mon Sep 17 00:00:00 2001 From: hill Date: Mon, 23 Dec 2024 14:21:46 +0100 Subject: [PATCH] [clang-tidy] fix incorrect argument names in documentation for Extr

[clang-tools-extra] [clang-tidy] fix incorrect argument names in documentation for ExtraArgs and ExtraArgsBefore (PR #120963)

2024-12-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: hill (float3) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/120963.diff 1 Files Affected: - (modified) clang-tools-extra/docs/clang-tidy/index.rst (+2-2) ``diff diff --git a/clang-tools-extra/d

[clang-tools-extra] [clang-tidy] fix incorrect argument names in documentation for ExtraArgs and ExtraArgsBefore (PR #120963)

2024-12-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: hill (float3) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/120963.diff 1 Files Affected: - (modified) clang-tools-extra/docs/clang-tidy/index.rst (+2-2) ``diff diff --git a/clang-tools-extra/docs/cla

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2024-12-23 Thread Donát Nagy via cfe-commits
NagyDonat wrote: The logic that I added only affects the handling of the condition part of loop statements, so it has absolutely no effect on the handling of code that implements similar looping behavior with different language features. I added a testcase to document this (and as an example,

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

2024-12-23 Thread via cfe-commits
yronglin wrote: friendly ping~ https://github.com/llvm/llvm-project/pull/117437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2024-12-23 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/119388 From cb9b5ef4d8b0ed8e67276947525d327c547424fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 28 Nov 2024 17:22:58 +0100 Subject: [PATCH 1/7] [analyzer] Don't assume third iteration in

[clang] [analyzer] Simplify CallEvent castArgToParamTypeIfNeeded (PR #120981)

2024-12-23 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/120981 I noticed recently that this code (that I wrote xD) uses the `getRuntimeDefinition()` which isn't quite necessary for the simple task this function was designed for. Why would it be better not using this API

[clang] [analyzer] Simplify CallEvent castArgToParamTypeIfNeeded (PR #120981)

2024-12-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Balazs Benics (steakhal) Changes I noticed recently that this code (that I wrote xD) uses the `getRuntimeDefinition()` which isn't quite necessary for the simple task this function was designed for. Why would it be better not using this

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-23 Thread Alex MacLean via cfe-commits
@@ -556,19 +556,16 @@ llvm.func @kernel_func() attributes {nvvm.kernel} { llvm.return } -// CHECK: !nvvm.annotations = -// CHECK-NOT: {ptr @nvvm_special_regs, !"kernel", i32 1} -// CHECK: {ptr @kernel_func, !"kernel", i32 1} +// CHECK: ptx_kernel void @kernel_func --

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/120591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread Dmitry Chestnykh via cfe-commits
https://github.com/chestnykh updated https://github.com/llvm/llvm-project/pull/120591 >From 9a0d5d44f70477403a33d2feb3f5518b0d078a66 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Thu, 19 Dec 2024 18:35:35 +0300 Subject: [PATCH 1/3] [Clang][Sema] Process warnings conditionally There are

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-23 Thread Durgadoss R via cfe-commits
@@ -556,19 +556,16 @@ llvm.func @kernel_func() attributes {nvvm.kernel} { llvm.return } -// CHECK: !nvvm.annotations = -// CHECK-NOT: {ptr @nvvm_special_regs, !"kernel", i32 1} -// CHECK: {ptr @kernel_func, !"kernel", i32 1} +// CHECK: ptx_kernel void @kernel_func --

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread Dmitry Chestnykh via cfe-commits
@@ -6591,27 +6591,36 @@ void CheckFormatHandler::HandleNonStandardConversionSpecifier( void CheckFormatHandler::HandlePosition(const char *startPos, unsigned posLen) { - EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard_posit

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread Dmitry Chestnykh via cfe-commits
@@ -6591,27 +6591,36 @@ void CheckFormatHandler::HandleNonStandardConversionSpecifier( void CheckFormatHandler::HandlePosition(const char *startPos, unsigned posLen) { - EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard_posit

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread Dmitry Chestnykh via cfe-commits
@@ -6591,27 +6591,36 @@ void CheckFormatHandler::HandleNonStandardConversionSpecifier( void CheckFormatHandler::HandlePosition(const char *startPos, unsigned posLen) { - EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard_posit

[clang] [Clang] Prevent assignment to captured structured bindings inside immutable lambda (PR #120849)

2024-12-23 Thread via cfe-commits
https://github.com/cor3ntin commented: I have a few nits but generally looks good, thanks for the fix https://github.com/llvm/llvm-project/pull/120849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [Clang] Prevent assignment to captured structured bindings inside immutable lambda (PR #120849)

2024-12-23 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/120849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Prevent assignment to captured structured bindings inside immutable lambda (PR #120849)

2024-12-23 Thread via cfe-commits
@@ -13299,7 +13293,18 @@ static NonConstCaptureKind isReferenceToNonConstCapture(Sema &S, Expr *E) { // The declaration must be a variable which is not declared 'const'. VarDecl *var = dyn_cast(DRE->getDecl()); - if (!var) return NCCK_None; + if (!var) { +// Binding

[clang] [Clang] Prevent assignment to captured structured bindings inside immutable lambda (PR #120849)

2024-12-23 Thread via cfe-commits
@@ -13299,7 +13293,18 @@ static NonConstCaptureKind isReferenceToNonConstCapture(Sema &S, Expr *E) { // The declaration must be a variable which is not declared 'const'. VarDecl *var = dyn_cast(DRE->getDecl()); - if (!var) return NCCK_None; + if (!var) { +// Binding

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/120591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 99dddef - [Clang][Sema] Process warnings conditionally (#120591)

2024-12-23 Thread via cfe-commits
Author: Dmitry Chestnykh Date: 2024-12-23T20:02:28+03:00 New Revision: 99dddef340e566e9d303010f1219f7d7d6d37a11 URL: https://github.com/llvm/llvm-project/commit/99dddef340e566e9d303010f1219f7d7d6d37a11 DIFF: https://github.com/llvm/llvm-project/commit/99dddef340e566e9d303010f1219f7d7d6d37a11.di

[clang] [Clang][Sema] Process warnings conditionally (PR #120591)

2024-12-23 Thread Dmitry Chestnykh via cfe-commits
https://github.com/chestnykh closed https://github.com/llvm/llvm-project/pull/120591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-23 Thread Alex MacLean via cfe-commits
AlexMaclean wrote: > In MLIR, we also have other NVVM metadata such as `reqntid` and `maxntid`, > among others. What is the plan for these? Will they remain as metadata, or > will they be expressed differently? Eventually, I hope to migrate all !nvvm.annotations, including `reqntid` and `maxn

[clang-tools-extra] [clang-tidy] fix incorrect argument names in documentation for ExtraArgs and ExtraArgsBefore (PR #120963)

2024-12-23 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Sync with [ClangTidyMain.cpp](https://github.com/llvm/llvm-project/blob/d36836de0183b9b1939cc679d153e3b313e55c76/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp#L57-L58)? https://github.com/llvm/llvm-project/blob/d36836de0183b9b1939cc679d153e3b313e55c76/clang-tools-extra/cla

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2024-12-23 Thread Ilia Kuklin via cfe-commits
https://github.com/kuilpd updated https://github.com/llvm/llvm-project/pull/120965 >From ab8dcaef120233d0145508aaa4bf45eec22cadf1 Mon Sep 17 00:00:00 2001 From: Ilia Kuklin Date: Mon, 23 Dec 2024 17:49:32 +0500 Subject: [PATCH 1/2] [clang][Sema] Move calculating enum width and type to a separa

[clang] [NFC][Driver] Simplify linking of ubsan_standalone_cxx (PR #120938)

2024-12-23 Thread Kirill Stoimenov via cfe-commits
https://github.com/kstoimenov approved this pull request. https://github.com/llvm/llvm-project/pull/120938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2024-12-23 Thread Ilia Kuklin via cfe-commits
https://github.com/kuilpd updated https://github.com/llvm/llvm-project/pull/120965 >From ab8dcaef120233d0145508aaa4bf45eec22cadf1 Mon Sep 17 00:00:00 2001 From: Ilia Kuklin Date: Mon, 23 Dec 2024 17:49:32 +0500 Subject: [PATCH 1/2] [clang][Sema] Move calculating enum width and type to a separa

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2024-12-23 Thread Ilia Kuklin via cfe-commits
@@ -20008,6 +20008,87 @@ bool Sema::IsValueInFlagEnum(const EnumDecl *ED, const llvm::APInt &Val, return !(FlagMask & Val) || (AllowMask && !(FlagMask & ~Val)); } +bool Sema::ComputeBestEnumProperties(ASTContext &Context, EnumDecl *Enum, +

  1   2   >