[PATCH] D126758: [clang-format] Handle do-while loops for RemoveBracesLLVM

2022-06-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.h:118-119 TokenType NextLBracesType = TT_Unknown, + bool *HasDoWhile = nullptr, bool *HasLabel = nullptr);

[PATCH] D126758: [clang-format] Handle do-while loops for RemoveBracesLLVM

2022-06-02 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 rGdb15e3121243: [clang-format] Handle do-while loops for RemoveBracesLLVM (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D126934: [clang-format] NFC Sort names of format token types

2022-06-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/FormatToken.h:39-45 + TYPE(CSharpGenericTypeConstraint) \ + TYPE(CSharpGenericTypeConstraintColon) \ + TYPE(CSharpGenericTypeConstrain

[PATCH] D126845: [clang-format] Handle Verilog numbers and operators

2022-06-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/FormatToken.h:138-139 TYPE(CSharpGenericTypeConstraintComma) \ + TYPE(VerilogNumberBase) /* for the base in a number literal, not including \ + th

[PATCH] D127005: [clang-format][NFC] Clean up the unwrapped line parser

2022-06-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: curdeius, HazardyKnusperkeks, MyDeveloperDay. 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. Change the int

[PATCH] D127054: [clang-format] Handle attributes for for/while loops

2022-06-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: curdeius, HazardyKnusperkeks, MyDeveloperDay. 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] D127005: [clang-format][NFC] Clean up the unwrapped line parser

2022-06-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 434287. owenpan edited the summary of this revision. owenpan added a comment. Restored the prototype of `parseStructuralElement()`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127005/new/ https://reviews.llvm.org/D127005 Files: clang/lib/Format

[PATCH] D127054: [clang-format] Handle attributes for for/while loops

2022-06-05 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfc1c160f7330: [clang-format] Handle attributes for for/while loops (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127054/new/ https://

[PATCH] D127005: [clang-format][NFC] Clean up the unwrapped line parser

2022-06-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 434366. owenpan edited the summary of this revision. owenpan added a comment. Restored the return type of `parseLevel()` and reordered the parameters of `parseStructuralElement()`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127005/new/ https://r

[PATCH] D127183: [clang-format] Skip parsing a block if it's nested too deep

2022-06-06 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. Don't parse bl

[PATCH] D127005: [clang-format][NFC] Clean up the unwrapped line parser

2022-06-07 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGec90bc0ea438: [clang-format][NFC] Clean up the unwrapped line parser (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127005/new/ https:

[PATCH] D127183: [clang-format] Skip parsing a block if it's nested too deep

2022-06-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 434761. owenpan edited the summary of this revision. owenpan added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127183/new/ https://reviews.llvm.org/D127183 Files: clang/lib/Format/UnwrappedLineParser.cpp Index: clang/lib/F

[PATCH] D127183: [clang-format] Skip parsing a block if it's nested too deep

2022-06-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 434773. owenpan added a comment. Inadvertently moved the added code down when rebasing. Fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127183/new/ https://reviews.llvm.org/D127183 Files: clang/lib/Format/UnwrappedLineParser.cpp Index: cla

[PATCH] D127183: [clang-format] Skip parsing a block if it's nested too deep

2022-06-07 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb5b33fbffb08: [clang-format] Skip parsing a block if it's nested too deep (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127183/new/ h

[PATCH] D127260: [clang-format] Remove braces of else blocks that embody an if block

2022-06-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: curdeius, MyDeveloperDay, 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] D127260: [clang-format] Remove braces of else blocks that embody an if block

2022-06-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25570-25575 + " else {\n" + "if (d) {\n" + " e;\n" + " f;\n" + "}\n" + " }\n"

[PATCH] D127260: [clang-format] Remove braces of else blocks that embody an if block

2022-06-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2620 + } else if (IfLBrace && !IfLBrace->Optional) { +KeepIfBraces = true; +markOptionalBraces(ElseLeftBrace); To be precise. It doesn't matter now but will w

[PATCH] D127260: [clang-format] Remove braces of else blocks that embody an if block

2022-06-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 435181. owenpan added a comment. Update `IfLeftBrace` in `parseLevel()` only if the level is a simple block. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127260/new/ https://reviews.llvm.org/D127260 Files: clang/lib/Format/UnwrappedLineParser.cp

[PATCH] D127260: [clang-format] Remove braces of else blocks that embody an if block

2022-06-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D127260#3567476 , @curdeius wrote: > Still looks good. Was there a particular case where the previous version > didn't work? The assertion I added on line 2626, which would ensure that the `RemoveBraces` lambda on line 898 d

[PATCH] D126157: [clang-format][NFC] Insert/remove braces in clang/lib/Format/

2022-06-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2769 - if (Style.isCSharp()) { do { owenpan wrote: > curdeius wrote: > > owenpan wrote: > > > From > > > https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-si

[PATCH] D127260: [clang-format] Remove braces of else blocks that embody an if block

2022-06-08 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5ead1f13a2d8: [clang-format] Remove braces of else blocks that embody an if block (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127260

[PATCH] D127366: [clang-format][NFC] Format lib/Format and unittests/Format in clang

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

[PATCH] D127366: [clang-format][NFC] Format lib/Format and unittests/Format in clang

2022-06-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 rG40a5d79a5cb4: [clang-format][NFC] Format lib/Format and unittests/Format in clang (authored by owenpan). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D127366: [clang-format][NFC] Format lib/Format and unittests/Format in clang

2022-06-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25442 "} while (hasMore() && Filter(*I));", - "do { ++I; } while (hasMore() && Filter(*I));", - Style); + "do { ++I; } while (hasMore() && Fi

[PATCH] D127390: [clang-format][NFC] Remove unused FormatStyle members

2022-06-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: curdeius, HazardyKnusperkeks, MyDeveloperDay. 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] D126934: [clang-format] NFC Sort names of format token types

2022-06-09 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/D126934/new/ https://reviews.llvm.org/D126934 _

[PATCH] D127390: [clang-format][NFC] Remove unused FormatStyle members

2022-06-09 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe9f2d47bfe29: [clang-format][NFC] Remove unused FormatStyle members (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127390/new/ https:/

[PATCH] D145262: [clang-format] Treat AttributeMacros more like attribute macros

2023-09-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. This looks OK to me. Please rebase after https://github.com/llvm/llvm-project/pull/67518 is merged. In D145262#4650300 , @jaredgrubb wrote: > Hopefully this will satisfy and we can merge! I didn't notice the Phabricator > time

[PATCH] D145262: [clang-format] Treat AttributeMacros more like attribute macros

2023-09-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D145262#4651483 , @owenpan wrote: > This looks OK to me. Please rebase after > https://github.com/llvm/llvm-project/pull/67518 is merged. I have merged the PR. Commits cef9f40cd4fe

[PATCH] D145262: [clang-format] Treat AttributeMacros more like attribute macros

2023-10-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1338-1341 PreviousNonComment->isOneOf( -TT_AttributeRParen, TT_AttributeSquare, TT_FunctionAnnotationRParen, -TT_JavaAnnotation, TT_LeadingJavaAnnotation))) || +

[PATCH] D145262: [clang-format] Treat AttributeMacros more like __attribute__

2023-10-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Can you add a github issue to show the behavior before this patch? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145262/new/ https://reviews.llvm.org/D145262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

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

2023-07-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestSelective.cpp:643-646 + Style.FixNamespaceComments = false; + Code = "namespace ns {\n" + "#define REF(alias) alias alias_var;\n" + "}"; // Format this line only Then I'

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

2023-07-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. LGTM except for D151047#4508359 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151047/new/ https://reviews.llvm.org/D151047 ___

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/include/clang/Format/Format.h:4214-4220 +/// Put a space in parentheses around the outside of attribute specifier +/// lists. +/// \code +///true: false: +///__attribute_

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/include/clang/Format/Format.h:4208-4213 +/// Put a space in parentheses inside attribute specifier lists. +/// \code +///true: false: +///__attribute__(( noreturn ))vs.

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

2023-07-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestSelective.cpp:643-646 + Style.FixNamespaceComments = false; + Code = "namespace ns {\n" + "#define REF(alias) alias alias_var;\n" + "}"; // Format this line only Sedenio

[PATCH] D155094: [clang-format] Refactoring and asserts in LevelIndentTracker. (NFC)

2023-07-18 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 rGe4aa1428a28d: [clang-format] Refactoring and asserts in LevelIndentTracker. (NFC) (authored by Sedeniono, committed by owenpan). Repository: rG LL

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

2023-07-18 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0570cc568f5c: [clang-format] Fix indent for selective formatting (authored by Sedeniono, committed by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D155273: [clang-format] Add TypeNames option to disambiguate types/objects

2023-07-18 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 rG5c106f7b947e: [clang-format] Add TypeNames option to disambiguate types/objects (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D138263: [clang-format] Supress aligning of trailing namespace comments

2023-07-21 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/UnwrappedLineParser.cpp:2976-2977 +FormatToken *LBrace = FormatTok; +LBrace->setFinalizedType(TT_NamespaceLBrace); +

[PATCH] D151761: clang-format: Add AlignConsecutiveShortCaseStatements

2023-07-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. FWIW, I think we can use a shorter name `AlignConsecutiveCaseStatements` instead of `AlignConsecutiveShortCaseStatements`. Comment at: clang/lib/Format/WhitespaceManager.cpp:854 + return C.Tok->is(TT_CaseLabelColon); +} else { + // Ignore

[PATCH] D156065: [clang-format] Insert namespace comments with leading spaces

2023-07-23 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. Insert missing `namespace` comments with `SpacesBeforeTrailingComme

[PATCH] D138263: [clang-format] Supress aligning of trailing namespace comments

2023-07-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestComments.cpp:3137 +"} // namespace C\n" +" }// TESTSUITE(B)\n" +"} // NaMeSpAcE A", owenp

[PATCH] D154550: [clang-format] Allow empty loops on a single line.

2023-07-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Like `while (a);`, `while (a) {}` is also an empty loop, so `NonEmpty` is misleading if it excludes the former but not the latter. IMO we should just fix the bug without extending the option because any loop with a single-statement body is a short loop. =

[PATCH] D156065: [clang-format] Insert namespace comments with leading spaces

2023-07-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 543415. owenpan added a comment. Fixed unit tests in NamespaceEndCommentsFixerTest.cpp. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156065/new/ https://reviews.llvm.org/D156065 Files: clang/lib/Format/NamespaceEndCommentsFixer.cpp clang/unitt

[PATCH] D156065: [clang-format] Insert namespace comments with leading spaces

2023-07-24 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2f6b2dafb783: [clang-format] Insert namespace comments with leading spaces (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156065/new/

[PATCH] D151761: clang-format: Add AlignConsecutiveShortCaseStatements

2023-07-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. In D151761#4528389 , @galenelias wrote: > In D151761#4524653 , @owenpan wrote: > >> FWIW, I think we can use a shorter name `AlignConsecutiveCaseStatements

[PATCH] D151761: clang-format: Add AlignConsecutiveShortCaseStatements

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

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/docs/ReleaseNotes.rst:830 +- Add ``SpacesInParens`` style with ``SpacesInParensOptions`` to replace + ``SpacesInConditionalStatement``, ``SpacesInCStyleCastParentheses``, + ``SpaceInEmptyParentheses``, and ``SpacesInParentheses`

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-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 rGc669541c969c: [clang-format] Add SpacesInParens with SpacesInParensOptions (authored by gedare, committed by owenpan). Changed prior to commit: ht

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

2023-07-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Herald added a subscriber: wangpc. This seems to cause a regression. See https://github.com/llvm/llvm-project/issues/64134. @galenelias any idea? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150403/new/ https://reviews.ll

[PATCH] D157244: [clang-format] Correctly count annoated lines in a namespace body

2023-08-10 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2b8542ce8e8c: [clang-format] Correctly count annoated lines of a namespace body (authored by owenpan). Changed prior to commit: https://reviews.llvm.org/D157244?vs=547612&id=549190#toc Repository: rG

[PATCH] D157568: [clang-format] Handle NamespaceMacro string arg for FixNamespaceComments

2023-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:177 llvm::Regex("^/[/*] *(end (of )?)? *(anonymous|unnamed)? *" - "([a-zA-Z0-9_]+)\\(([a-zA-Z0-9:_]*)\\)\\.? *(\\*/)?$", + "([a-zA-Z0-9_]+)\\(([a-zA-

[PATCH] D157963: [clang-format] Annotate constructor/destructor names

2023-08-15 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. Annotate constructor/destructor names as `FunctionDeclarationName`.

[PATCH] D157963: [clang-format] Annotate constructor/destructor names

2023-08-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3103 + if (!Next) +return Next; + if (Next->is(tok::comment)) HazardyKnusperkeks wrote: > Is a bit clearer. I moved this function up to here from below and only removed a couple

[PATCH] D157568: [clang-format] Handle NamespaceMacro string arg for FixNamespaceComments

2023-08-16 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG063c42e919c0: [clang-format] Handle NamespaceMacro string arg for FixNamespaceComments (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D158104: [clang-format][NFC] Simplify getFirstNonComment() in the annotator

2023-08-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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D15

[PATCH] D157963: [clang-format] Annotate constructor/destructor names

2023-08-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3103 + if (!Next) +return Next; + if (Next->is(tok::comment)) owenpan wrote: > HazardyKnusperkeks wrote: > > Is a bit clearer. > I moved this function up to here from below and o

[PATCH] D157963: [clang-format] Annotate constructor/destructor names

2023-08-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 551019. owenpan added a comment. Rebased to D158104 and simplified `getFunctionName` and `isCtorOrDtorName` a little. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157963/new/ https://reviews.llvm.org/D157963 Fil

[PATCH] D158155: [clang-format] Exclude kw_decltype in RemoveParentheses

2023-08-17 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. >From https://en.cppreference.com/w/cpp/language/decltype: Note tha

[PATCH] D158155: [clang-format] Exclude kw_decltype in RemoveParentheses

2023-08-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 rGe3a79503a30f: [clang-format] Exclude kw_decltype in RemoveParentheses (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D158293: [NFC][CLANG] Fix potential dereferencing of null return values

2023-08-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2009-2010 (Line.MightBeFunctionDecl || Line.InPPDirective) && - Current.NestingLevel == 0 && + Current.NestingLevel == 0 && Current.Previous &&

[PATCH] D158104: [clang-format][NFC] Simplify getFirstNonComment() in the annotator

2023-08-18 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG07181e289e3c: [clang-format][NFC] Simplify getFirstNonComment() in the annotator (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158104/

[PATCH] D158293: [NFC][CLANG] Fix potential dereferencing of null return values

2023-08-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2009-2010 (Line.MightBeFunctionDecl || Line.InPPDirective) && - Current.NestingLevel == 0 && + Current.NestingLevel == 0 && Current.Previous &&

[PATCH] D158571: [clang-format][NFC] Replace !is() with isNot()

2023-08-22 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D15

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D156259#4607177 , @jp4a50 wrote: > Addressed all comments. Please let me know if there's anything else required > before merging. There are still a couple of comments unaddressed plus another that asked for changing `!is()`

[PATCH] D158505: [clang-format] Fix weird handling of AfterColon

2023-08-23 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:7954 + verifyFormat( + "Class::Class(int some, int arguments, int loonoog,\n" + "

[PATCH] D158363: [clang-format] Fix segmentation fault when formatting nested namespaces

2023-08-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:389 auto *ClosingLine = AnnotatedLines.begin() + ClosingLineIndex + 1; auto OutdentBy = I[J]->Level - TheLine->Level; for (auto *CompactedLine = I + J; Compacte

[PATCH] D145262: [clang-format] Treat AttributeMacros more like __attribute__

2023-10-10 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/D145262/new/ https://reviews.llvm.org/D145262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[PATCH] D145262: [clang-format] Treat AttributeMacros more like __attribute__

2023-10-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @jaredgrubb please provide your authorship for `git commit --author` so that we can land the patch on your behalf. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145262/new/ https://reviews.llvm.org/D145262 ___ cfe-co

[PATCH] D145262: [clang-format] Treat AttributeMacros more like __attribute__

2023-10-15 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6f46bcc609f1: [clang-format] Treat AttributeMacro more like __attribute__ (authored by jaredgrubb, committed by owenpan). Changed prior to commit: https://reviews.llvm.org/D145262?vs=557674&id=557707#to

[PATCH] D138263: [clang-format] Supress aligning of trailing namespace comments

2023-07-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2964-2965 if (FormatTok->is(tok::l_brace)) { +FormatToken *LBrace = FormatTok; +LBrace->setFinalizedType(TT_NamespaceLBrace); + Nit. C

[PATCH] D154093: [clang-format] Break long strings in Verilog

2023-07-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:2152-2154 // FIXME: String literal breaking is currently disabled for C#, Java, Json // and JavaScript, as it requires strings to be merged using "+" which we // don't support. ---

[PATCH] D154093: [clang-format] Break long strings in Verilog

2023-07-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D154093#4542339 , @sstwcw wrote: > @owenpan What do you think about this revision especially the replacement > part? See D154093#4544495 . Then we can extend it by using `,` instead

[PATCH] D156643: [clang-format][NFC] Remove superfluous code in UnwrappedLineParser

2023-07-30 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D15

[PATCH] D156655: [clang-format] Handle goto labels preceded by C++11 attributes

2023-07-31 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/64229. Reposito

[PATCH] D156643: [clang-format][NFC] Remove superfluous code in UnwrappedLineParser

2023-08-01 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGadece4e452e8: [clang-format][NFC] Remove superfluous code in UnwrappedLineParser (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156643/

[PATCH] D156705: [clang-format] Fix braced initializer formatting with templated base class initializer

2023-08-01 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG400da115c58a: [clang-format] Fix braced initializer with templated base class (authored by galenelias, committed by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D156655: [clang-format] Handle goto labels preceded by C++11 attributes

2023-08-02 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG70d7ea0cebcf: [clang-format] Handle goto labels preceded by C++11 attributes (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156655/new/

[PATCH] D156971: [clang-format] Handle "// clang-format on" for SeparateDefinitionBlocks

2023-08-03 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/63393. Reposito

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/docs/ReleaseNotes.rst:167-168 +- Fix a bug that erroneously placed function arguments on a new line despite +all arguments being able to fit on the same line. Please delete it. We only update the re

[PATCH] D154550: [clang-format] Allow empty loops on a single line.

2023-08-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D154550#4529346 , @gedare wrote: > In D154550#4526386 , @owenpan wrote: > >> Like `while (a);`, `while (a) {}` is also an empty loop, so `NonEmpty` is >> misleading if it excludes the

[PATCH] D157179: [clang-format] Currectly handle PCIS_CurrentLine with no column limit

2023-08-05 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/63519. Reposito

[PATCH] D156971: [clang-format] Handle "// clang-format on" for SeparateDefinitionBlocks

2023-08-05 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG58a71c66db85: [clang-format] Handle "// clang-format on" for SeparateDefinitionBlocks (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D15

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

2023-08-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. @klimek can you have a look at https://github.com/llvm/llvm-project/issues/64275? Comment at: clang/lib/Format/MacroCallReconstructor.cpp:223 + } + assert(!ActiveExpansions.

[PATCH] D157179: [clang-format] Currectly handle PCIS_CurrentLine with no column limit

2023-08-06 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa0b1c235afab: [clang-format] Currectly handle PCIS_CurrentLine with no column limit (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1571

[PATCH] D157244: [clang-format] Correctly count annoated lines in a namespace body

2023-08-06 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/63882. Reposito

[PATCH] D157244: [clang-format] Correctly count annoated lines in a namespace body

2023-08-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.h:95 + size_t size() const { +int Size = 1; +for (const auto *Child : Children) Will fix it before landing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D157568: [clang-format] Handle NamespaceMacro string arg for FixNamespaceComments

2023-08-09 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/63795. Reposito

[PATCH] D157568: [clang-format] Handle NamespaceMacro string arg for FixNamespaceComments

2023-08-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 548878. owenpan added a comment. Rebased and updated test cases. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157568/new/ https://reviews.llvm.org/D157568 Files: clang/lib/Format/NamespaceEndCommentsFixer.cpp clang/unittests/Format/NamespaceEn

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-09-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:22575 +#if 0 + // FIXME: As long as all the non-lambda arguments fit on a single line, AlwaysBreak + // doesn't force an initial line break, even if lambdas span multiple lines. T

[PATCH] D148131: [clang-format] Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-09-08 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 rG210e7b3ca773: [clang-format] Improve line-breaking in LambdaBodyIndentation: OuterScope (authored by jp4a50, committed by owenpan). Changed prior to

[PATCH] D144170: [clang-format] Add simple macro replacements in formatting.

2023-09-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. It seems that this patch caused a regression. See https://github.com/llvm/llvm-project/issues/62768. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment Your review conta

[PATCH] D127270: [clang-format] Add space in placement new expression

2023-09-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Herald added a reviewer: rymiel. Comment at: clang/include/clang/Format/Format.h:3555 AfterFunctionDefinitionName(false), AfterIfMacros(false), - AfterOverloadedOperator(false), AfterRequiresInClause(false), - AfterRequi

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

2023-09-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Herald added a reviewer: MyDeveloperDay. @hel-ableton do you intend to continue working on this? If not, we can commandeer it and finish or abandon it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136154/new/ https://reviews.llvm.org/D136154 _

[PATCH] D154184: [clang-format] Correctly annotate */&/&& in operator function calls

2023-06-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 536501. owenpan added a comment. Don't fix the token type of */&/&& if the line is a function declaration. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154184/new/ https://reviews.llvm.org/D154184 Files: clang/lib/Format/TokenAnnotator.cpp cla

[PATCH] D154184: [clang-format] Correctly annotate */&/&& in operator function calls

2023-06-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3320 + // Annotate */&/&& in `operator` function calls as binary operators. + for (const auto *Tok = Line.First; Tok; Tok = Tok->Next) { rymiel wrote: > I assume this extra fixup s

[PATCH] D154184: [clang-format] Correctly annotate */&/&& in operator function calls

2023-07-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 536566. owenpan added a comment. Re-annotate */&/&& only if `isCpp()` is true. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154184/new/ https://reviews.llvm.org/D154184 Files: clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format/FormatTe

[PATCH] D154184: [clang-format] Correctly annotate */&/&& in operator function calls

2023-07-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 rG3f3620e5c9ee: [clang-format] Correctly annotate */&/&& in operator function calls (authored by owenpan). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D154484: [clang-format] Add an option to remove redundant parentheses

2023-07-05 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D15

<    3   4   5   6   7   8   9   10   11   12   >