https://github.com/owenca converted_to_draft
https://github.com/llvm/llvm-project/pull/113864
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -143,8 +143,17 @@ if (LLVM_ENABLE_SPHINX)
gen_rst_file_from_td(DiagnosticsReference.rst -gen-diag-docs
../include/clang/Basic/Diagnostic.td "${docs_targets}")
gen_rst_file_from_td(ClangCommandLineReference.rst -gen-opt-docs
../include/clang/Driver/ClangOptionDocs.td
@@ -185,6651 +179,10 @@ the configuration (without a prefix: ``Auto``).
subdirectories. This is also possible through the command line, e.g.:
``--style={BasedOnStyle: InheritParentConfig, ColumnLimit: 20}``
+.. This section of the file is automatically generated by the
@@ -143,8 +143,17 @@ if (LLVM_ENABLE_SPHINX)
gen_rst_file_from_td(DiagnosticsReference.rst -gen-diag-docs
../include/clang/Basic/Diagnostic.td "${docs_targets}")
gen_rst_file_from_td(ClangCommandLineReference.rst -gen-opt-docs
../include/clang/Driver/ClangOptionDocs.td
@@ -1296,6 +1296,15 @@ TEST_F(TokenAnnotatorTest,
UnderstandsRequiresClausesAndConcepts) {
Tokens = annotate("bool x = t && requires(Foo x) { x.foo(); };");
ASSERT_EQ(Tokens.size(), 25u) << Tokens;
EXPECT_TOKEN(Tokens[5], tok::kw_requires, TT_RequiresExpression);
+
+ //
@@ -143,8 +143,17 @@ if (LLVM_ENABLE_SPHINX)
gen_rst_file_from_td(DiagnosticsReference.rst -gen-diag-docs
../include/clang/Basic/Diagnostic.td "${docs_targets}")
gen_rst_file_from_td(ClangCommandLineReference.rst -gen-opt-docs
../include/clang/Driver/ClangOptionDocs.td
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/113640
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/113640
>From 274b7cbdd8989c9f34c3df4041fa9098857bcc89 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 24 Oct 2024 20:05:52 -0700
Subject: [PATCH 1/3] [clang-format] Print the names of unfound files in error
messages
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/113640
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/113100
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Owen Pan
Date: 2024-10-24T18:36:58-07:00
New Revision: 78e7d9592d7c3b500ae2bae097d8cd7cd9369671
URL:
https://github.com/llvm/llvm-project/commit/78e7d9592d7c3b500ae2bae097d8cd7cd9369671
DIFF:
https://github.com/llvm/llvm-project/commit/78e7d9592d7c3b500ae2bae097d8cd7cd9369671.diff
LOG:
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/113100
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -53,3 +53,10 @@ foreach (file IN LISTS files)
endforeach ()
add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
+
+add_custom_target(clang-format-style-options
+COMMAND "${Python3_EXECUTABLE}" dump_format_style.py
owenca wrote:
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/111513
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -53,3 +53,10 @@ foreach (file IN LISTS files)
endforeach ()
add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
+
+add_custom_target(clang-format-style-options
+COMMAND "${Python3_EXECUTABLE}" dump_format_style.py
+WORKING_DIRECTORY "${CMAKE
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/113268
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5230,6 +5239,7 @@ struct FormatStyle {
TableGenBreakingDAGArgOperators ==
R.TableGenBreakingDAGArgOperators &&
TableGenBreakInsideDAGArg == R.TableGenBreakInsideDAGArg &&
+ TabWidth == R.TabWidth && TemplateNames == R.TemplateN
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/113864
>From 85f78a4879a37fb367dccd5299b35d1c75c2b46f Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sun, 27 Oct 2024 22:22:11 -0700
Subject: [PATCH 1/2] [clang-format] Add ConfigFile option
Closes #107808.
---
clang/d
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/114506
Fixes #114408.
>From 4702c777252678bf3633fd72a0470d135a54c4ba Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 31 Oct 2024 21:40:17 -0700
Subject: [PATCH] [clang-format] Fix a regression in parsing `switch` in
owenca wrote:
@boomanaiden154 can we have `clang-format-style-options` rebuilt only when it's
outdated, i.e. only if at least one of the following has been updated?
```
clang/include/clang/Format/Format.h
clang/include/clang/Tooling/Inclusions/IncludeStyle.h
clang/docs/ClangFormatStyleOptions.rs
@@ -1 +1 @@
-py -3 "%~pn0" %*
+py -3 "%~dpn0" %*
owenca wrote:
```suggestion
py -3 "%~f0" %*
```
See
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/call#batch-parameters.
https://github.com/llvm/llvm-project/pull/114078
___
owenca wrote:
> > I personally use Cygwin and it's git understands unix paths is that not the
> > case for msys2
>
> Git can understand (and will return a) unix path, but it seems MSYS2's python
> won't accept unix path. It fails at `os.chdir(toplevel)`, and `toplevel` is a
> unix path.
Isn'
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/109220
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca deleted
https://github.com/llvm/llvm-project/pull/114078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/114078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/114078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/109229
Fixes #109146.
>From 84c166dfabc3f314cd922baa3933b3d0ea11e08e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 18 Sep 2024 21:03:24 -0700
Subject: [PATCH] [clang-format] Annotate the l_paren of function pointe
owenca wrote:
Wouldn't you have the same problem if we were to backport the fix, say, to
18.1.9? Anyway, LLVM 19.1.0 has just been released.
https://github.com/llvm/llvm-project/pull/99791
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/108634
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> In regards to the "Test documentation build / Test documentation build
> (pull_request) " failure, I'm honestly not sure how to fix the formatting in
> this. I'm not seeing anything wrong with my addition in Format.h, but maybe
> there's something I'm missing. I never touch Cla
@@ -225,6 +225,21 @@ struct FormatStyle {
/// bbb = 2;
/// \endcode
bool AlignCompound;
+/// Only for ``AlignConsecutiveDeclarations``. Whether function
declarations
+/// are aligned.
+/// \code
+/// true:
+/// unsigned int f1(void);
+
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/108717
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/108717
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/108241
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/108241
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -225,6 +225,21 @@ struct FormatStyle {
/// bbb = 2;
/// \endcode
bool AlignCompound;
+/// Only for ``AlignConsecutiveDeclarations``. Whether function
declarations
+/// are aligned.
+/// \code
+/// true:
+/// unsigned int f1(void);
+
@@ -409,6 +409,21 @@ the configuration (without a prefix: ``Auto``).
int *p;
int (*f)();
+ * ``bool AlignFunctionDeclarations`` Only for
``AlignConsecutiveDeclarations``. Whether function declarations
owenca wrote:
Version badge is unsupport
@@ -972,6 +972,11 @@ struct FormatStyle {
/// \version 3.7
bool AllowShortLoopsOnASingleLine;
+ /// If ``true``, ``namespace a { class b; }`` can be put on a single a single
+ /// line.
owenca wrote:
```suggestion
/// If ``true``, ``namespace a { clas
@@ -616,6 +626,62 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
+ return 0;
+
@@ -616,6 +626,62 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
+ return 0;
+
@@ -616,6 +626,62 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
+ return 0;
+
@@ -27981,6 +27981,132 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, ShortNamespacesOption) {
+ auto BaseStyle = getLLVMStyle();
+ BaseStyle.AllowShortNamespacesOnASingleLine = true;
+ BaseStyle.FixNamespaceComments = false;
+
+
@@ -27981,6 +27981,132 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, ShortNamespacesOption) {
+ auto BaseStyle = getLLVMStyle();
+ BaseStyle.AllowShortNamespacesOnASingleLine = true;
+ BaseStyle.FixNamespaceComments = false;
+
+
@@ -27981,6 +27981,132 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, ShortNamespacesOption) {
+ auto BaseStyle = getLLVMStyle();
+ BaseStyle.AllowShortNamespacesOnASingleLine = true;
+ BaseStyle.FixNamespaceComments = false;
+
+
@@ -616,6 +626,62 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
+ return 0;
+
@@ -616,6 +626,62 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
o
@@ -361,9 +361,18 @@ class LineJoiner {
const auto *FirstNonComment = TheLine->getFirstNonComment();
if (!FirstNonComment)
return 0;
+
// FIXME: There are probably cases where we should use FirstNonComment
// instead of TheLine->First.
+if (TheLine
@@ -616,6 +626,62 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
+ return 0;
+
@@ -616,6 +626,62 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
+ return 0;
+
@@ -9395,6 +9398,9 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) {
"fooo(new FOO::BA(\n"
"XXXZ()));",
Style);
+ verifyFormat("aaa const aa{\n"
+ "a(a
@@ -9336,6 +9336,9 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) {
"ccc(a, //\n"
"b));",
Style);
+ verifyFormat("aaa const aa{\n"
+ "a(aaa, aa
@@ -348,6 +348,13 @@ bool ContinuationIndenter::canBreak(const LineState
&State) {
}
}
+ // Don't allow breaking before a closing right brace of a block-indented
+ // braced list initializer if there was not already a break.
owenca wrote:
```suggesti
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
owenca wrote:
```suggestion
auto Style = getLLVMStyle();
```
h
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/109229
>From 84c166dfabc3f314cd922baa3933b3d0ea11e08e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 18 Sep 2024 21:03:24 -0700
Subject: [PATCH] [clang-format] Annotate the l_paren of function pointer types
Fixes #
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/109505
Fixes #109371.
>From 192deb4adc9f7e77167a02c060eef8c91932b912 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 20 Sep 2024 20:28:31 -0700
Subject: [PATCH] [clang-format] Correctly annotate */& in if condition
@@ -243,14 +244,16 @@ class AnnotatingParser {
// operator that was misinterpreted because we are parsing template
// parameters.
// FIXME: This is getting out of hand, write a decent parser.
- if (InExpr && !Line.startsWith(tok::kw_template) &&
+ if
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/110408
Fixes #109925.
>From 27135c008868cc4f17b7ca5ff9c2af9c2fc02135 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 28 Sep 2024 22:42:56 -0700
Subject: [PATCH] [clang-format] Handle template closer followed by empt
@@ -243,14 +244,16 @@ class AnnotatingParser {
// operator that was misinterpreted because we are parsing template
// parameters.
// FIXME: This is getting out of hand, write a decent parser.
- if (InExpr && !Line.startsWith(tok::kw_template) &&
+ if
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/109361
Fixes #109358.
>From d954c56f41a96ace6b507f6e6f4531c885db9f38 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 19 Sep 2024 18:56:38 -0700
Subject: [PATCH] [clang-format] Correctly annotate pointer/reference in
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/109370
Fixes #60146.
>From bbe60a2126bd90835738485955fbe05f530afb6e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 19 Sep 2024 21:12:06 -0700
Subject: [PATCH] [clang-format] Correctly annotate pointer/reference in
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/109361
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/109370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/108671
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -243,14 +244,16 @@ class AnnotatingParser {
// operator that was misinterpreted because we are parsing template
// parameters.
// FIXME: This is getting out of hand, write a decent parser.
- if (InExpr && !Line.startsWith(tok::kw_template) &&
+ if
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/109229
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/109505
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/109916
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/110408
>From 27135c008868cc4f17b7ca5ff9c2af9c2fc02135 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 28 Sep 2024 22:42:56 -0700
Subject: [PATCH 1/2] [clang-format] Handle template closer followed by empty
parethese
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/110408
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/110945
Fixes #110879.
>From ab6f3f4950a5ca1e1297437940730b43746c7f6a Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 2 Oct 2024 19:30:30 -0700
Subject: [PATCH] [clang-format] Fix a bug in annotating PointerOrReferen
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/110971
Fixes #110968.
>From b98834264b09fb283cc060ee06576b014809ec5f Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 3 Oct 2024 01:57:14 -0700
Subject: [PATCH] [clang-format] Handle template closer followed by brace
@@ -3528,6 +3528,17 @@ bool UnwrappedLineParser::parseRequires() {
return false;
}
break;
+case tok::equalequal:
+case tok::greaterequal:
+case tok::lessequal:
+case tok::r_paren:
+case tok::pipepipe:
+ if (OpenAngles == 0) {
+
@@ -3528,6 +3528,17 @@ bool UnwrappedLineParser::parseRequires() {
return false;
}
break;
+case tok::equalequal:
+case tok::greaterequal:
+case tok::lessequal:
+case tok::r_paren:
+case tok::pipepipe:
+ if (OpenAngles == 0) {
+
@@ -3528,6 +3528,17 @@ bool UnwrappedLineParser::parseRequires() {
return false;
}
break;
+case tok::equalequal:
+case tok::greaterequal:
+case tok::lessequal:
+case tok::r_paren:
+case tok::pipepipe:
+ if (OpenAngles == 0) {
+
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/110945
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3528,6 +3528,17 @@ bool UnwrappedLineParser::parseRequires() {
return false;
}
break;
+case tok::equalequal:
+case tok::greaterequal:
+case tok::lessequal:
+case tok::r_paren:
+case tok::pipepipe:
+ if (OpenAngles == 0) {
+
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/108334
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/108797
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/108513
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/108929
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -46,5 +46,16 @@
// CHECK5-NEXT: {{Formatting \[4/5] .*foo\.c}}
// CHECK5-NOT: foo.js
+// RUN: echo "foo.*" > .clang-format-ignore
+// RUN: touch foo.c
+// RUN: echo foo | clang-format -assume-filename=foo.c 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK6 -allow-empty
@@ -707,8 +707,11 @@ int main(int argc, const char **argv) {
errs() << "Clang-formatting " << LineNo << " files\n";
}
- if (FileNames.empty())
+ if (FileNames.empty()) {
+if (!AssumeFileName.empty() && isIgnored(AssumeFileName))
owenca wrote:
```s
@@ -46,5 +46,16 @@
// CHECK5-NEXT: {{Formatting \[4/5] .*foo\.c}}
// CHECK5-NOT: foo.js
+// RUN: echo "foo.*" > .clang-format-ignore
+// RUN: touch foo.c
+// RUN: echo foo | clang-format -assume-filename=foo.c 2>&1 \
owenca wrote:
```suggestion
// RUN: echo "
@@ -46,5 +46,16 @@
// CHECK5-NEXT: {{Formatting \[4/5] .*foo\.c}}
// CHECK5-NOT: foo.js
+// RUN: echo "foo.*" > .clang-format-ignore
+// RUN: touch foo.c
+// RUN: echo foo | clang-format -assume-filename=foo.c 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK6 -allow-empty
Author: Owen Pan
Date: 2024-10-23T21:47:11-07:00
New Revision: 04f14e4d652a344fedea6de8df532e88a652bcc4
URL:
https://github.com/llvm/llvm-project/commit/04f14e4d652a344fedea6de8df532e88a652bcc4
DIFF:
https://github.com/llvm/llvm-project/commit/04f14e4d652a344fedea6de8df532e88a652bcc4.diff
LOG:
@@ -164,6 +164,40 @@ TEST_F(MatchFilePathTest, Path) {
EXPECT_FALSE(match("foo\\", R"(foo*\)"));
}
+TEST_F(MatchFilePathTest, DoubleAsterisk) {
+ EXPECT_TRUE(match("a/b/c/d.cpp", "**b**"));
+ EXPECT_TRUE(match("a/b/c/d.cpp", "**/b/**"));
+ EXPECT_TRUE(match("a/b/c/d_e.cpp
@@ -53,3 +53,10 @@ foreach (file IN LISTS files)
endforeach ()
add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
+
+add_custom_target(clang-format-style-options
+COMMAND "${Python3_EXECUTABLE}" dump_format_style.py
+WORKING_DIRECTORY "${CMAKE
owenca wrote:
> > can we have clang-format-style-options rebuilt only when it's outdated,
> > i.e. only if at least one of the following has been updated?
>
> We can, but it requires more changes that I'm not sure are worth doing given
> that this step takes essentially zero time compared to r
1701 - 1800 of 2645 matches
Mail list logo