Author: Owen Pan
Date: 2025-08-16T20:59:07-07:00
New Revision: ee51f35993d9623563551f9bb9521824992967b6
URL:
https://github.com/llvm/llvm-project/commit/ee51f35993d9623563551f9bb9521824992967b6
DIFF:
https://github.com/llvm/llvm-project/commit/ee51f35993d9623563551f9bb9521824992967b6.diff
LOG:
owenca wrote:
> > IMO, the best place to handle this is in FormatTokenLexer::getNextToken().
>
> I see you have much more experience in this part of the codebase, but I have
> some hangups because I don't understand the implications of doing this move
> myself. Here's what I'm thinking; are th
https://github.com/owenca requested changes to this pull request.
It seems that we don't need to add a separate formatting pass for this new
option as changing the case of letters in numeric literals has no impact on any
existing passes. IMO, the best place to handle this is in
`FormatTokenLex
@@ -3558,6 +3558,76 @@ struct FormatStyle {
/// \version 9
std::vector NamespaceMacros;
+ /// Control over each component in a numeric literal.
+ enum NumericLiteralComponentStyle : int8_t {
+/// Leave this component of the literal as is.
+NLCS_Leave,
+/// Al
owenca wrote:
I suggest `Prefix`, `HexDigit`, `ExponentLetter`, and `Suffix` for the
sub-option names and `Leave`, `Lower`, and `Upper` for the enum values. For
example:
```
NumericLiteralCase:
Prefix: Lower # 0x, 0b, etc.
HexDigit: Upper # ABCDEF
ExponentLetter: Lower # e a
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- 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: Apache-2
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- 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: Apache-2
owenca wrote:
Please wait for @HazardyKnusperkeks and @mydeveloperday.
https://github.com/llvm/llvm-project/pull/151590
___
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/151658
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
/cherry-pick 9281797a577b7954521fb9192d41e457ca2ca42e
https://github.com/llvm/llvm-project/pull/149602
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca milestoned
https://github.com/llvm/llvm-project/pull/149602
___
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/151658
Also make a StringRef literal `static constexpr`.
>From 4ada74523ecab8e5cdeaabf1769ee85461cc5c55 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 31 Jul 2025 23:57:57 -0700
Subject: [PATCH] [clang-format][NFC]
owenca wrote:
/cherry-pick 5fc482cfc0fa70c98e14d64d83dffbf7da03c303
https://github.com/llvm/llvm-project/pull/151273
___
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/151273
___
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/151273
___
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/151273
>From 9fab68a7aa71e6ffe6ad6476359a21884b084576 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 29 Jul 2025 21:09:46 -0700
Subject: [PATCH] [clang-format] Disalbe IntegerLiteralSeparator for C++ before
c++14
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/150744
___
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/150744
>From 7418fe966ff3a3e9f3c6c431beafbdde47a1de30 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 26 Jul 2025 01:56:52 -0700
Subject: [PATCH 1/3] [clang-format] Fix a bug in `DerivePointerAlignment:
true`
This
@@ -2639,32 +2639,42 @@ class Formatter : public TokenAnalyzer {
int countVariableAlignments(const SmallVectorImpl &Lines) {
int AlignmentDiff = 0;
+
for (const AnnotatedLine *Line : Lines) {
AlignmentDiff += countVariableAlignments(Line->Children);
- fo
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/150744
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2639,32 +2639,42 @@ class Formatter : public TokenAnalyzer {
int countVariableAlignments(const SmallVectorImpl &Lines) {
int AlignmentDiff = 0;
+
for (const AnnotatedLine *Line : Lines) {
AlignmentDiff += countVariableAlignments(Line->Children);
- fo
@@ -2639,32 +2639,42 @@ class Formatter : public TokenAnalyzer {
int countVariableAlignments(const SmallVectorImpl &Lines) {
int AlignmentDiff = 0;
+
for (const AnnotatedLine *Line : Lines) {
AlignmentDiff += countVariableAlignments(Line->Children);
- fo
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/150744
>From 7418fe966ff3a3e9f3c6c431beafbdde47a1de30 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 26 Jul 2025 01:56:52 -0700
Subject: [PATCH 1/2] [clang-format] Fix a bug in `DerivePointerAlignment:
true`
This
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/150744
>From 7418fe966ff3a3e9f3c6c431beafbdde47a1de30 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 26 Jul 2025 01:56:52 -0700
Subject: [PATCH 1/2] [clang-format] Fix a bug in `DerivePointerAlignment:
true`
This
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/150744
>From 7418fe966ff3a3e9f3c6c431beafbdde47a1de30 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 26 Jul 2025 01:56:52 -0700
Subject: [PATCH 1/2] [clang-format] Fix a bug in `DerivePointerAlignment:
true`
This
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/150744
>From 7418fe966ff3a3e9f3c6c431beafbdde47a1de30 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 26 Jul 2025 01:56:52 -0700
Subject: [PATCH 1/2] [clang-format] Fix a bug in `DerivePointerAlignment:
true`
This
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/150744
>From 7418fe966ff3a3e9f3c6c431beafbdde47a1de30 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 26 Jul 2025 01:56:52 -0700
Subject: [PATCH 1/2] [clang-format] Fix a bug in `DerivePointerAlignment:
true`
This
@@ -2641,28 +2641,19 @@ class Formatter : public TokenAnalyzer {
int AlignmentDiff = 0;
for (const AnnotatedLine *Line : Lines) {
AlignmentDiff += countVariableAlignments(Line->Children);
- for (FormatToken *Tok = Line->First; Tok && Tok->Next; Tok = Tok->Nex
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/150744
>From 7418fe966ff3a3e9f3c6c431beafbdde47a1de30 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 26 Jul 2025 01:56:52 -0700
Subject: [PATCH] [clang-format] Fix a bug in `DerivePointerAlignment: true`
This effec
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/150744
>From 7418fe966ff3a3e9f3c6c431beafbdde47a1de30 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 26 Jul 2025 01:56:52 -0700
Subject: [PATCH] [clang-format] Fix a bug in `DerivePointerAlignment: true`
This effec
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/150744
This effectively reverts a4d4859dc70c046ad928805ddeaf8fa101793394 which didn't
fix the problem that `int*,` was not counted as "Left" alignment.
Fixes #150327
>From 7418fe966ff3a3e9f3c6c431beafbdde47a1de30 Mon
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/149602
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> Style Guide has been updated internally. I don't know how long it takes to
> make its way to the public site, so I'd like to proceed. I've pasted the
> updated text into the commit description above.
I still think we should wait until it becomes official. WDYT @mydeveloperday
owenca wrote:
/cherry-pick a4d4859dc70c046ad928805ddeaf8fa101793394
https://github.com/llvm/llvm-project/pull/150387
___
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/150387
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
/cherry-pick 97c953406d68357dddb8b624cd32c8e435a9fcfb
https://github.com/llvm/llvm-project/pull/150367
___
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/150367
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca milestoned
https://github.com/llvm/llvm-project/pull/150367
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca milestoned
https://github.com/llvm/llvm-project/pull/150387
___
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/150387
Fixes #150327
>From 12777c2044cc9daac3fffcb96c0c1f4c772e9147 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 24 Jul 2025 01:22:36 -0700
Subject: [PATCH] [clang-format] Fix a bug in `DerivePointerAlignment: tr
https://github.com/owenca approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/150361
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7771,6 +7771,37 @@ TEST_F(FormatTest, ConstructorInitializers) {
"Constructor() :\n"
"// Comment forcing unwanted break.\n"
"() {}");
+
+ // Braced initializers with trailing commas.
+ verifyFormat("MyClass::MyC
@@ -7771,6 +7771,37 @@ TEST_F(FormatTest, ConstructorInitializers) {
"Constructor() :\n"
"// Comment forcing unwanted break.\n"
"() {}");
+
+ // Braced initializers with trailing commas.
+ verifyFormat("MyClass::MyC
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/150166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
It's better to add a value to `SpaceBeforeParensOptions` instead. See #150367.
https://github.com/llvm/llvm-project/pull/150166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/150367
Closes #149971
>From bbe06c902d24df2ae9163ba0b43eca45e82c6506 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 23 Jul 2025 15:51:34 -0700
Subject: [PATCH] [clang-format] Add AfterNot to SpaceBeforeParensOption
@@ -17762,14 +17762,19 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) {
}
TEST_F(FormatTest, SpaceAfterLogicalNot) {
- FormatStyle Spaces = getLLVMStyle();
- Spaces.SpaceAfterLogicalNot = true;
+ auto Spaces = getLLVMStyle();
+ EXPECT_EQ(Spaces.SpaceAfterLogicalNot,
@@ -4483,13 +4483,32 @@ struct FormatStyle {
/// \version 3.5
bool SpaceAfterCStyleCast;
- /// If ``true``, a space is inserted after the logical not operator (``!``).
- /// \code
- ///true: false:
- ///! someExpression();
@@ -4483,13 +4483,32 @@ struct FormatStyle {
/// \version 3.5
bool SpaceAfterCStyleCast;
- /// If ``true``, a space is inserted after the logical not operator (``!``).
- /// \code
- ///true: false:
- ///! someExpression();
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/150166
Replace true/false with SAN_Exclaim/SAN_Never and add SAN_Always.
Closes #149971
>From b5442f59d649b38086ccd91d40c7c291dd924cc8 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 22 Jul 2025 22:07:05 -0700
Subj
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/149765
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> > Can you add a link to the relevant section of the style guide?
>
> The new policy is not yet published, but I added a link to the section which
> will be changed.
This patch looks good now, but IMO we should wait until the new style is
published.
https://github.com/llvm/llv
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/149765
Consistently use `constexpr StringRef Code("string literal");`.
>From 318739aa86bc2ef00d2a32fc1141722b441ece41 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sun, 20 Jul 2025 22:28:24 -0700
Subject: [PATCH] [clan
Author: Owen Pan
Date: 2025-07-20T20:27:37-07:00
New Revision: f3a3270dbca3649b7d56aaa42cb8481fb34e2d67
URL:
https://github.com/llvm/llvm-project/commit/f3a3270dbca3649b7d56aaa42cb8481fb34e2d67
DIFF:
https://github.com/llvm/llvm-project/commit/f3a3270dbca3649b7d56aaa42cb8481fb34e2d67.diff
LOG:
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/148640
___
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/149695
___
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/149695
Fixes #149520
>From 00d145827caea33cbec8f49a03e4c8b56fc40e01 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sun, 20 Jul 2025 00:58:58 -0700
Subject: [PATCH] [clang-format] Fix a bug in `BreakBeforeBinaryOperators
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/149602
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -12287,6 +12287,7 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
", *a);");
verifyGoogleFormat("int const* a = &b;");
+ verifyFormat("int const* a = &b;", "int const *a = &b;", getGoogleStyle());
---
@@ -1753,7 +1753,7 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind
Language) {
GoogleStyle.AttributeMacros.push_back("absl_nullable");
GoogleStyle.AttributeMacros.push_back("absl_nullability_unknown");
GoogleStyle.BreakTemplateDeclarations = FormatStyle::BTDS_Yes
@@ -12891,27 +12892,30 @@ TEST_F(FormatTest, UnderstandsEllipsis) {
}
TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {
+ FormatStyle Style = getLLVMStyle();
owenca wrote:
```suggestion
auto Style = getGoogleStyle();
ASSERT_FALSE(Style.DeriveP
owenca wrote:
/cherry-pick a8f5e9ed6b44562938ce07e2790be90be8f0a6b5
https://github.com/llvm/llvm-project/pull/149039
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1300,22 +1293,16 @@ FormatToken *FormatTokenLexer::getNextToken() {
Style.TabWidth - (Style.TabWidth ? Column % Style.TabWidth : 0);
break;
case '\\':
- case '?':
- case '/':
-// The text was entirely whitespace when this loop was
https://github.com/owenca milestoned
https://github.com/llvm/llvm-project/pull/149039
___
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/137840
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3630,6 +3630,36 @@ static unsigned maxNestingDepth(const AnnotatedLine
&Line) {
return Result;
}
+// Returns the token after the first qualifier of the name, or nullptr if there
+// is no qualifier.
+static FormatToken* skipNameQualifier(const FormatToken *Tok) {
--
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/143194
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca requested changes to this pull request.
Please run `ninja clang-format-check-format` before `git push`.
Also, run `ninja polly-check-format`, which gives the assertion failure below:
```
Assertion failed: (Tok->is(TT_TemplateOpener)), function getFunctionName, file
Tok
@@ -3122,6 +3122,9 @@ class AnnotatingParser {
}
}
+if (PrevToken->isTypeName(LangOpts))
owenca wrote:
It works if `TypeNames: [MyType]` is added to the config, but I've added a
heuristic so that it won't be necessary.
https://github.com/llvm/
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/149039
>From 2418846a33683555f2e14de91aa42c1ec38b3fdb Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 16 Jul 2025 01:59:40 -0700
Subject: [PATCH 1/2] [clang-format] Fix a regression of annotating
PointerOrReference
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/149039
___
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/149039
Fixes 149010
>From 2418846a33683555f2e14de91aa42c1ec38b3fdb Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 16 Jul 2025 01:59:40 -0700
Subject: [PATCH] [clang-format] Fix a regression of annotating
PointerOr
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/137840
___
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/137840
___
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/137840
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4385,8 +4385,18 @@ struct FormatStyle {
///#include "B/a.h" #include "a/b.h"
/// \endcode
bool IgnoreCase;
+/// When sorting includes in each block, only take file extensions into
+/// account if two includes compare equal otherwise.
+/
@@ -622,15 +622,26 @@ template <> struct
ScalarEnumerationTraits {
}
};
-template <> struct ScalarEnumerationTraits {
- static void enumeration(IO &IO, FormatStyle::ShortFunctionStyle &Value) {
-IO.enumCase(Value, "None", FormatStyle::SFS_None);
-IO.enumCase(Value,
@@ -1180,16 +1183,47 @@ TEST_F(FormatTestJS, InliningFunctionLiterals) {
"}",
Style);
- Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
+ Style.AllowShortFunctionsOnASingleLine =
+ FormatStyle::ShortFunctionStyle::setEmptyO
@@ -623,20 +623,29 @@ TEST(ConfigParseTest, ParsesConfiguration) {
CHECK_PARSE("AllowShortBlocksOnASingleLine: true",
AllowShortBlocksOnASingleLine, FormatStyle::SBS_Always);
- Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
CHECK_PARSE("A
owenca wrote:
IIRC, we had so many issues with ``AlignArrayOfStructures`` that at one point
we were discussing whether to disable it. Even after @mydeveloperday had
reduced its functionality to only handling rectangular arrays, we still had to
fix quite a few bugs including crashes before it w
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/148324
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -927,14 +927,12 @@ BreakableLineCommentSection::BreakableLineCommentSection(
}
if (Lines[i].size() != IndentPrefix.size()) {
-PrefixSpaceChange[i] = FirstLineSpaceChange;
+assert(Lines[i].size() > IndentPrefix.size());
-if (SpacesInPref
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/148345
___
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/148345
___
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/148345
>From 3affefb96efe2d2955be66c247276b81d5d1d3a1 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 12 Jul 2025 00:09:49 -0700
Subject: [PATCH 1/2] [clang-format] Add FunctionLikeMacros option
This allows RemovePa
@@ -927,14 +927,12 @@ BreakableLineCommentSection::BreakableLineCommentSection(
}
if (Lines[i].size() != IndentPrefix.size()) {
-PrefixSpaceChange[i] = FirstLineSpaceChange;
+assert(Lines[i].size() > IndentPrefix.size());
-if (SpacesInPref
@@ -2786,6 +2786,11 @@ struct FormatStyle {
/// \version 3.7
std::vector ForEachMacros;
+ /// A vector of function-like macros whose invocations should be skipped by
+ /// ``RemoveParentheses``.
+ /// \version 21
+ std::vector FunctionLikeMacros;
owenc
@@ -927,14 +927,12 @@ BreakableLineCommentSection::BreakableLineCommentSection(
}
if (Lines[i].size() != IndentPrefix.size()) {
-PrefixSpaceChange[i] = FirstLineSpaceChange;
+assert(Lines[i].size() > IndentPrefix.size());
-if (SpacesInPref
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/148345
This allows RemoveParentheses to skip the invocations of function-like macros.
Fixes #68354.
Fixes #147780.
>From 3affefb96efe2d2955be66c247276b81d5d1d3a1 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 12 J
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/148324
None
>From 88f34fb41704bdd6f6de743a5b467cdc3c938cc4 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 11 Jul 2025 18:18:18 -0700
Subject: [PATCH] [clang-format][NFC] Simplify some logic in
BreakableLineComment
Author: Owen Pan
Date: 2025-07-11T18:15:27-07:00
New Revision: 2f1673eaa0e3b0c98cdd66429849ec27e220055b
URL:
https://github.com/llvm/llvm-project/commit/2f1673eaa0e3b0c98cdd66429849ec27e220055b
DIFF:
https://github.com/llvm/llvm-project/commit/2f1673eaa0e3b0c98cdd66429849ec27e220055b.diff
LOG:
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/147648
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -513,9 +513,9 @@ struct FormatStyle {
ENAS_LeftWithLastLine,
/// Align escaped newlines in the right-most column.
/// \code
-/// #define A
\
-/// int ;
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/146245
___
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/147648
>From 3efb5ca11d67ad36c4cbb1ea78220a1ca69a8339 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 8 Jul 2025 21:16:12 -0700
Subject: [PATCH 1/2] [clang-format] Split line comments separated by
backslashes
Fixes
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/147648
>From 3efb5ca11d67ad36c4cbb1ea78220a1ca69a8339 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 8 Jul 2025 21:16:12 -0700
Subject: [PATCH 1/2] [clang-format] Split line comments separated by
backslashes
Fixes
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/147648
Fixes #147341
>From 3efb5ca11d67ad36c4cbb1ea78220a1ca69a8339 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 8 Jul 2025 21:16:12 -0700
Subject: [PATCH] [clang-format] Split line comments separated by backslas
@@ -777,7 +779,7 @@ template <> struct
MappingTraits {
IO.mapOptional("Maximum", signedMaximum);
Space.Maximum = static_cast(signedMaximum);
-if (Space.Maximum != -1u)
+if (Space.Maximum != std::numeric_limits::max())
owenca wrote:
```suggest
Author: Owen Pan
Date: 2025-07-06T23:54:00-07:00
New Revision: a5af8745039f906c4fc4184a1fe0d35d42355f52
URL:
https://github.com/llvm/llvm-project/commit/a5af8745039f906c4fc4184a1fe0d35d42355f52
DIFF:
https://github.com/llvm/llvm-project/commit/a5af8745039f906c4fc4184a1fe0d35d42355f52.diff
LOG:
owenca wrote:
Had we used `StringRef::contains` initially, would you still insist that it be
replaced with a "more performant" local function? Please note that the code is
not on a performance critical path, and the difference in time it takes to run
the relevant unit tests for 100 times is wi
1 - 100 of 2160 matches
Mail list logo