[clang] fe2e677 - [clang-format][doc] Add .clang-format-ignore to the release notes

2023-12-29 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-12-29T23:12:16-08:00 New Revision: fe2e677aa7aebedd316b1a688db8410855a213c1 URL: https://github.com/llvm/llvm-project/commit/fe2e677aa7aebedd316b1a688db8410855a213c1 DIFF: https://github.com/llvm/llvm-project/commit/fe2e677aa7aebedd316b1a688db8410855a213c1.diff

[clang] 3507959 - [clang-format][doc] Fix format errors.

2023-12-29 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-12-29T22:52:07-08:00 New Revision: 3507959e441ed9470818e7c6ef16d9bbcfe6a999 URL: https://github.com/llvm/llvm-project/commit/3507959e441ed9470818e7c6ef16d9bbcfe6a999 DIFF: https://github.com/llvm/llvm-project/commit/3507959e441ed9470818e7c6ef16d9bbcfe6a999.diff

[clang] ca8441d - [clang-format][NFC] Fix a typo.

2023-12-29 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-12-29T19:47:08-08:00 New Revision: ca8441d6dbd36003288ef412295e7b946a8bb893 URL: https://github.com/llvm/llvm-project/commit/ca8441d6dbd36003288ef412295e7b946a8bb893 DIFF: https://github.com/llvm/llvm-project/commit/ca8441d6dbd36003288ef412295e7b946a8bb893.diff

[clang] [clang-format] Add .clang-format-ignore for ignoring files (PR #76327)

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

[clang] [clang-format] Add .clang-format-ignore for ignoring files (PR #76327)

2023-12-29 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/76327 >From 4afd12db61528b40d842a7fbee9af37c2235822c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Dec 2023 01:18:55 -0800 Subject: [PATCH 1/9] [clang-format] Add .clang-format.ignore for ignoring files

[clang] [clang-format] Add .clang-format-ignore for ignoring files (PR #76327)

2023-12-29 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/76327 >From 4afd12db61528b40d842a7fbee9af37c2235822c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Dec 2023 01:18:55 -0800 Subject: [PATCH 1/8] [clang-format] Add .clang-format.ignore for ignoring files

[clang] [clang-format] Add .clang-format-ignore for ignoring files (PR #76327)

2023-12-29 Thread Owen Pan via cfe-commits
@@ -570,6 +571,70 @@ static int dumpConfig(bool IsSTDIN) { return 0; } +// Check whether `FilePath` is ignored according to the nearest +// .clang-format-ignore file based on the rules below: +// - A blank line is skipped. +// - Leading and trailing spaces of a line are

[clang] [clang-format] Add .clang-format-ignore for ignoring files (PR #76327)

2023-12-29 Thread Owen Pan via cfe-commits
@@ -570,6 +571,70 @@ static int dumpConfig(bool IsSTDIN) { return 0; } +// Check whether `FilePath` is ignored according to the nearest +// .clang-format-ignore file based on the rules below: +// - A blank line is skipped. +// - Leading and trailing spaces of a line are

[clang] [clang-format] Fix bad indentation with attribute and templated type (PR #76336)

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

[clang] [clang-format] Fix bad indentation with attribute and templated type (PR #76336)

2023-12-28 Thread Owen Pan via cfe-commits
@@ -26492,6 +26492,10 @@ TEST_F(FormatTest, BreakAfterAttributes) { verifyFormat("[[nodiscard]]\n" "Foo& operator-(Foo&);", Style); + + verifyFormat("[[maybe_unused]]\n" + "foo f;", owenca wrote: ```suggestion

[clang] [clang-format] Fix bad indentation with attribute and templated type (PR #76336)

2023-12-28 Thread Owen Pan via cfe-commits
@@ -26492,6 +26492,10 @@ TEST_F(FormatTest, BreakAfterAttributes) { verifyFormat("[[nodiscard]]\n" "Foo& operator-(Foo&);", Style); + + verifyFormat("[[maybe_unused]]\n" + "foo f;", + Style); owenca

[clang] [clang-format] Add .clang-format-ignore for ignoring files (PR #76327)

2023-12-28 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/76327 >From 4afd12db61528b40d842a7fbee9af37c2235822c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Dec 2023 01:18:55 -0800 Subject: [PATCH 1/7] [clang-format] Add .clang-format.ignore for ignoring files

[clang] [clang-format] Add .clang-format-ignore for ignoring files (PR #76327)

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

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-28 Thread Owen Pan via cfe-commits
@@ -570,6 +571,74 @@ static int dumpConfig(bool IsSTDIN) { return 0; } +// Check whether `FilePath` is ignored according to the nearest +// .clang-format-ignore file based on the rules below: +// - A blank line is skipped. +// - Leading and trailing spaces of a line are

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-28 Thread Owen Pan via cfe-commits
@@ -570,6 +571,74 @@ static int dumpConfig(bool IsSTDIN) { return 0; } +// Check whether `FilePath` is ignored according to the nearest +// .clang-format-ignore file based on the rules below: +// - A blank line is skipped. +// - Leading and trailing spaces of a line are

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-26 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/76327 >From 4afd12db61528b40d842a7fbee9af37c2235822c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Dec 2023 01:18:55 -0800 Subject: [PATCH 1/6] [clang-format] Add .clang-format.ignore for ignoring files

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-26 Thread Owen Pan via cfe-commits
@@ -570,6 +571,74 @@ static int dumpConfig(bool IsSTDIN) { return 0; } +// Check whether `FilePath` is ignored according to the nearest +// .clang-format-ignore file based on the rules below: +// - A blank line is skipped. +// - Leading and trailing spaces of a line are

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-26 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/76327 >From 4afd12db61528b40d842a7fbee9af37c2235822c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Dec 2023 01:18:55 -0800 Subject: [PATCH 1/5] [clang-format] Add .clang-format.ignore for ignoring files

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-26 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/76327 >From 4afd12db61528b40d842a7fbee9af37c2235822c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Dec 2023 01:18:55 -0800 Subject: [PATCH 1/4] [clang-format] Add .clang-format.ignore for ignoring files

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-26 Thread Owen Pan via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: rm -rf %t.dir +// RUN: mkdir -p %t.dir/level1/level2 + +// RUN: cd %t.dir +// RUN: printf "%%s\n" "\*" "level*/*.c*" "*/*2/foo.*" > .clang-format-ignore owenca wrote: ```suggestion // RUN: echo "*" > .clang-format-ignore // RUN: echo

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-26 Thread Owen Pan via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: rm -rf %t.dir +// RUN: mkdir -p %t.dir/level1/level2 + +// RUN: cd %t.dir +// RUN: printf "%%s\n" "\*" "level*/*.c*" "*/*2/foo.*" > .clang-format-ignore +// RUN: touch foo.cc +// RUN: clang-format -verbose .clang-format-ignore foo.cc 2> %t.stderr +//

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-26 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/76327 >From 4afd12db61528b40d842a7fbee9af37c2235822c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Dec 2023 01:18:55 -0800 Subject: [PATCH 1/3] [clang-format] Add .clang-format.ignore for ignoring files

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-24 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/76327 >From 4afd12db61528b40d842a7fbee9af37c2235822c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Dec 2023 01:18:55 -0800 Subject: [PATCH 1/2] [clang-format] Add .clang-format.ignore for ignoring files

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-24 Thread Owen Pan via cfe-commits
@@ -131,6 +131,24 @@ An easy way to create the ``.clang-format`` file is: Available style options are described in :doc:`ClangFormatStyleOptions`. +You can create ``.clang-format-ignore`` files to make ``clang-format`` ignore +certain files. A ``.clang-format-ignore`` file

[clang] [clang-format] Add .clang-format.ignore for ignoring files (PR #76327)

2023-12-24 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/76327 Closes #52975. >From 4afd12db61528b40d842a7fbee9af37c2235822c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Dec 2023 01:18:55 -0800 Subject: [PATCH] [clang-format] Add .clang-format.ignore for ignoring

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

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

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

2023-12-23 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/3] [clang-format] Add an fnmatch-like function for

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

2023-12-23 Thread Owen Pan via cfe-commits
@@ -0,0 +1,121 @@ +//===--- MatchFilePath.cpp - Match file path with pattern ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [clang-format] Do not break on JS fields like on goto labels (PR #76233)

2023-12-23 Thread Owen Pan via cfe-commits
owenca wrote: > This regressions was introduced in > [70d7ea0](https://github.com/llvm/llvm-project/commit/70d7ea0cebcf363cd0ddcfb76375fb5fada87dd5). > The commit moved some code and correctly picked up an explicit check for not > running on Verilog. However, the moved code also never ran for

[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

[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 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

[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] 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 =

[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

[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] [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:

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

2023-12-21 Thread Owen Pan via cfe-commits
@@ -583,20 +583,26 @@ bool ContinuationIndenter::mustBreak(const LineState ) { return true; } - // If the return type spans multiple lines, wrap before the function name. - if (((Current.is(TT_FunctionDeclarationName) && -!State.Line->ReturnTypeWrapped && -

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

2023-12-21 Thread Owen Pan via cfe-commits
owenca wrote: See [here](https://discourse.llvm.org/t/why-are-the-breaks-sometimes-removed-when-alwaysbreakafterreturntype-is-all/75780/4?u=owenpan) for background info. https://github.com/llvm/llvm-project/pull/76206 ___ cfe-commits mailing list

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

2023-12-21 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/76206 Annotates function declaration names having unnamed parameters. >From 170d2e573904286ae6ee8fad9df6ea467eb54eb8 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 21 Dec 2023 21:27:47 -0800 Subject: [PATCH]

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

2023-12-21 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] [clang-format] Add an fnmatch-like function for .clang-format-ignore

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

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

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

2023-12-21 Thread Owen Pan via cfe-commits
owenca wrote: > I avoid this by using clang-format binary from main branch in my local. What > should I do with this failure? You can ignore it if running the in-tree clang-format is clean, e.g.: ``` $ clang/tools/clang-format/git-clang-format --binary build/bin/clang-format HEAD~

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

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

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

2023-12-19 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/76021 This is needed because Windows doesn't have anything equivalent to the POSIX fnmatch() function. >From b53c8b6c6d34857168d868d99c8d7ea7a69621eb Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 19 Dec 2023

[clang] [clang-format] Fix a bug in `IndentExternBlock: NoIndent` (PR #75731)

2023-12-17 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/75731 ___ 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 `IndentExternBlock: NoIndent` (PR #75731)

2023-12-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/75731 Fixes #36620. Fixes #75719. >From 9e54c990db8e597a85239b1efea06b597acf6beb Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 16 Dec 2023 22:50:27 -0800 Subject: [PATCH] [clang-format] Fix a bug in

[clang] [clang-format] Fix a bug in git-clang-format.bat (PR #75268)

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

[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

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

[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

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

[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

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

[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

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

[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

2023-12-12 Thread Owen Pan via cfe-commits
@@ -298,6 +298,17 @@ TEST_F(TokenAnnotatorTest, UnderstandsUsesOfStarAndAmp) { ASSERT_EQ(Tokens.size(), 12u) << Tokens; EXPECT_TOKEN(Tokens[2], tok::identifier, TT_TypeName); EXPECT_TOKEN(Tokens[3], tok::star, TT_PointerOrReference); + + Tokens = annotate("class Foo

[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

2023-12-12 Thread Owen Pan via cfe-commits
@@ -11727,6 +11727,13 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) { " void func(type ) { a & member; }\n" " anotherType \n" "}"); + + Style.ReferenceAlignment = FormatStyle::RAS_Left; + verifyFormat("class Foo {\n" +

[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

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

[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

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

[clang] [clang-format] Fix parsing of `operator<() {}` (PR #75144)

2023-12-12 Thread Owen Pan via cfe-commits
@@ -164,6 +167,12 @@ class AnnotatingParser { TT_OverloadedOperatorLParen))) { return false; } + FormatToken *ClosingParen = nullptr; + if (Previous.Previous->is(tok::kw_operator) && + isFunctionDeclarationName(Style.isCpp(),

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

2023-12-12 Thread Owen Pan via cfe-commits
owenca wrote: See #75268. https://github.com/llvm/llvm-project/pull/69228 ___ 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 git-clang-format.bat (PR #75268)

2023-12-12 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/75268 Pass the fully-qualified path name (less the file extension) of git-clang-format.bat to py so that it can be run from anywhere. Fixes #75265. >From 1eb01de0a5bcd20c903348ecccbc559751d97be5 Mon Sep 17 00:00:00

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

2023-12-12 Thread Owen Pan via cfe-commits
@@ -0,0 +1 @@ +py -3 git-clang-format %* owenca wrote: @llvm-beanz This doesn't seem to work if `git-clang-format` is run from another directory: ``` C:\Users\Owen\llvm-project>clang\tools\clang-format\git-clang-format C:\Users\Owen\llvm-project>py -3

[clang] [clang] Use StringRef::{starts,ends}_with (NFC) (PR #75149)

2023-12-12 Thread Owen Pan via cfe-commits
owenca wrote: Running the in-tree clang-format on the changed files in clang/lib/Format passed, so that part LGTM. https://github.com/llvm/llvm-project/pull/75149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format][NFC] Clean up the driver and getStyle() in Format.cpp (PR #74794)

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

[clang] [clang-format][NFC] Clean up the driver and getStyle() in Format.cpp (PR #74794)

2023-12-07 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/74794 None >From fb239719267ec97905ebb339176b5f7015de04eb Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 7 Dec 2023 17:42:45 -0800 Subject: [PATCH] [clang-format][NFC] Clean up ClangFormat.cpp and getStyle() in

[clang] b683709 - [clang-format] Fix a possible crash in `AlignAfterOpenBracket: BlockIndent`

2023-12-06 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-12-06T17:40:41-08:00 New Revision: b683709ea6eec7d0a388bd50c571774c9b9ffdb7 URL: https://github.com/llvm/llvm-project/commit/b683709ea6eec7d0a388bd50c571774c9b9ffdb7 DIFF: https://github.com/llvm/llvm-project/commit/b683709ea6eec7d0a388bd50c571774c9b9ffdb7.diff

[clang] [clang-format] Handle merging functions containing only a block comment (PR #74651)

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

[clang] [clang-format] Handle merging functions containing only a block comment (PR #74651)

2023-12-06 Thread Owen Pan via cfe-commits
@@ -411,9 +411,16 @@ class LineJoiner { } } +const auto *LastNonComment = TheLine->getLastNonComment(); +assert(LastNonComment); +// FIXME: There are probably cases where we should use LastNonComment owenca wrote: No. This is new from

[clang] [clang-format] Handle merging functions containing only a block comment (PR #74651)

2023-12-06 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/74651 Fixed #41854. >From 40859e0887fd53bbb02be213fcacf3d6d1a5a487 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 6 Dec 2023 12:01:19 -0800 Subject: [PATCH] [clang-format] Handle merging functions containing only

[clang] [clang-format][NFC] Refactor getting first/last non-comment of line (PR #74570)

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

[clang] [clang-format][NFC] Refactor getting first/last non-comment of line (PR #74570)

2023-12-05 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/74570 None >From a37925ae51d95e91d32ec50bc39a9b6e5b13c571 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 5 Dec 2023 23:31:28 -0800 Subject: [PATCH] [clang-format][NFC] Refactor getting first/last non-comment of

[clang] [compiler-rt] [llvm] [clang-tools-extra] [flang] [libc] [clang-format] Add "three dot" diff option to git-clang-format (PR #74230)

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

[clang] [compiler-rt] [llvm] [clang-tools-extra] [flang] [libc] [clang-format] Add "three dot" diff option to git-clang-format (PR #74230)

2023-12-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/74230 >From ae4097b53b90e31802be0be5c8a81fb74c81efc9 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 2 Dec 2023 23:46:58 -0800 Subject: [PATCH 1/3] [clang-format] Add "three dot" diff option to

[clang] [clang-format][NFC] Use `prog` in clang-format-diff.py (PR #74399)

2023-12-05 Thread Owen Pan via cfe-commits
owenca wrote: > You can remove the useless `import os` then :-) Good catch! https://github.com/llvm/llvm-project/pull/74399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Use `prog` in clang-format-diff.py (PR #74399)

2023-12-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/74399 >From ee039e7c50751fabdbaadae73a0a09bc905620f2 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 4 Dec 2023 17:33:47 -0800 Subject: [PATCH 1/3] [clang-format][NFC] Use `prog` in clang-format-diff.py This is a

[clang] [clang-format][NFC] Use `prog` in clang-format-diff.py (PR #74399)

2023-12-04 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/74399 >From ee039e7c50751fabdbaadae73a0a09bc905620f2 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 4 Dec 2023 17:33:47 -0800 Subject: [PATCH 1/2] [clang-format][NFC] Use `prog` in clang-format-diff.py This is a

[clang] [clang-format][NFC] Use `prog` in clang-format-diff.py (PR #74399)

2023-12-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/74399 This is a minor improvement to #73491. >From ee039e7c50751fabdbaadae73a0a09bc905620f2 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 4 Dec 2023 17:33:47 -0800 Subject: [PATCH] [clang-format][NFC] Use `prog`

[clang] [clang-format] Remove duplicates in @property using std::set (PR #74235)

2023-12-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/74235 ___ 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 `git-clang-format --binary` (PR #74293)

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

[clang] [clang-format] Add "three dot" diff option to git-clang-format (PR #74230)

2023-12-04 Thread Owen Pan via cfe-commits
@@ -328,6 +337,10 @@ def compute_diff(commits, files, staged): git_tool = 'diff-tree' elif staged: extra_args += ['--cached'] + + if len(commits) > 1 and diff_common_commit: +commits = [f'{commits[0]}...{commits[1]}'] owenca wrote:

[clang] [clang-format] Add "three dot" diff option to git-clang-format (PR #74230)

2023-12-04 Thread Owen Pan via cfe-commits
@@ -153,8 +157,13 @@ def main(): else: if len(commits) > 2: die('at most two commits allowed; %d given' % len(commits)) + if len(commits) < 2 and opts.diff_from_common_commit: +die('--diff_from_common_commit is only allowed when two commits are given')

[clang] [clang-format] Fix a bug in `git-clang-format --binary` (PR #74293)

2023-12-04 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/74293 ___ 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 `git-clang-format --binary` (PR #74293)

2023-12-04 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/74293 >From a394ac020c1045705fb2898d32754bdf12fac4bd Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 4 Dec 2023 01:03:18 -0800 Subject: [PATCH] [clang-format] Fix a bug in `git-clang-format --binary` This is a

[clang] [clang-format] Fix a bug in `git-clang-format --binary` (PR #74293)

2023-12-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/74293 This is a rework of #74176. >From fddf15404c0f5de2d9b264413b94d45a4a73edde Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 4 Dec 2023 01:03:18 -0800 Subject: [PATCH] [clang-format] Fix a bug in

[clang] [clang-format] Remove duplicates in @property using std::set (PR #74235)

2023-12-03 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/74235 >From 7323d9261fe8c876fe3a656a98e186af3dd0b2a0 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 3 Dec 2023 01:41:57 -0800 Subject: [PATCH 1/2] [clang-format] Remove duplicates in @property using std::set

[clang] [clang-format] Fix a bug in `git-clang-format --binary` (PR #74176)

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

[clang] [clang-format] Remove duplicates in @property using std::set (PR #74235)

2023-12-03 Thread Owen Pan via cfe-commits
owenca wrote: @jaredgrubb I can't add you to Reviewers. Maybe you can add yourself? https://github.com/llvm/llvm-project/pull/74235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Remove duplicates in @property using std::set (PR #74235)

2023-12-03 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/74235 Re-implement ObjCPropertyAttributeOrder using std::set for sorting and removing duplicates. (We can't use llvm::SmallSet because it's unordered.) >From 7323d9261fe8c876fe3a656a98e186af3dd0b2a0 Mon Sep 17

[clang] [clang-format] Fix a bug in `git-clang-format --binary` (PR #74176)

2023-12-01 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/74176 Fixed #74165. >From 462a93a59b236fd6f6750ed69c8629db12cd32a9 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 1 Dec 2023 18:31:05 -0800 Subject: [PATCH] [clang-format] Fix a bug in `git-clang-format --binary`

[clang] c45a66e - [clang-format] ObjCPropertyAttributeOrder to sort ObjC property attributes

2023-12-01 Thread Owen Pan via cfe-commits
Author: Jared Grubb Date: 2023-12-01T17:41:30-08:00 New Revision: c45a66ecd4cb8f351298ca987d6086cf02b77bfb URL: https://github.com/llvm/llvm-project/commit/c45a66ecd4cb8f351298ca987d6086cf02b77bfb DIFF: https://github.com/llvm/llvm-project/commit/c45a66ecd4cb8f351298ca987d6086cf02b77bfb.diff

[clang] 5c60e2c - [clang-format][NFC] Reformat source code with clang-format style

2023-11-30 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-11-30T20:19:30-08:00 New Revision: 5c60e2ce78e79c2d15152e08d9e28fcf3a1d4e51 URL: https://github.com/llvm/llvm-project/commit/5c60e2ce78e79c2d15152e08d9e28fcf3a1d4e51 DIFF: https://github.com/llvm/llvm-project/commit/5c60e2ce78e79c2d15152e08d9e28fcf3a1d4e51.diff

[clang] [clang-format] Don't skip stringizing when determining brace kind (PR #73886)

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

[clang] [clang-format] Don't skip stringizing when determining brace kind (PR #73886)

2023-11-29 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/73886 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't skip stringizing when determining brace kind (PR #73886)

2023-11-29 Thread Owen Pan via cfe-commits
@@ -1851,6 +1851,22 @@ TEST_F(TokenAnnotatorTest, UnderstandsTrailingReturnArrow) { EXPECT_TOKEN(Tokens[13], tok::arrow, TT_Unknown); } +TEST_F(TokenAnnotatorTest, UnderstandHashInMacro) { + auto Tokens = annotate("#define Foo(Bar) \\\n" + " {

[clang] [clang-format] Don't skip stringizing when determining brace kind (PR #73886)

2023-11-29 Thread Owen Pan via cfe-commits
@@ -1851,6 +1851,22 @@ TEST_F(TokenAnnotatorTest, UnderstandsTrailingReturnArrow) { EXPECT_TOKEN(Tokens[13], tok::arrow, TT_Unknown); } +TEST_F(TokenAnnotatorTest, UnderstandHashInMacro) { + auto Tokens = annotate("#define Foo(Bar) \\\n" + " {

[clang] [clang-format] Don't skip stringizing when determining brace kind (PR #73886)

2023-11-29 Thread Owen Pan via cfe-commits
@@ -496,7 +496,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { do { NextTok = Tokens->getNextToken(); } while (NextTok->is(tok::comment)); -while (NextTok->is(tok::hash)) { +while (NextTok->is(tok::hash) &&

[clang] [clang-format] Option to ignore macro definitions (PR #70338)

2023-11-29 Thread Owen Pan via cfe-commits
@@ -1157,7 +1157,15 @@ void UnwrappedLineParser::parsePPDefine() { // guard processing above, and changes preprocessing nesting. FormatTok->Tok.setKind(tok::identifier); FormatTok->Tok.setIdentifierInfo(Keywords.kw_internal_ident_after_define); - nextToken(); + + if

[clang] [clang-format] Finalize children after formatting them (PR #73753)

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

[clang] [clang-format][NFC] Extend isProto() to also cover LK_TextProto (PR #73582)

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

[clang-tools-extra] [flang] [clang] [compiler-rt] [libcxx] [llvm] [lldb] [libc] ✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

2023-11-29 Thread Owen Pan via cfe-commits
@@ -1464,6 +1467,21 @@ class AnnotatingParser { } } + void parseEmbedDirective() { +if (CurrentToken && CurrentToken->is(tok::less)) { + next(); + while (CurrentToken) { +// Mark tokens up to the trailing line comments as implicit string +

[clang] [clang-format] Finalize children after formatting them (PR #73753)

2023-11-28 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/73753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Finalize children after formatting them (PR #73753)

2023-11-28 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/73753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    3   4   5   6   7   8   9   10   11   12   >