[PATCH] D105099: [clang-format] Add an option to put one constructor initializer per line

2021-06-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D105099#2848317 , @curdeius wrote: > Formatting part and tests look good to me, but I'd rather see this patch > merge all related boolean options into one enum. > Just thinking out loud, but is it doable to merge > AllowAllCo

[PATCH] D105099: [clang-format] Add an option to put one constructor initializer per line

2021-06-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. >> Else: >> ... > > Is there anything else in the "Else:" part above? Is there an option that we > forgot? No, it's just what you called "one other enum value for the default case without special handling." > I'm not sure if I understand you correctly. Is your po

[PATCH] D69764: [clang-format] Add East/West Const fixer capability

2021-07-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Has this been tested against a large code base? It also needs an unqualified LGTM before it can be merged. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69764/new/ https://reviews.llvm.org/D69764 ___ cfe-commits mail

[PATCH] D105964: [clang-format] Make AlwaysBreakAfterReturnType work with K&R C function definitions

2021-07-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: djasper, klimek, MyDeveloperDay, curdeius, HazardyKnusperkeks. owenpan added a project: clang-format. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. See PR50999

[PATCH] D105964: [clang-format] Make AlwaysBreakAfterReturnType work with K&R C function definitions

2021-07-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 rG58494c856a15: [clang-format] Make BreakAfterReturnType work with K&R C functions (authored by owenpan). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D95168: [clang-format] Add InsertBraces option

2021-11-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D95168#3099739 , @MyDeveloperDay wrote: > - Look further into possible Removal (I have an idea for how this might be > possible, and super useful for LLVM where we don't like single if {} ), I'd > like to round out on this be

[PATCH] D95168: [clang-format] Add InsertBraces option

2021-11-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D95168#3100376 , @HazardyKnusperkeks wrote: > In D95168#3099920 , @owenpan wrote: > >> In D95168#3099739 , @MyDeveloperDay >> wrote: >> >>> - Lo

[PATCH] D95168: [clang-format] Add InsertBraces option

2021-11-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D95168#3100969 , @MyDeveloperDay wrote: > In D95168#3099920 , @owenpan wrote: > >> In D95168#3099739 , @MyDeveloperDay >> wrote: >> >>> - Look f

[PATCH] D95168: [clang-format] Add InsertBraces option

2021-11-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D95168#3102511 , @MyDeveloperDay wrote: > Then this is definitely why we want to think about these now and NOT leave > them to a separate review after the Insert case is committed. We can just leave a placeholder for the Remo

[PATCH] D95168: [clang-format] Add InsertBraces option

2021-11-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D95168#3102550 , @MyDeveloperDay wrote: > This is a demo of what I mean {https://reviews.llvm.org/D113000} you can see > its pretty aggressive, I could kind of imagine people wanting a little more > control > > Sometimes this

[PATCH] D95168: [clang-format] Add InsertBraces option

2021-11-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D95168#3105340 , @MyDeveloperDay wrote: >> I already had an implementation of RemoveBraces for the LLVM style (minus >> some exceptions). > > Why not share the implementation in a review then we can combine them here. I want

[PATCH] D91949: [clang-format] Add BeforeStructInitialization option in BraceWrapping configuration

2021-11-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D91949#2747412 , @krasimir wrote: > Do we have some widely used code style that requires the new option > (https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options)? I have the same question.

[PATCH] D113320: [clang-format] Address fixme

2021-11-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Looks okay. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3064-3068 + for (const auto &Node : Line.Tokens) { +for (const auto &ChildNode : Node.Children) + printDebugInfo(ChildNode, "\nChild: "); + } Nit: elide brace

[PATCH] D113369: [clang-format] Extend SpaceBeforeParens for requires

2021-11-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3145-3148 + else { +assert(Left.is(TT_RequiresExpression)); +return Style.SpaceBeforeParensOptions.AfterRequiresExpression; + } Nit: remove `else`. Reposito

[PATCH] D109557: Adds a BlockIndent option to AlignAfterOpenBracket

2021-11-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:951 + if (PreviousNonComment && PreviousNonComment->is(tok::l_paren)) { +State.Stack.back().BreakBeforeClosingParen = HazardyKnusperkeks wrote: > Remove the braces I think

[PATCH] D114073: [clang-format][NFC] Add a default value to parseBlock()

2021-11-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks. owenpan added a project: clang-format. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://review

[PATCH] D114073: [clang-format][NFC] Add a default value to parseBlock()

2021-11-17 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 rGe852cc0d5a8f: [clang-format][NFC] Add a default value to parseBlock() (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D114142: [clang-format] [PR52527] can join * with /* to form an outside of comment error C4138

2021-11-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3219 + // of comment. + if (Left.is(tok::star) && Right.is(TT_BlockComment)) +return true; Isn't `tok::comment` better than `TT_BlockComment` if a space is also required between

[PATCH] D114142: [clang-format] [PR52527] can join * with /* to form an outside of comment error C4138

2021-11-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3219 + // of comment. + if (Left.is(tok::star) && Right.is(TT_BlockComment)) +return true; MyDeveloperDay wrote: > owenpan wrote: > > Isn't `tok::comment` better than `TT_BlockCo

[PATCH] D114142: [clang-format] [PR52527] can join * with /* to form an outside of comment error C4138

2021-11-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D114142#3139756 , @MyDeveloperDay wrote: > I'm thinking that those cases are handled else where I was aware of that, but I didn't see `* //` was handled and tested explicitly. IMO, using `tok::comment` and adding a test case

[PATCH] D114151: [clang-format] [C++20] [Module] clang-format couldn't recognize partitions

2021-11-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3226 +// No space between module :. +if (Left.isOneOf(Keywords.kw_module, tok::kw_export, Keywords.kw_import) && +Right.is(TT_ModulePartitionColon)) You can remove `kw_

[PATCH] D114142: [clang-format] [PR52527] can join * with /* to form an outside of comment error C4138

2021-11-20 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. LGTM, though I'd like to see a test case for `* //`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114142/new/ https://reviews.llvm.org/D114142 ___ cfe-commits mailing list cfe-commits@

[PATCH] D114151: [clang-format] [C++20] [Module] clang-format couldn't recognize partitions

2021-11-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1055-1077 + while (FormatTok) { +if (FormatTok->is(tok::colon)) { + FormatTok->setType(TT_ModulePartitionColon); +} +// Handle import as we would an include statement +else

[PATCH] D114320: [clang-format] Extend AllowShortBlocksOnASingleLine for else blocks

2021-11-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. Should we add an if-else example to the documentation? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114320/new/ https://reviews.llvm.org/D114320

[PATCH] D114151: [clang-format] [C++20] [Module] clang-format couldn't recognize partitions

2021-11-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1057 + nextToken(); + do { +if (FormatTok->is(tok::colon)) { A `while (!eof())` or `while (FormatTok->isNot(tok::eof)` would be safer here just in case the last line is `i

[PATCH] D114430: [clang-format] NFC - recent changes caused clang-format to no longer be clang-formatted.

2021-11-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D114430#3152609 , @HazardyKnusperkeks wrote: > In D114430#3151082 , @klimek wrote: > >> Thanks for cleaning up after me, and sorry for the mess - do y'all have >> clang-format set up

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2021-12-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. How about naming `I[-1]` as well? And maybe `I[i + 1]` too? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060 ___ cfe-commits mailing lis

[PATCH] D115061: [clang-format][NFC] Prefer pass by reference

2021-12-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. This revision is now accepted and ready to land. In D115061#3170908 , @HazardyKnusperkeks wrote: > No I don't think there is a performance penalty. **I** just don't like using > pointers. I'm happ

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2021-12-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[PATCH] D115064: [clang-format][NFC] Replace deque with vector

2021-12-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D115064#3170615 , @curdeius wrote: > Maybe using `llvm::SmallVector` with some well-thought (data-based) static > number of elements would be better here, WDYT? I tend to agree as LLVM style

[PATCH] D114583: [clang-format] Adjust braced list detection

2021-12-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 rGc41b3b0fa0f4: [clang-format] Adjust braced list detection (authored by cpplearner, committed by owenpan). Repository: rG LLVM Github Monorepo CHA

[PATCH] D134853: [clang-format] Correctly annotate UDLs as OverloadedOperator

2022-10-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2126 return false; FormatToken *LeftOfParens = Tok.MatchingParen->getPreviousNonComment(); Perhaps add: ``` if (Tok.MatchingParen->is(TT_OverloadedOperatorLParen))

[PATCH] D134853: [clang-format] Correctly annotate UDLs as OverloadedOperator

2022-10-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134853/new/ https://reviews.llvm.org/D134853 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D129443: [clang-format] Add option for aligning requires clause body

2022-10-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D129443#3867364 , @rymiel wrote: > How should I proceed with a stale rejecting review? You can commit as https://reviews.llvm.org/D129443#3641571 has been addressed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D135972: [clang-format] Don't crash on malformed preprocessor conditions

2022-10-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1216 + // Don't crash when there is an #else without an #if. + if (PPBranchLevel <= -1) { +conditionalCompilationStart(/*Unreachable=*/true); Nit. Comment

[PATCH] D136437: [clang-format] Insert closing braces of unaffected lines

2022-10-21 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 closing brac

[PATCH] D136154: [clang-format] Fix the continuation indenter

2022-10-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D136154#3867328 , @MyDeveloperDay wrote: > Can we log a GitHub issue I can’t see what you are trying to fix @hel-ableton Can you log an issue for this and add a link to it in `SUMMARY`? In D136154#3867441

[PATCH] D136336: [clang-format] Mark pragma region lines as StringLiterals

2022-10-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Can you add a test to `TokenAnnotatorTest.cpp`? Comment at: clang/unittests/Format/FormatTest.cpp:19973-19974 + verifyFormat("#pragma region TEST(FOO: NOSPACE)", Style); + EXPECT_EQ("#pragma region TEST(FOO: NOSPACE)", +format("#pragma reg

[PATCH] D136437: [clang-format] Insert closing braces after an unaffected line

2022-10-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D136437#3874832 , @MyDeveloperDay wrote: > Does this need a unit test? or are we good? I will add the tests from https://github.com/llvm/llvm-project/issues/58161 in another patch after moving InsertBraces tests out of Forma

[PATCH] D136437: [clang-format] Insert closing braces after an unaffected line

2022-10-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan planned changes to this revision. owenpan added a comment. The assertions failed on the new examples in #58161. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D13643

[PATCH] D136437: [clang-format] Insert closing braces after an unaffected line

2022-10-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 469969. owenpan added a comment. This revision is now accepted and ready to land. Fixed assertion failures on the tests in https://github.com/llvm/llvm-project/issues/58161#issuecomment-1287904972. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D13643

[PATCH] D136437: [clang-format] Insert closing braces after an unaffected line

2022-10-24 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 rG37e754e5801c: [clang-format] Insert closing braces after an unaffected line (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D136658: [clang-format] Move InsertBraces unit tests out of FormatTest.cpp

2022-10-24 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. Also add line ra

[PATCH] D135918: [clang-format] Fix lambda formatting in conditional

2022-10-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:336 + Previous.MatchingParen && Previous.MatchingParen->Previous && + Previous.MatchingParen->Previous->is(tok::r_brace) && + Previous.MatchingParen

[PATCH] D136635: [clang-format] Don't misannotate in CTor init list

2022-10-24 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/unittests/Format/TokenAnnotatorTest.cpp:1077-1079 + EXPECT_TOKEN(Tokens[6], tok::identifier, TT_Unknown); + EXPECT_TOKEN(Tokens[7], tok::l_brace, TT

[PATCH] D135972: [clang-format] Don't crash on malformed preprocessor conditions

2022-10-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1217 + assert(PPBranchLevel >= -1); + if (PPBranchLevel <= -1) +conditionalCompilationStart(/*Unreachable=*/true); HazardyKnusperkeks wrote: > You assert >= -1, that means t

[PATCH] D136336: [clang-format] Mark pragma region lines as StringLiterals

2022-10-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Can you run git-clang-format? Comment at: clang/lib/Format/TokenAnnotator.cpp:1340 Keywords.kw_region)) { - bool IsMark = CurrentToken->is(Keywords.kw_mark); + bool IsMarkOrRegion = CurrentToken->isOneOf(Keywords

[PATCH] D136337: [clang-format] Discard pre-processor statements in parseBracedList()

2022-10-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Can you create an issue on GitHub and include the details on how to reproduce the problem using the latest clang-format? Comment at: clang/unittests/Format/FormatTest.cpp:19975-19978 + verifyFormat("CxxClass::CxxClass() {\n#pragma region test(hello)\n

[PATCH] D136336: [clang-format] Mark pragma region lines as StringLiterals

2022-10-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136336/new/ https://reviews.llvm.org/D136336 _

[PATCH] D135972: [clang-format] Don't crash on malformed preprocessor conditions

2022-10-25 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/unittests/Format/FormatTest.cpp:5209 + verifyNoCrash("#if X\n" +"#else\n" +"#else\n" `#elif Y` inste

[PATCH] D136658: [clang-format] Move InsertBraces unit tests out of FormatTest.cpp

2022-10-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D136658#3883372 , @rymiel wrote: > Is the intent here to somewhat reduce the 30k line behemoth of FormatTest.cpp? See https://reviews.llvm.org/D136437#3877250 for the motivation. In D136658#3883511

[PATCH] D136336: [clang-format] Mark pragma region lines as StringLiterals

2022-10-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1345 while (CurrentToken) { -if (IsMark || CurrentToken->Previous->is(TT_BinaryOperator)) +if (IsMarkOrRegion || CurrentToken->Previous->is(TT_BinaryOperator)) { Curre

[PATCH] D136154: [clang-format] Fix the continuation indenter

2022-10-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:803-808 - } else if ((Previous.isOneOf(TT_BinaryOperator, TT_ConditionalExpr, - TT_CtorInitializerColon)) && +} else if (Previous.is(TT_CtorInitializerColon)) {

[PATCH] D136658: [clang-format] Move InsertBraces unit tests out of FormatTest.cpp

2022-10-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 rG17059753f133: [clang-format] Move InsertBraces unit tests out of FormatTest.cpp (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D136830: [clang-format][NFC] Move BracesRemover tests out of FormatTest.cpp

2022-10-27 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. Repository: rG

[PATCH] D136154: [clang-format] Fix the continuation indenter

2022-10-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:803-804 CurrentState.LastSpace = State.Column; - } else if ((Previous.isOneOf(TT_BinaryOperator, TT_ConditionalExpr, - TT_CtorInitializerColon)) &&

[PATCH] D136154: [clang-format] Fix the continuation indenter

2022-10-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D136154#3882163 , @hel-ableton wrote: > I hope we can somewhat start from square 1 again with this. See https://reviews.llvm.org/D136154#3890747. It doesn't "fix" the last example in https://github.com/llvm/llvm-project/issu

[PATCH] D136830: [clang-format][NFC] Move BracesRemover tests out of FormatTest.cpp

2022-10-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 rG30ea3fcc4c69: [clang-format][NFC] Move BracesRemover tests out of FormatTest.cpp (authored by owenpan). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D137052: [clang-format] Don't skip #else/#elif of #if 0

2022-10-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: sstwcw, sammccall, HazardyKnusperkeks, MyDeveloperDay, 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-commit

[PATCH] D133647: [clang-format] Parse the else part of `#if 0`

2022-10-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. See D137052 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133647/new/ https://reviews.llvm.org/D133647 ___ cfe-commits mailing list cfe-commit

[PATCH] D137052: [clang-format] Don't skip #else/#elif of #if 0

2022-10-31 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 472204. owenpan added a comment. Tweaked the fix and added a test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137052/new/ https://reviews.llvm.org/D137052 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/Format/FormatTest.cpp

[PATCH] D137052: [clang-format] Don't skip #else/#elif of #if 0

2022-10-31 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137052#3895426 , @sstwcw wrote: > This patch fixes the regression caused by 2183fe2 > while > introducing a new regression. But in my opinion the new reg

[PATCH] D131750: [clang-format] Distinguish logical and after bracket from reference

2022-08-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2368-2376 +// Before token annotation, clang-format will split the declaration into +// multiple lines in the struct, union, class, and enum cases. For instance, +// `struct {int n} &&ptr=

[PATCH] D131750: [clang-format] Distinguish logical and after bracket from reference

2022-08-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:10477 Style); + verifyFormat("bool b = 3 == int{3} && true;"); owenpan wrote: > Can you add a similar test in TokenAnnotatorTest.cpp? Nvm. Repository: rG LLVM

[PATCH] D131750: [clang-format] Distinguish logical and after bracket from reference

2022-08-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. This revision is now accepted and ready to land. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131750/new/ https://reviews.llvm.org/D131750 ___ cfe-commits mailing list cfe-commits

[PATCH] D129628: [clang-format] Fix aligning of java-style declarations

2022-08-15 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 rGd8d331bc9710: [clang-format] Fix aligning of java-style declarations (authored by eoanermine, committed by owenpan). Repository: rG LLVM Github Mo

[PATCH] D131940: [clang-format] Handle comments between access specifier and colon

2022-08-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, curdeius, HazardyKnusperkeks. 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://

[PATCH] D132001: [clang-format] Fix regressions in WhitespaceSensitiveMacros

2022-08-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: curdeius, krasimir, HazardyKnusperkeks, MyDeveloperDay, ksyx. 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

[PATCH] D131940: [clang-format] Handle comments between access specifier and colon

2022-08-16 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2185f64771f0: [clang-format] Handle comments between access specifier and colon (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131940/n

[PATCH] D132008: [clang-format] Handle return type auto followed by l_paren

2022-08-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: HazardyKnusperkeks, MyDeveloperDay, curdeius. 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://

[PATCH] D132008: [clang-format] Handle return type auto followed by l_paren

2022-08-17 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG777b6ad168a0: [clang-format] Handle return type auto followed by l_paren (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132008/new/ ht

[PATCH] D132097: [clang-format] Fix BeforeHash indent of comments above PPDirective

2022-08-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: HazardyKnusperkeks, MyDeveloperDay, curdeius. 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://

[PATCH] D132097: [clang-format] Fix BeforeHash indent of comments above PPDirective

2022-08-21 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG41214456de9d: [clang-format] Fix BeforeHash indent of comments above PPDirective (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132097/

[PATCH] D132295: [clang-format] Change heuristic for locating lambda template arguments

2022-08-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:21634 + " }\n" + "};\n"); + verifyFormat("auto L = [](T...) {\n" There should be no terminating newline here.

[PATCH] D132001: [clang-format] Fix regressions in WhitespaceSensitiveMacros

2022-08-22 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2e36120726ee: [clang-format] Fix regressions in WhitespaceSensitiveMacros (authored by owenpan). Changed prior to commit: https://reviews.llvm.org/D132001?vs=453161&id=454685#toc Repository: rG LLVM

[PATCH] D132001: [clang-format] Fix regressions in WhitespaceSensitiveMacros

2022-08-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D132001#3741467 , @kuhar wrote: > This seems to have caused a test failure: > https://lab.llvm.org/buildbot/#/builders/109/builds/45138 > > Failed Tests (1): > Clang-Unit :: > Format/./FormatTests/TokenAnnotatorTest/Unde

[PATCH] D132719: [clang-format] Rework removeBraces() in Format.cpp

2022-08-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: HazardyKnusperkeks, MyDeveloperDay, curdeius. Herald added a project: All. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes https://github.com/llvm/llvm-project/issues/573

[PATCH] D132719: [clang-format] Rework removeBraces() in Format.cpp

2022-08-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/Format.cpp:1914 - assert(Token->isOneOf(tok::l_brace, tok::r_brace)); - assert(Token->Previous || Token == Line->First); - const FormatToken *Next = Token->Next; Deleted by mis

[PATCH] D133954: [clang-format] Fix template arguments in macros

2022-09-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:9793-9795 + verifyFormat("#define FOO(typeName, realClass) " + "\\\n" + " { #typeName, foo

[PATCH] D134103: [clang-format] Skip token annotation in passes that don't need it

2022-09-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, curdeius. 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. Repository:

[PATCH] D134103: [clang-format] Skip token annotation in passes that don't need it

2022-09-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/Format.cpp:3276 Passes.emplace_back([&](const Environment &Env) { -return BracesInserter(Env, Expanded).process(); +return BracesInserter(Env, Expanded).process(/*SkipsAnnotation=*/true); })

[PATCH] D134049: [clang-format] Disallow trailing return arrows to be operators

2022-09-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Would you like to get commit access? See https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134049/new/ https://reviews.llvm.org/D134049 _

[PATCH] D134103: [clang-format] Skip token annotation in passes that don't need it

2022-09-18 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG93fcc80d1ceb: [clang-format] Skip token annotation in passes that don't need it (authored by owenpan). Changed prior to commit: https://reviews.llvm.org/D134103?vs=460966&id=461086#toc Repository: rG

[PATCH] D134049: [clang-format] Disallow trailing return arrows to be operators

2022-09-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D134049#3798389 , @rymiel wrote: > In D134049#3798366 , @owenpan wrote: > >> Would you like to get commit access? See >> https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-acc

[PATCH] D134146: [clang-format] Update removed brace's next token's WhitespaceRange

2022-09-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, curdeius. 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://

[PATCH] D134146: [clang-format] Update removed brace's next token's WhitespaceRange

2022-09-19 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7349084e7afc: [clang-format] Update removed brace's next token's WhitespaceRange (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134146/

[PATCH] D134233: [clang-format] Wrap inserted braces only if preceded by comments

2022-09-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, curdeius. 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://

[PATCH] D134233: [clang-format] Wrap inserted braces only if preceded by comments

2022-09-20 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6257832bf94f: [clang-format] Wrap inserted braces only if preceded by comments (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134233/ne

[PATCH] D134329: [clang-format][NFC] Reformat clang/lib/Format using 6257832bf94f

2022-09-20 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, curdeius. 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. Fix braces and

[PATCH] D88299: [clang-format] Add MacroUnexpander.

2022-09-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added subscribers: MyDeveloperDay, owenpan. owenpan added a comment. @sstwcw thanks for pointing it out. See D134329 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88299/new/ https://reviews.llvm.org/D882

[PATCH] D134329: [clang-format][NFC] Reformat clang/lib/Format using 6257832bf94f

2022-09-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D134329#3805704 , @sstwcw wrote: > Did you leave out `clang/include/clang/Format` and `clang/unittests/Format`? I was going to take care of them after this patch. Thanks for asking though. Repository: rG LLVM Github Monore

[PATCH] D134325: [clang-format] Look ahead before consuming `bool` in requires clause.

2022-09-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3534 + nextToken(); + assert(FormatTok->is(tok::l_paren)); parseParens(); Redundant as it's asserted at the start of `parseParens()` below? Repository: rG LLV

[PATCH] D134329: [clang-format][NFC] Reformat clang/lib/Format using 6257832bf94f

2022-09-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 rG3d621398626a: [clang-format][NFC] Reformat clang/lib/Format using 6257832bf94f (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D88299: [clang-format] Add MacroUnexpander.

2022-09-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @klimek np! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88299/new/ https://reviews.llvm.org/D88299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D134329: [clang-format][NFC] Reformat clang/lib/Format using 6257832bf94f

2022-09-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D134329#3806667 , @owenpan wrote: > In D134329#3805704 , @sstwcw wrote: > >> Did you leave out `clang/include/clang/Format` and `clang/unittests/Format`? > > I was going to take care of

[PATCH] D131789: [clang-format][NFC] Rewrite prints in python3 compatible way

2022-09-25 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG015ce15ea27b: [clang-format][NFC] Rewrite prints in python3 compatible way (authored by eoanermine, committed by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D129926: [clang-format] Handle constructor invocations after new operator in C# correct

2022-09-25 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 rG258d7b86eeab: [clang-format] Handle constructor invocations after new operator in C# correct (authored by eoanermine, committed by owenpan). Changed

[PATCH] D134700: [clang-format] Fix a bug with C++ `export import `

2022-09-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, curdeius. 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://

[PATCH] D134329: [clang-format][NFC] Reformat clang/lib/Format using 6257832bf94f

2022-09-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D134329#3817601 , @MyDeveloperDay wrote: > Unfortunately this is causing the failing the "premerge checks" on reviews > likely because this machine is using an earlier version of clang-format Isn't this the case for any new

[PATCH] D134700: [clang-format] Fix a bug with C++ `export import `

2022-09-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 rG2d23175fae98: [clang-format] Fix a bug with C++ `export import ` (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINC

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