[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Björn Schäpers via cfe-commits
@@ -396,6 +396,36 @@ struct FormatStyle { /// \version 17 ShortCaseStatementsAlignmentStyle AlignConsecutiveShortCaseStatements; + /// Style of aligning consecutive TableGen cond operator colons. + /// \code + /// !cond(!eq(size, 1) : 1, + /// !eq(size, 16):

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Björn Schäpers via cfe-commits
@@ -396,6 +396,36 @@ struct FormatStyle { /// \version 17 ShortCaseStatementsAlignmentStyle AlignConsecutiveShortCaseStatements; + /// Style of aligning consecutive TableGen cond operator colons. + /// \code + /// !cond(!eq(size, 1) : 1, + /// !eq(size, 16):

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Björn Schäpers via cfe-commits
@@ -681,6 +700,10 @@ struct FormatToken { return true; if (is(TT_DictLiteral) && is(tok::greater)) return true; +if (is(TT_TableGenParamAngleCloser)) + return true; +if (is(TT_TableGenListCloser)) + return true; return isOneOf(tok::r_paren

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Björn Schäpers via cfe-commits
@@ -2165,6 +2165,56 @@ TEST_F(TokenAnnotatorTest, UnderstandsVerilogOperators) { EXPECT_TOKEN(Tokens[4], tok::string_literal, TT_Unknown); } +TEST_F(TokenAnnotatorTest, UnderstandTableGenTokens) { + auto Style = getLLVMStyle(FormatStyle::LK_TableGen); + Style.TableGenBreak

[clang] [clang-format] Add an fnmatch-like function for .clang-format-ignore (PR #76021)

2023-12-22 Thread Owen Pan via cfe-commits
@@ -0,0 +1,169 @@ +//===- unittest/Format/MatchFilePathTest.cpp --===// +// +// 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

[llvm] [clang] [TargetParser] Define AEK_FCMA and AEK_JSCVT for tsv110 (PR #75516)

2023-12-22 Thread Qi Hu via cfe-commits
https://github.com/Qi-Hu updated https://github.com/llvm/llvm-project/pull/75516 >From e93dd2aa9005435b401d0ca3b1005768f8a636dd Mon Sep 17 00:00:00 2001 From: Qi Hu Date: Thu, 14 Dec 2023 13:35:52 -0500 Subject: [PATCH] [TargetParser] Define AEK_FCMA and AEK_JSCVT for tsv110 We define AEK_JSCVT

[clang] [clang-format] Add an fnmatch-like function for .clang-format-ignore (PR #76021)

2023-12-22 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/76021 >From 4954f52278ca41652be79318843d3538a2eb1205 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 19 Dec 2023 23:25:57 -0800 Subject: [PATCH 1/2] [clang-format] Add an fnmatch-like function for .clang-format-igno

[clang] [clang-format] Add an fnmatch-like function for .clang-format-ignore (PR #76021)

2023-12-22 Thread Owen Pan via cfe-commits
owenca wrote: > Are we going to use this specific implementation on all platforms for parity? Yes, similar to [this](https://github.com/owenca/llvm-project/commit/52866dcfe31cf5a43d86b27ec1f0420077034780#diff-0cfce704bac218438436bd4388319d112780509ea474d5b3253d45746a62713aR123). > The logic on

[clang] 0e039fc - [APINotes] Use DenseMap::contains (NFC)

2023-12-22 Thread Kazu Hirata via cfe-commits
Author: Kazu Hirata Date: 2023-12-22T14:23:25-08:00 New Revision: 0e039fc39e29320c9a0eeadb34a5e83ac51d48ba URL: https://github.com/llvm/llvm-project/commit/0e039fc39e29320c9a0eeadb34a5e83ac51d48ba DIFF: https://github.com/llvm/llvm-project/commit/0e039fc39e29320c9a0eeadb34a5e83ac51d48ba.diff L

[clang] Revert "[Sema] Fix crash on invalid code with parenthesized aggregate initialization" (PR #76272)

2023-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/76272 Reverts llvm/llvm-project#76232 to recover build bots. Breaks libc++ tests, details in #76232 #76263 >From 4c7293181d3139e16647c3c6daeeb3ae7b344816 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Fri, 22

[clang] Revert "[Sema] Fix crash on invalid code with parenthesized aggregate initialization" (PR #76272)

2023-12-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vitaly Buka (vitalybuka) Changes Reverts llvm/llvm-project#76232 to recover build bots. Breaks libc++ tests, details in #76232 #76263 --- Full diff: https://github.com/llvm/llvm-project/pull/76272.diff 2 Files Affected: - (modified)

[clang] Revert "[Sema] Fix crash on invalid code with parenthesized aggregate initialization" (PR #76272)

2023-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/76272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Sema] Fix crash on invalid code with parenthesized aggregate initialization" (PR #76272)

2023-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/76272 >From 543b621aae66c572776cf57ba338f2e4daae3382 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Fri, 22 Dec 2023 14:23:46 -0800 Subject: [PATCH] Revert "[Sema] Fix crash on invalid code with parenthesized agg

[clang] Revert "[Sema] Fix crash on invalid code with parenthesized aggregate initialization" (PR #76272)

2023-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/76272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2205d23 - Revert "[Sema] Fix crash on invalid code with parenthesized aggregate initialization" (#76272)

2023-12-22 Thread via cfe-commits
Author: Vitaly Buka Date: 2023-12-22T15:20:00-08:00 New Revision: 2205d2334f3c859ad9f6c65ed950bfb3bb6f7cbe URL: https://github.com/llvm/llvm-project/commit/2205d2334f3c859ad9f6c65ed950bfb3bb6f7cbe DIFF: https://github.com/llvm/llvm-project/commit/2205d2334f3c859ad9f6c65ed950bfb3bb6f7cbe.diff L

[clang] Revert "[Sema] Fix crash on invalid code with parenthesized aggregate initialization" (PR #76272)

2023-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/76272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [flang] [clang-tools-extra] [libcxx] [compiler-rt] [clang] [libc] [llvm] [RegAllocFast] Refactor dominates algorithm for large basic block (PR #72250)

2023-12-22 Thread via cfe-commits
@@ -62,6 +62,107 @@ static RegisterRegAlloc fastRegAlloc("fast", "fast register allocator", namespace { +/// Assign ascending index for instructions in machine basic block. The index +/// can be used to determine dominance between instructions in same MBB. +class InstrPosInd

[lldb] [flang] [clang-tools-extra] [libcxx] [compiler-rt] [clang] [libc] [llvm] [RegAllocFast] Refactor dominates algorithm for large basic block (PR #72250)

2023-12-22 Thread via cfe-commits
https://github.com/HaohaiWen edited https://github.com/llvm/llvm-project/pull/72250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter][StructuralEquivalence] improve StructuralEquivalence on recordType (PR #76226)

2023-12-22 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/76226 >From 9a8cea81eba77eef914089e3cffd96e863aac36f Mon Sep 17 00:00:00 2001 From: huqizhi Date: Fri, 22 Dec 2023 17:56:32 +0800 Subject: [PATCH] [clang][ASTImporter][StructuralEquivalence] improve StructuralEquivalen

[clang] [Clang][RISCV] Add missing support for `__builtin_riscv_cpop_32/64` (PR #76256)

2023-12-22 Thread Craig Topper via cfe-commits
topperc wrote: Can we just use __builtin_popcount and __builtin_popcountll directly in the header file? https://github.com/llvm/llvm-project/pull/76256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [Clang][RISCV] Add missing support for `__builtin_riscv_cpop_32/64` (PR #76256)

2023-12-22 Thread Craig Topper via cfe-commits
@@ -82,3 +82,29 @@ unsigned int ctz_64(unsigned long a) { return __builtin_riscv_ctz_64(a); } #endif + +// RV32ZBB-LABEL: @cpop_32( +// RV32ZBB-NEXT: entry: +// RV32ZBB-NEXT:[[TMP0:%.*]] = call i32 @llvm.ctpop.i32(i32 [[A:%.*]]) +// RV32ZBB-NEXT:ret i32 [[TMP0]] +//

[clang] [clang][ASTImporter][StructuralEquivalence] improve StructuralEquivalence on recordType (PR #76226)

2023-12-22 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/76226 >From be62fb62934052db668eea57a9ff241fcd06cd2c Mon Sep 17 00:00:00 2001 From: huqizhi Date: Fri, 22 Dec 2023 17:56:32 +0800 Subject: [PATCH] [clang][ASTImporter][StructuralEquivalence] improve StructuralEquivalen

[clang] [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies with auto keyword (PR #75082)

2023-12-22 Thread via cfe-commits
@@ -876,7 +876,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline( << PluginFN << toString(PassPlugin.takeError()); } } - for (auto PassCallback : CodeGenOpts.PassBuilderCallbacks) + for (const auto &PassCallback : CodeGenOpts.PassBuilderCallbacks)

[clang] bbe1b06 - [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies with auto keyword (#75082)

2023-12-22 Thread via cfe-commits
Author: smanna12 Date: 2023-12-22T20:39:22-06:00 New Revision: bbe1b06fbb7127d613cb4958e06c737967878388 URL: https://github.com/llvm/llvm-project/commit/bbe1b06fbb7127d613cb4958e06c737967878388 DIFF: https://github.com/llvm/llvm-project/commit/bbe1b06fbb7127d613cb4958e06c737967878388.diff LOG:

[clang] [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies with auto keyword (PR #75082)

2023-12-22 Thread via cfe-commits
https://github.com/smanna12 closed https://github.com/llvm/llvm-project/pull/75082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in annotating function declaration names (PR #76206)

2023-12-22 Thread Matt Mundell via cfe-commits
mattmundell wrote: > `clang-format` doesn't know what are types, except for the keywords. So there > is no way to decide if this is a function declaration without naming the > parameters, or a variable declaration with a constructor call. This is C so I guess it can only be a function declarat

[clang] [NFC][Clang] Fix Static Code Analysis Concerns with copy without assign (PR #75091)

2023-12-22 Thread via cfe-commits
smanna12 wrote: > I think the static analysis tool is confused here. The `SVEType` class > doesn't actually have a user-declared copy constructor. It does have a > constructor that delegates to the implicitly declared copy constructor > though. The class members are all scalar types, so the im

[clang] [NFC][Clang] Fix Static Code Analysis Concerns with copy without assign (PR #75091)

2023-12-22 Thread via cfe-commits
https://github.com/smanna12 closed https://github.com/llvm/llvm-project/pull/75091 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter][StructuralEquivalence] improve StructuralEquivalence on recordType (PR #76226)

2023-12-22 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/76226 >From 574fa37117614fc4e23c12a7ecd297304d5eb337 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Fri, 22 Dec 2023 17:56:32 +0800 Subject: [PATCH] [clang][ASTImporter][StructuralEquivalence] improve StructuralEquivalen

[llvm] [clang] [SPARC] Support reserving arbitrary general purpose registers (PR #74927)

2023-12-22 Thread via cfe-commits
@@ -1125,6 +1130,10 @@ Register SparcTargetLowering::getRegisterByName(const char* RegName, LLT VT, .Case("g4", SP::G4).Case("g5", SP::G5).Case("g6", SP::G6).Case("g7", SP::G7) .Default(0); + const SparcRegisterInfo *TRI = Subtarget->getRegisterInfo(); + if (!TRI->

[clang] 31aa7d2 - [RISCV] Use riscv_bitmanip.h in zbb.c. NFC

2023-12-22 Thread Craig Topper via cfe-commits
Author: Craig Topper Date: 2023-12-22T20:10:37-08:00 New Revision: 31aa7d2de018693a6b45c9056a67229c54461b8f URL: https://github.com/llvm/llvm-project/commit/31aa7d2de018693a6b45c9056a67229c54461b8f DIFF: https://github.com/llvm/llvm-project/commit/31aa7d2de018693a6b45c9056a67229c54461b8f.diff

[clang] [Clang][RISCV] Add missing support for `__builtin_riscv_cpop_32/64` (PR #76256)

2023-12-22 Thread Craig Topper via cfe-commits
@@ -82,3 +82,29 @@ unsigned int ctz_64(unsigned long a) { return __builtin_riscv_ctz_64(a); } #endif + +// RV32ZBB-LABEL: @cpop_32( +// RV32ZBB-NEXT: entry: +// RV32ZBB-NEXT:[[TMP0:%.*]] = call i32 @llvm.ctpop.i32(i32 [[A:%.*]]) +// RV32ZBB-NEXT:ret i32 [[TMP0]] +//

[clang] [clang-format] Fix operator overload inconsistency in `BreakAfterAttributes: Always` (PR #74943)

2023-12-22 Thread Owen Pan via cfe-commits
@@ -26451,6 +26451,20 @@ TEST_F(FormatTest, BreakAfterAttributes) { "{\n" "}", CtorDtorCode, Style); + + Style.BreakBeforeBraces = FormatStyle::BS_Attach; + Style.ReferenceAlignment = FormatStyle::ReferenceAlignmentStyle::RAS_Left;

[clang] [clang-format] Fix operator overload inconsistency in `BreakAfterAttributes: Always` (PR #74943)

2023-12-22 Thread via cfe-commits
https://github.com/XDeme updated https://github.com/llvm/llvm-project/pull/74943 >From b80f8579dbc745ddfaa3d60770dd0d3e79e6c641 Mon Sep 17 00:00:00 2001 From: XDeme Date: Sat, 9 Dec 2023 14:31:12 -0300 Subject: [PATCH 1/9] Fixes overload operator in BreakAfterAttributes --- clang/lib/Format/Co

[clang] [clang-format] Fix operator overload inconsistency in `BreakAfterAttributes: Always` (PR #74943)

2023-12-22 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/74943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add common attribute macros to Google style (PR #76239)

2023-12-22 Thread Owen Pan via cfe-commits
owenca wrote: > `GUARDED_BY` and `ABSL_GUARDED_BY` are very commoon in Google codebases so it > is reasonable to include them by default to avoid the need for extra > configuration in every Google repository. I don't feel comfortable with this as it might impact users of the Google style with

[clang] f8f8926 - [clang-format] Fix a bug in annotating function declaration names (#76206)

2023-12-22 Thread via cfe-commits
Author: Owen Pan Date: 2023-12-22T22:51:00-08:00 New Revision: f8f8926054dcf47cb0f3166be8d6961afc979290 URL: https://github.com/llvm/llvm-project/commit/f8f8926054dcf47cb0f3166be8d6961afc979290 DIFF: https://github.com/llvm/llvm-project/commit/f8f8926054dcf47cb0f3166be8d6961afc979290.diff LOG:

[clang] [clang-format] Fix a bug in annotating function declaration names (PR #76206)

2023-12-22 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/76206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add common attribute macros to Google style (PR #76239)

2023-12-22 Thread Emilia Kond via cfe-commits
rymiel wrote: Who should have the final say on the Google code style if not Google? https://github.com/llvm/llvm-project/pull/76239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 8097a5d - [clang-format] Fix operator overload inconsistency in `BreakAfterAttributes: Always` (#74943)

2023-12-22 Thread via cfe-commits
Author: XDeme Date: 2023-12-22T23:02:47-08:00 New Revision: 8097a5d37b70f483d9e441d78aa7f689618fa795 URL: https://github.com/llvm/llvm-project/commit/8097a5d37b70f483d9e441d78aa7f689618fa795 DIFF: https://github.com/llvm/llvm-project/commit/8097a5d37b70f483d9e441d78aa7f689618fa795.diff LOG: [c

[clang] [clang-format] Fix operator overload inconsistency in `BreakAfterAttributes: Always` (PR #74943)

2023-12-22 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/74943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [clang] [llvm] [sanitizers] Optimize locking StackDepotBase for fork (PR #76280)

2023-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/76280 >From e0c1de414d58b844382db93e3b3f4ac8cd8cf5b6 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Fri, 22 Dec 2023 23:26:11 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?= =?U

[clang] [clang][ASTImporter][StructuralEquivalence] improve StructuralEquivalence on recordType (PR #76226)

2023-12-22 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/76226 >From 27005dba5f7530143657c514250a362670e3d67d Mon Sep 17 00:00:00 2001 From: huqizhi Date: Fri, 22 Dec 2023 17:56:32 +0800 Subject: [PATCH] [clang][ASTImporter][StructuralEquivalence] improve StructuralEquivalen

<    1   2   3