[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 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] 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] 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] 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-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-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] 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] 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] 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] 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] 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-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] 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] 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] 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] 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] 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] 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-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-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] D141098: [clang-format][NFC] Set LineEnding to LF in config files

2023-02-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141098#4108286 , @sunho wrote: > I think buildbot is "formatting" the patch using clang-format-15. The tests > of clang-format would be done with latest code. Can we just fix the buildbot so that it runs git-clang-format wit

[PATCH] D143546: [clang-format] Insert a space between a numeric UDL and a dot

2023-02-07 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. Fixes https://gi

[PATCH] D141098: [clang-format][NFC] Set LineEnding to LF in config files

2023-02-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141098#4111830 , @sunho wrote: > Wouldn't that mean llvm contributors have to format their code using > clang-format built from top-of-tree source code before submitting the patch? Only if the patch is to clang-format source

[PATCH] D143546: [clang-format] Insert a space between a numeric UDL and a dot

2023-02-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D143546#4111827 , @rymiel wrote: > I've been sniped! (but only because i spent hours discussing with people if > the error is pedantically valid, which it turns out it is) I was wondering why you didn't assign yourself. :) Wh

[PATCH] D141098: [clang-format][NFC] Set LineEnding to LF in config files

2023-02-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141098#4111890 , @sunho wrote: > I think it makes more sense to use stable version of clang-format for that > purpose but I'm not in a postion to decide as I don't work with format. Can > you change the script to use latest

[PATCH] D143546: [clang-format] Insert a space between a numeric UDL and a dot

2023-02-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3884 if (Style.isCpp()) { +if (Right.is(tok::period) && Left.is(tok::numeric_constant)) + return true; HazardyKnusperkeks wrote: > Add a comment what that is? Without the b

[PATCH] D143546: [clang-format] Insert a space between a numeric UDL and a dot

2023-02-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D143546#4113730 , @rsmith wrote: > I wonder if this can be fixed more generally by using > `TokenConcatenation::AvoidConcat` to determine whether `clang-format` should > require a space between two tokens. Probabtly not as c

[PATCH] D143546: [clang-format] Insert a space between a numeric UDL and a dot

2023-02-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D143546#4113721 , @rymiel wrote: > In D143546#4112077 , @owenpan wrote: > >> As this one is an invalid-code-generation bug, I wanted it fixed ASAP. > > Do you intend to backport it to t

[PATCH] D143546: [clang-format] Insert a space between a numeric UDL and a dot

2023-02-09 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 rGb4e35c63711b: [clang-format] Insert a space between a numeric UDL and a dot (authored by owenpan). Changed prior to commit: https://reviews.llvm.o

[PATCH] D143546: [clang-format] Insert a space between a numeric UDL and a dot

2023-02-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked an inline comment as done. owenpan added a comment. In D143546#4116196 , @HazardyKnusperkeks wrote: > In D143546#4114341 , @owenpan wrote: > >> In D143546#4113721

[PATCH] D143546: [clang-format] Insert a space between a numeric UDL and a dot

2023-02-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked an inline comment as done. owenpan added a comment. In D143546#4116354 , @MyDeveloperDay wrote: > In D143546#4114341 , @owenpan wrote: > >> In D143546#4113721

[PATCH] D143755: [clang-format] Add a space between an overloaded operator and '>'

2023-02-10 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. The token annota

[PATCH] D143755: [clang-format] Add a space between an overloaded operator and '>'

2023-02-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 496670. owenpan added a comment. Added `tryMergeGreaterGreater()` to and fixed `tryMergerLessLess()` of `FormatTokenLexer`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143755/new/ https://reviews.llvm.org/D143755 Files: clang/lib/Format/Format

[PATCH] D143755: [clang-format] Add a space between an overloaded operator and '>'

2023-02-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D143755#4118802 , @vedgy wrote: > Hi @owenpan. Thank you for fixing this bug! > Have you noticed this paragraph in my bug report? > >> I believe `clang_getTypeSpelling()`, or more likely `QualType::print()` used >> by it, shou

[PATCH] D143831: [clang-format] Don't rewrite the input file if already formatted

2023-02-11 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. If `IntegerLiter

[PATCH] D143831: [clang-format] Don't rewrite the input file if already formatted

2023-02-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 rGb4243bb611a3: [clang-format] Don't rewrite the input file if already formatted (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D143755: [clang-format] Add a space between an overloaded operator and '>'

2023-02-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 rGb05dc1b8766a: [clang-format] Add a space between an overloaded operator and '>' (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D143825: [clang-format] Put ports on separate lines in Verilog module headers

2023-02-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2665 +if (Style.isVerilog() && Precedence == prec::Comma && +VerilogFirstOfType != nullptr) { + addFakeParenthesis(VerilogFirstOfType, prec::Comma); And other places a

[PATCH] D144317: [clang-format] Fix handling of TypeScript tuples with optional last member

2023-02-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added reviewers: krasimir, HazardyKnusperkeks, rymiel. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestJS.cpp:2826 +TEST_F(FormatTestJS, TupleTypeWithOptionalLastElement) { + verifyFormat("type T = [number?];"); +} Can you mov

[PATCH] D126365: [git-clang-format] Stop ignoring changes for files with space in path

2023-02-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan closed this revision. owenpan added a comment. Landed in c31bc7bdf810 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126365/new/ https://reviews.llvm.org/D126365 __

[PATCH] D144355: [clang-format][NFC] Clean up nullptr comparison style

2023-02-19 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. For example, use

[PATCH] D143825: [clang-format] Put ports on separate lines in Verilog module headers

2023-02-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2665 +if (Style.isVerilog() && Precedence == prec::Comma && +VerilogFirstOfType != nullptr) { + addFakeParenthesis(VerilogFirstOfType, prec::Comma); sstwcw wrote: > ow

[PATCH] D144296: [clang-format] Rewrite how indent is reduced for compacted namespaces

2023-02-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D144296#4136133 , @rymiel wrote: > Note: this patch also makes `LevelIndentTracker::skipLine` obsolete. I > suppose I could clean that up in a following patch I'd delete it in this patch. Comment at: clang

[PATCH] D144296: [clang-format] Rewrite how indent is reduced for compacted namespaces

2023-02-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D144296#4137508 , @HazardyKnusperkeks wrote: > And I see the style was bogus before, but shouldn't all variables start with > a capital letter? Please fix that in the code you touch. +1. Repository: rG LLVM Github Monore

[PATCH] D144317: [clang-format] Fix handling of TypeScript tuples with optional last member

2023-02-21 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 rG801bd3265362: [clalng-format] Fix handling of TypeScript tuples with optional last member (authored by taymonbeal, committed by owenpan). Repository

[PATCH] D144355: [clang-format][NFC] Clean up nullptr comparison style

2023-02-21 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 rG0ef289e5b24b: [clang-format][NFC] Clean up nullptr comparison style (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D144537: [clang-format] Don't move qualifiers past pointers-to-member

2023-02-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Format/QualifierAlignmentFixer.cpp:284-285 +// However, `const Bar::*` remains the same. +while (Next && Next->isOneOf(tok::identifier, t

[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] 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-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 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] 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-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] 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-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] 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-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] 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] 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] 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-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] 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] 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] 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] 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/include/clang/Format/Format.h:1220 +/// \endcode +bool AfterCSharpProperty; }; MyDeveloperDay wrote: > HazardyKnusperkeks wrote: > > MyDeveloperDay wrote: > > > HazardyKnusperkeks wrote: > > > > Please s

[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] 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-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] 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] 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] 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] 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 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-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] 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] 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-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-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 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] 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] 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] 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] 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] 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] 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] 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] D153109: [clang-format][NFC] Clean up unit tests

2023-06-16 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. This patch adds a `verifyNoChange` macro to verify code that won't

[PATCH] D153109: [clang-format][NFC] Clean up unit tests

2023-06-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 532192. owenpan added a comment. Cleaned up FormatTestJS.cpp as well. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153109/new/ https://reviews.llvm.org/D153109 Files: clang/unittests/Format/FormatTest.cpp clang/unittests/Format/FormatTestBase.

[PATCH] D125171: [clang-format] Add a new clang-format option AlwaysBreakBeforeFunctionParameters

2023-06-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @jrmolin is this option really for breaking before the first parameter? Or are you trying to have one parameter per line as shown by the examples in your GitHub issue? Also, how would it interact with `BAS_AlwaysBreak`, `BinPackParameters`, and `AllowAllParametersOfDecl

[PATCH] D153109: [clang-format][NFC] Clean up unit tests

2023-06-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Because FormatTestCSharp.cpp, FormatTestJS.cpp, and FormatTestSelective.cpp don't `#include` FormatTestBase.h, they can't benefit from `verifyNoChange`. However, the rest of the unit tests are all free of the repeated arguments in `EXPECT_EQ` and `verifyFormat` (as far

[PATCH] D153109: [clang-format][NFC] Clean up unit tests

2023-06-16 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG20b4df1ed611: [clang-format][NFC] Clean up unit tests (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153109/new/ https://reviews.llvm.

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

2023-06-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 rG441108ccba94: Reland [clang-format] Fix overlapping whitespace replacements before PPDirective (authored by owenpan). Changed prior to commit: htt

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

2023-06-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Rebased and changed a unit test to use `verifyNoChange` before landing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151954/new/ https://reviews.llvm.org/D151954 ___ cfe-commits

[PATCH] D153205: [clang-format] Add new block type ListInit

2023-06-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. It seems to me that there has been a proliferation of new options being proposed and/or accepted recently. I'd like to remind everyone of the long-standing policy of adding new o

[PATCH] D152975: [clang-format] Allow break after return keyword

2023-06-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. See D153205#4430528 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152975/new/ https://reviews.llvm.org/D152975 ___ cfe-commits mailing

[PATCH] D139257: [clang-format] Link the braces of a block in UnwrappedLineParser

2022-12-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 rGe33243c950ac: [clang-format] Link the braces of a block in UnwrappedLineParser (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D123450: [clang-format] Parse Verilog if statements

2022-12-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D123450#3465024 , @MyDeveloperDay wrote: > ``if (Keywords.isBlockBegin(*FormatTok, Style)) {`` > > I'm not a massive fan of handling l_brace and begin and end as the same > thing, I might be tempted to handle them separately,

[PATCH] D123450: [clang-format] Parse Verilog if statements

2022-12-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/FormatToken.h:1572 + bool isBlockBegin(const FormatToken &Tok, const FormatStyle &Style) const { +return Style.isVerilog() ? isVerilogBegin(Tok) : Tok.is(tok::l_brace); + } HazardyKnusperkeks wrote

<    6   7   8   9   10   11   12   13   >