[PATCH] D152804: [clang-format] Propose a new solution to - Fix overlapping replacements before PPDirectives

2023-06-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I've updated D151954 . If that doesn't work, we should land this patch and continue to work on a more general solution. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152804/new/ https://re

[PATCH] D151954: [clang-format] Fix overlapping whitespace replacements before PPDirective

2023-06-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 531538. owenpan edited the summary of this revision. owenpan added a reviewer: paulkirth. owenpan removed a subscriber: paulkirth. owenpan added a comment. Add a member `Newlines` to `struct FormatToken` and compute it only once in `UnwrappedLineFormatter::fo

[PATCH] D152473: [clang-format] Add test case for issue 63170

2023-06-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D152473#4410030 , @paulkirth wrote: > In D152473#4409975 , > @MyDeveloperDay wrote: > >> In D152473#4409146 , @paulkirth >> wrote: >> >>> The

[PATCH] D152804: [clang-format] Propose a new solution to - Fix overlapping replacements before PPDirectives

2023-06-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I got something that looks promising: diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index dd23bd35411d..bba030238338 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -418,6 +418,12 @@ public:

[PATCH] D151761: clang-format: Add AlignConsecutiveShortCaseStatements

2023-06-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D151761#4418809 , @HazardyKnusperkeks wrote: > I think we need some input what should be able to be aligned - the statement > vs. the colon - and only //short// case statements vs all case statements. I think we should align

[PATCH] D151761: clang-format: Add AlignConsecutiveShortCaseStatements

2023-06-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D151761#4410998 , @HazardyKnusperkeks wrote: > In D151761#4410158 , @galenelias > wrote: > >> Yah, I think leaving it open would be my preference at this point. Not sure >> how to p

[PATCH] D152473: [clang-format] Add test case for issue 63170

2023-06-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Can you add the test to clang/unittests/Format/FormatTest.cpp instead? Please also include the full diff. See https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://re

[PATCH] D151954: [clang-format] Fix overlapping whitespace replacements before PPDirective

2023-06-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a subscriber: leonardchan. owenpan added a comment. @leonardchan I'm not sure this patch should be reverted just yet. I can't reproduce the regression, and this patch does fix a previous regression. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D152305: [clang-format] Add the KeepEmptyLinesAtEOF option

2023-06-07 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd2627cf88d25: [clang-format] Add the KeepEmptyLinesAtEOF option (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152305/new/ https://rev

[PATCH] D151954: [clang-format] Fix overlapping whitespace replacements before PPDirective

2023-06-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D151954#4403921 , @paulkirth wrote: > This patch seems to introduce some significant regressions to formatting. > I've filed https://github.com/llvm/llvm-project/issues/63170 with some > candidate code. I'll try to reduce the

[PATCH] D152305: [clang-format] Add the KeepEmptyLinesAtEOF option

2023-06-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added a reviewer: klimek. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Adds an option `KeepEmptyLinesAtE

[PATCH] D151954: [clang-format] Fix overlapping whitespace replacements before PPDirective

2023-06-03 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4b9764959dc4: [clang-format] Fix overlapping replacements before PPDirectives (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D151954: [clang-format] Fix overlapping whitespace replacements before PPDirective

2023-06-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 527765. owenpan added a comment. Removed the `RootToken` parameter. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151954/new/ https://reviews.llvm.org/D151954 Files: clang/lib/Format/UnwrappedLineFormatter.cpp clang/unittests/Format/FormatTest.

[PATCH] D151954: [clang-format] Fix overlapping whitespace replacements before PPDirective

2023-06-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:1425 + const SmallVectorImpl &Lines, + const FormatToken &RootToken, + const FormatStyle &Style) {

[PATCH] D151954: [clang-format] Fix overlapping whitespace replacements before PPDirective

2023-06-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. If the first token of an annotated line is finalized, reuse its `N

[PATCH] D147894: [clang-format][doc] SortIncludes documentation: remove contradiction in its description

2023-05-26 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG10518feaf337: [clang-format][doc] Fix contradiction in SortIncludes description (authored by michael-g-matthews, committed by owenpan). Changed prio

[PATCH] D150848: [clang-format] Respect ColumnLimit 0 lines breaks in inline asm

2023-05-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:361 +(Style.BreakBeforeInlineASMColon == FormatStyle::BBIAS_OnlyMultiline && + Style.ColumnLimit != 0 { return true; FWIW

[PATCH] D151047: [clang-format] Fix indentation for selective formatting.

2023-05-23 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG72ab89e3197c: [clang-format] Fix indentation for selective formatting (authored by Sedeniono, committed by owenpan). Repository: rG LLVM Github Mo

[PATCH] D151047: [clang-format] Fix indentation for selective formatting.

2023-05-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. In D151047#4361205 , @Sedeniono wrote: > Regarding name and mail: If you use "Sedenion" as name and > "39583823+sedeni...@users.noreply.github.com" as mail, I guess github will > attribute the com

[PATCH] D150403: [clang-format] Adjust braced list detection (try 2)

2023-05-22 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6dcde658b238: This is a retry of https://reviews.llvm.org/D114583, which was backed (authored by galenelias, committed by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D150403: [clang-format] Adjust braced list detection (try 2)

2023-05-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. In D150403#4362403 , @galenelias wrote: > Galen Elias > > I'm not sure if there is somewhere I should be putting that in the summary or > diff itself, or just here in the comments? Just here in

[PATCH] D150403: [clang-format] Adjust braced list detection (try 2)

2023-05-20 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D150403#4350325 , @galenelias wrote: > In D150403#4347323 , > @HazardyKnusperkeks wrote: > >> We'll wait a bit, if someone might have a comment. And (at least I) need >> name and ema

[PATCH] D150539: [clang-format] Handle ud suffixes in IntegerLiteralSeparator

2023-05-16 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa72b064acf95: [clang-format] Handle ud suffixes in IntegerLiteralSeparator (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1505

[PATCH] D150614: [clang-format] Ignore first token when finding MustBreak

2023-05-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:891-895 +for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) { + // Ignore the first token, because in this situation, it applies more + // to the last token of the p

[PATCH] D150629: [clang-format] Don't allow template to be preceded by closing brace

2023-05-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:10682 verifyFormat("a < 0 ? b : a > 0 ? c : d;"); + verifyFormat("ratio{-1, 2} < ratio{-1, 3} == -1 / 3 > -1 / 2;"); verifyFormat("void f() {\n" Do we need to add a token anno

[PATCH] D150539: [clang-format] Handle ud suffixes in IntegerLiteralSeparator

2023-05-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 522397. owenpan added a comment. Addressed the review comment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150539/new/ https://reviews.llvm.org/D150539 Files: clang/lib/Format/IntegerLiteralSeparatorFixer.cpp clang/unittests/Format/IntegerLit

[PATCH] D150539: [clang-format] Handle ud suffixes in IntegerLiteralSeparator

2023-05-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/IntegerLiteralSeparatorFixer.cpp:116-117 if (Style.isCpp()) { - if (const auto Pos = Text.find_first_of("_i"); Pos != StringRef::npos) { + // FIXME: This doesn't work for ud-suffix d from std::chrono::day.

[PATCH] D150539: [clang-format] Handle ud suffixes in IntegerLiteralSeparator

2023-05-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Fixes https://github.com/llvm/llvm-project/issues/62679. Reposito

[PATCH] D149562: [clang-format] Stop comment disrupting indentation of Verilog ports

2023-05-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D149562#4332188 , @sstwcw wrote: >> IMO a trailing comment (empty or not) belongs to the code before it. > > There is only a parenthesis before it. It doesn't usually need a comment. > It is like in 5a61139. One doesn't ten

[PATCH] D150057: [clang-format] Fix consecutive alignments in #else blocks

2023-05-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked 2 inline comments as done. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:6371-6380 + verifyFormat("#if FOO\n" + "int a = 1;\n" + "#else\n" + "int ab = 2;\n" + "#endif\n" +

[PATCH] D150057: [clang-format] Fix consecutive alignments in #else blocks

2023-05-08 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa4c87f8ccacc: [clang-format] Fix consecutive alignments in #else blocks (authored by owenpan). Changed prior to commit: https://reviews.llvm.org/D150057?vs=520137&id=520560#toc Repository: rG LLVM Gi

[PATCH] D150057: [clang-format] Fix consecutive alignments in #else blocks

2023-05-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:6394 + "#elif BAZ\n" + "bool ab = true;\n" + "#endif\n" Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://re

[PATCH] D149562: [clang-format] Stop comment disrupting indentation of Verilog ports

2023-05-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D149562#4312573 , @sstwcw wrote: > The port list thing and the comment thing work fine for now, except > when there is a comment for the first port. The comment on the first > line would cause the port list to be indented, lik

[PATCH] D150057: [clang-format] Fix consecutive alignments in #else blocks

2023-05-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D150057#4325350 , @HazardyKnusperkeks wrote: > I have to say, I don't understand it, but I believe you. Why is continuing, > when the token is finalized the right thing? See D150057#inline-1449546

[PATCH] D150057: [clang-format] Fix consecutive alignments in #else blocks

2023-05-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:6371-6380 + verifyFormat("#if FOO\n" + "int a = 1;\n" + "#else\n" + "int ab = 2;\n" + "#endif\n" + "#ifdef BAR\n" +

[PATCH] D150057: [clang-format] Fix consecutive alignments in #else blocks

2023-05-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestComments.cpp:2762 // These comments should *not* be aligned - EXPECT_NE( // change for EQ when fixed + EXPECT_EQ( // change for EQ when fixed "#if FOO\n" rymiel wrote: > Shoul

[PATCH] D134042: [clang-format] Fix alignment in #else preprocessor blocks

2023-05-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. See D150057 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134042/new/ https://reviews.llvm.org/D134042 ___ cfe-commits mailing list cfe-commit

[PATCH] D150057: [clang-format] Fix consecutive alignments in #else blocks

2023-05-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added a reviewer: mitchell-stellar. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Since 3.8 or earlier, c

[PATCH] D134042: [clang-format] Fix alignment in #else preprocessor blocks

2023-05-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a subscriber: rymiel. owenpan added a comment. Herald added a reviewer: rymiel. I'll revert this patch due to the regression https://github.com/llvm/llvm-project/issues/61498 unless any of you (and @rymiel ) objects. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

[PATCH] D149643: [clang-format] Correctly limit formatted ranges when specifying qualifier alignment

2023-05-04 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf3dcd3ad992c: [clang-format] Correctly limit formatted ranges when specifying qualifier… (authored by cogilvie, committed by owenpan). Repository:

[PATCH] D149643: [clang-format] Correctly limit formatted ranges when specifying qualifier alignment

2023-05-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Please mark review comments as done after addressing them. Comment at: clang/unittests/Format/QualifierFixerTest.cpp:1356 + "template Foo const f();", + Style, std::vector(1, tooling::Range(0, 36))); + ==

[PATCH] D149647: [NFC][Clang]Fix static analyzer tool remarks about large copies by values

2023-05-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/Format.cpp:3486-3489 + Expanded.InsertBraces = true; + Passes.emplace_back([&](const Environment &Env) { +return BracesInserter(Env, Expanded).process(/*SkipAnnotation=*/true); }); --

[PATCH] D149643: [clang-format] Correctly limit formatted ranges when specifying qualifier alignment

2023-05-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/QualifierFixerTest.cpp:1351 + + // Only the first line should be formatted the second should remain as is + EXPECT_EQ("template const Foo f();\n" =

[PATCH] D149647: [NFC][Clang]Fix static analyzer tool remarks about large copies by value

2023-05-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/Format.cpp:3486-3489 + Expanded.InsertBraces = true; + Passes.emplace_back([&](const Environment &Env) { +return BracesInserter(Env, Expanded).process(/*SkipAnnotation=*/true); }); --

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-29 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc12aa69a0be9: [clang-format] Add BracedInitializerIndentWidth option (authored by jp4a50, committed by owenpan). Changed prior to commit: https://reviews.llvm.org/D146101?vs=517868&id=518140#toc Reposi

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @jp4a50 There's a mismatch between Format.h and and the resulting rst file. I'll rerun dump_format_style.py to fix it before merging. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D1461

[PATCH] D148777: [clang-format] Hanlde leading whitespaces for JSON files

2023-04-20 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG51f6a16646b7: [clang-format] Hanlde leading whitespaces for JSON files (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D148777: [clang-format] Hanlde leading whitespaces for JSON files

2023-04-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D148777#4282574 , @rymiel wrote: > (looks like you linked the same issue twice in the summary) Thanks. Fixed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148777/new/ https://

[PATCH] D148777: [clang-format] Hanlde leading whitespaces for JSON files

2023-04-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Fixes https://github.com/llvm/llvm-project/issues/62228 and https:

[PATCH] D148467: [clang-format] Add a new AfterCSharpProperty to BraceWrapping

2023-04-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/include/clang/Format/Format.h:1220 +/// \endcode +bool AfterCSharpProperty; }; MyDeveloperDay wrote: > HazardyKnusperkeks wrote: > > MyDeveloperDay wrote: > > > HazardyKnusperkeks wrote: > > > > Please s

[PATCH] D148473: [clang-format] C# short ternary operator misinterpreted as a CSharpNullable

2023-04-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:1730 + + auto Tokens = annotate("int? a;\n", Style); + EXPECT_EQ(Tokens.size(), 5u) << Tokens; Nit: no trailing newlines here and below. C

[PATCH] D148467: [clang-format] Add a new AfterCSharpProperty to BraceWrapping

2023-04-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:5007-5010 + (Left.is(tok::semi) && Left.Previous && +Left.Previous->is(Keywords.kw_get) && Right.is(tok::r_brace)) || + (Left.is(tok::semi) && Left.Previous && +Left.Previou

[PATCH] D148472: [clang-format] CSharp don't allow there not to be a space between `is` and `[`

2023-04-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:1182-1186 + verifyFormat("return a is [1, 2, 3]", Style); + verifyFormat("return a is [..]", Style); + Style.SpaceBeforeSquareBrackets = false; + verifyForma

[PATCH] D148447: [clang-format] Fix regression with AlignTrailingComments set to true

2023-04-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D148447#4271942 , @MyDeveloperDay wrote: > If this was the functionality pre 16 then LGTM Yep. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148447/new/ https://reviews.llvm.o

[PATCH] D148447: [clang-format] Fix regression with AlignTrailingComments set to true

2023-04-16 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2bcfff6708d2: [clang-format] Fix regression with AlignTrailingComments set to true (authored by owenpan). Repository: rG LLVM Github Monorepo CHA

[PATCH] D148437: [clang-format] Dont interpret variable named interface as keyword for C++

2023-04-16 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG9db2a0454815: [clang-format] Dont interpret variable named interface as keyword for C++ (authored by sousajo, committed by owenpan). Repository: r

[PATCH] D148447: [clang-format] Fix regression with AlignTrailingComments set to true

2023-04-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, rymiel, yusuke-kadowaki. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. owenpan requested review of this revision. In D132131 , `

[PATCH] D148437: [clang-format] Dont interpret variable named interface as keyword for C++

2023-04-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25432 +TEST_F(FormatTest, InterfaceAsFieldName) { + FormatStyle Style = getLLVMStyle(); Comment at: clang/unittests/Format/FormatTest.cpp:25433-25439 + Format

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D146101#4268487 , @jp4a50 wrote: > Would appreciate someone committing for me. Can you rebase it? I got a conflict in ReleaseNotes.rst. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D148200: [clang-format] Correctly indent comment above finalized PPDirective

2023-04-14 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG293e4da32b1d: [clang-format] Correctly indent comment above finalized PPDirective (authored by owenpan). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D147176: [clang-format] NFC ensure Style operator== remains sorted for ease of editing

2023-04-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D147176#4265130 , @MyDeveloperDay wrote: > we should be good now Thanks! I really like these new rules! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147176/new/ https://revie

[PATCH] D148200: [clang-format] Correctly handle "// clang-format off" above macros

2023-04-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, rymiel. owenpan added a project: clang-format. Herald added projects: All, clang. Herald added a subscriber: cfe-commits. owenpan requested review of this revision. Fixes https://github.com/llvm/llvm-projec

[PATCH] D147176: [clang-format] NFC ensure Style operator== remains sorted for ease of editing

2023-04-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Herald added a reviewer: rymiel. @MyDeveloperDay We keep getting "spammed" by [libc++][format] patches. Can you delete the rule in H987 : "field": "differential.revision.title", "condition": "contains", "value": "[Format]" or change

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1665-1669 + const auto DesignatedInitializerIndentWidth = + Style.DesignatedInitializerIndentWidth < 0 + ? Style.ContinuationIndentWidth

[PATCH] D147969: Add InsertBraces to ChromiumStyle

2023-04-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/Format.cpp:1699 ChromiumStyle.DerivePointerAlignment = false; +ChromiumStyle.InsertBraces = true; if (Language == FormatStyle::LK_ObjC) aaron.ballman wrote: > HazardyKnusperkeks wrote: > >

[PATCH] D146240: [libc++][format] Use granularized charconv.

2023-04-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan removed a reviewer: owenpan. Herald added a reviewer: owenpan. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment It looks like your clang-format review does not contain any unit tests, please try to ensure all code changes have a unit test (unless this is an `NFC`

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-04-05 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5c614bd88f12: [clang-format] Fix bugs with "LambdaBodyIndentation: OuterScope" (authored by jp4a50, committed by owenpan). Repository: rG LLVM Gi

[PATCH] D147422: [clang-format] NFC Document the other space before colon option

2023-04-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D147422#4242115 , @sstwcw wrote: > It looks like a line break gets inserted in arrays. Does that mean the > option doesn't affect arrays? It matters only if `BreakArrays` is set to false. Repository: rG LLVM Github Monor

[PATCH] D147422: [clang-format] NFC Document the other space before colon option

2023-04-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D147422#4240024 , @MyDeveloperDay wrote: > In D147422#4240021 , @owenpan wrote: > >> Should we extend `SpacesInContainerLiterals` so that it controls JSON colons >> too? If yes, then

[PATCH] D147422: [clang-format] NFC Document the other space before colon option

2023-04-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Should we extend `SpacesInContainerLiterals` so that it controls JSON colons too? If yes, then we don't need `SpaceBeforeJsonColon`. Otherwise, IMO we should leave the doc alone. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-04-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D146042#4204651 , @jp4a50 wrote: > I'm confident that the patch will indent all those examples correctly when > they are at block scope which is the only place those snippets will actually > be valid code. I added an exceptio

[PATCH] D147377: [clang-format] Don't allow variable decls to have trailing return arrows

2023-04-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1922 } else if (Current.is(tok::arrow) && AutoFound && (Line.MustBeDeclaration || Line.InPPDirective) && Current.NestingLevel == 0 && It seems we c

[PATCH] D146995: [clang-format][NFC] Refactor unit tests for "LambdaBodyIndentation: OuterScope" option.

2023-04-01 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1dd31ebe5418: [clang-format][NFC] Refactor unit tests for "LambdaBodyIndentation: OuterScope" (authored by jp4a50, committed by owenpan). Repositor

[PATCH] D147327: [clang-format] Add option for having one port per line in Verilog

2023-04-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1149-1191 + if (Style.isVerilog()) { +const FormatToken *Prev = Tok->getPreviousNonComment(); +const FormatToken *PrevPrev; +// Identify the parameter list and port list in

[PATCH] D147328: [clang-format] Handle enum in Verilog

2023-03-31 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1712 break; - // This only applies for C++. - if (!Style.isCpp()) { + // This only applies for C++ and Verilog. + if (!Style.isCpp() &&

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-03-31 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/include/clang/Format/Format.h:949 + /// If unset, ``ContinuationIndentWidth`` is used. + /// \code + /// AlignAfterOpenBracket: AlwaysBreak HazardyKnusperkeks wrote: > jp4a50 wrote: > > MyDeveloperDay wrote: >

[PATCH] D147111: [clang-format] Add MinDigits suboptions to IntegerLiteralSeparator

2023-03-31 Thread Owen Pan via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG253985d58caf: [clang-format] Add MinDigits suboptions to IntegerLi

[PATCH] D147295: [clang-format] Don't misannotate left squares as lambda introducers

2023-03-31 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2a42a7b4e873: [clang-format] Don't misannotate left squares as lambda introducers (authored by owenpan). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D147295: [clang-format] Don't misannotate left squares as lambda introducers

2023-03-31 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D147295#4235648 , @rymiel wrote: > This is great! Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147295/new/ https://reviews.llvm.org/D147295 __

[PATCH] D121584: [clang-format] Correctly recognize arrays in template parameter list.

2023-03-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. See https://reviews.llvm.org/D147295. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121584/new/ https://reviews.llvm.org/D121584 ___ cfe-commits mailing list cfe-commits@lists.ll

[PATCH] D147295: [clang-format] Don't misannotate left squares as lambda introducers

2023-03-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, rymiel. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. owenpan requested review of this revision. A left square can start a lambda only if it's not preceded by an i

[PATCH] D147176: [clang-format] NFC ensure Style operator== remains sorted for ease of editing

2023-03-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D147176#4232702 , @MyDeveloperDay wrote: > I can auto add us as all as reviewers if you'd like? This means if the title > contains `[clang-format]` or it impacts a file path of /clang/lib/Format it > should in theory run th

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D146101#4233535 , @jp4a50 wrote: > Broadly speaking, these include aggregate initialization and list > initialization (possibly direct initialization with braces too). See the > initialization

[PATCH] D137327: [clang-format] Handle object instansiation in if-statements

2023-03-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137327#4233551 , @thieta wrote: > In D137327#4233290 , > @MyDeveloperDay wrote: > >> because of https://github.com/llvm/llvm-project/issues/61785 should this >> really be reverted?

[PATCH] D137327: [clang-format] Handle object instansiation in if-statements

2023-03-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137327#4234463 , @thieta wrote: > This was released in LLVM 16.0.0. I think we should revert it in 16.0.1. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137327/new/ https://re

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1665-1669 + const auto DesignatedInitializerIndentWidth = + Style.DesignatedInitializerIndentWidth < 0 + ? Style.ContinuationIndentWidth + : Style.Designat

[PATCH] D147111: [clang-format] Add MinDigits suboptions to IntegerLiteralSeparator

2023-03-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan requested review of this revision. owenpan marked an inline comment as done. owenpan added inline comments. Comment at: clang/include/clang/Format/Format.h:4299 InsertNewlineAtEOF == R.InsertNewlineAtEOF && IntegerLiteralSeparator.Binary == R.Integ

[PATCH] D147111: [clang-format] Add MinDigits suboptions to IntegerLiteralSeparator

2023-03-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 509511. owenpan added a comment. Adds `IntegerLiteralSeparatorStyle::operator==`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147111/new/ https://reviews.llvm.org/D147111 Files: clang/docs/ClangFormatStyleOptions.rst clang/include/clang/Forma

[PATCH] D147111: [clang-format] Add MinDigits suboptions to IntegerLiteralSeparator

2023-03-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, rymiel. owenpan added a project: clang-format. Herald added a project: All. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Closes https://g

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1665-1669 + const auto DesignatedInitializerIndentWidth = + Style.DesignatedInitializerIndentWidth < 0 + ? Style.ContinuationIndentWidth + : Style.Designat

[PATCH] D146844: [clang-format] Handle '_' in ud-suffix for IntegerLiteralSeparator

2023-03-28 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4d21868b0968: [clang-format] Handle '_' in ud-suffix for IntegerLiteralSeparator (authored by owenpan). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D146844: [clang-format] Handle '_' in ud-suffix for IntegerLiteralSeparator

2023-03-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D146844#4226558 , @MyDeveloperDay wrote: > I'm not going to use it, but I like what you've done ;-) Thanks! I won't use it either. :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146844/new/ https://reviews.llvm.o

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1665-1669 + const auto DesignatedInitializerIndentWidth = + Style.DesignatedInitializerIndentWidth < 0 + ? Style.ContinuationIndentWidth + : Style.Designat

[PATCH] D147003: [clang-format] JSON Add ability to add a space before the colon

2023-03-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:4155 if (Right.is(tok::colon)) - return false; + return Style.SpaceBeforeJsonColon; } else if (Style.isCSharp()) { MyDeveloperDay wrote: > owenpan wrote: > > Do we ne

[PATCH] D146844: [clang-format] Handle '_' in ud-suffix for IntegerLiteralSeparator

2023-03-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 508889. owenpan added a comment. Treats imaginary number suffixes (starting with an `i`) just like any user-defined suffixes (starting with an underscore). Also handles ud-suffixes (e.g. `_km` and `_Pa`) containing letters that can be part of a floating-poin

[PATCH] D147003: [clang-format] JSON Add ability to add a space before the colon

2023-03-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. You need to add `CHECK_PARSE_BOOL(SpaceBeforeJsonColon)` in ConfigParseTest.cpp. Comment at: clang/include/clang/Format/Format.h:3717 + /// If ``true``, a space will be add before a json colon + /// \code Commen

[PATCH] D146895: [clang-format] Don't annotate left brace of struct as FunctionLBrace

2023-03-27 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG767aee1de9e9: [clang-format] Don't annotate left brace of struct as FunctionLBrace (authored by owenpan). Repository: rG LLVM Github Monorepo CHA

[PATCH] D146895: [clang-format] Don't annotate left brace of struct as FunctionLBrace

2023-03-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 508464. owenpan added a comment. Handles consecutive attributes too. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146895/new/ https://reviews.llvm.org/D146895 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/Format/FormatTest.cp

[PATCH] D146501: [clang-format] Don't format already formatted integer literals

2023-03-26 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5b5c49ad4563: [clang-format] Don't format already formatted integer literals (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D146501: [clang-format] Don't format already formatted integer literals

2023-03-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. This patch is effectively NFC. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146501/new/ https://reviews.llvm.org/D146501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

<    1   2   3   4   5   6   7   8   9   10   >