[PATCH] D129742: [clang-format] Fix invalid-code-generation by RemoveBracesLLVM

2022-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 rG6ab7307177c3: [clang-format] Fix invalid-code-generation by RemoveBracesLLVM (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D129771: [clang-format] distinguish multiplication after brace-init from pointer

2022-07-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2328 +if (PrevToken->is(tok::r_brace) && Tok.is(tok::star) && +PrevToken->MatchingParen == nullptr) return TT_PointerOrReference;

[PATCH] D129466: [clang-format][NFC] Replace most of std::vector with SmallVector

2022-07-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:40 static unsigned getLengthToMatchingParen(const FormatToken &Tok, - const std::vector &Stack) { + const SmallVe

[PATCH] D129466: [clang-format][NFC] Replace most of std::vector with SmallVector

2022-07-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:40 static unsigned getLengthToMatchingParen(const FormatToken &Tok, - const std::vector &Stack) { + const SmallVe

[PATCH] D129921: [clang-format] Never remove braces in macro definitions

2022-07-15 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] D129311: [clang-format] Update return code

2022-07-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/tools/clang-format/git-clang-format:539 # filter. - subprocess.check_call(['git', 'diff', '--diff-filter=M', old_tree, new_tree, - '--']) + return subprocess.call(['git', 'diff', '--diff-filter=M', +

[PATCH] D129921: [clang-format] Never remove braces in macro definitions

2022-07-16 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa0458d92e9e7: [clang-format] Never remove braces in macro definitions (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129921/new/ https

[PATCH] D129940: [clang-format] Fix misannotation of colon in presence of requires clause

2022-07-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:820-833 + ASSERT_EQ(BaseTokens.size(), NumberOfBaseTokens) << BaseTokens; + ASSERT_EQ(ConstrainedTokens.size(), +NumberOfBaseTokens + NumberOfAdditionalRequiresClauseTokens) +

[PATCH] D129946: [clang-format] Mark constexpr lambdas as lambda

2022-07-16 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:2130 case tok::kw_noexcept: +case tok::kw_constexpr: nextToken(); Maybe move it up

[PATCH] D129940: [clang-format] Fix misannotation of colon in presence of requires clause

2022-07-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:820-833 + ASSERT_EQ(BaseTokens.size(), NumberOfBaseTokens) << BaseTokens; + ASSERT_EQ(ConstrainedTokens.size(), +NumberOfBaseTokens + NumberOfAdd

[PATCH] D129982: [clang-format][NFC] Refactor RequiresDoesNotChangeParsingOfTheRest

2022-07-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: HazardyKnusperkeks, curdeius, 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] D129940: [clang-format] Fix misannotation of colon in presence of requires clause

2022-07-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:820-833 + ASSERT_EQ(BaseTokens.size(), NumberOfBaseTokens) << BaseTokens; + ASSERT_EQ(ConstrainedTokens.size(), +NumberOfBaseTokens + NumberOfAdditionalRequiresClauseTokens) +

[PATCH] D129311: [clang-format] Update return code

2022-07-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Please mark as done if you have addressed an inline comment. Comment at: clang/tools/clang-format/git-clang-format:539-540 # filter. - subprocess.check_call(['git', 'diff', '--diff-filter=M', old_tree, new_tree, - '--']) + r

[PATCH] D129982: [clang-format][NFC] Refactor RequiresDoesNotChangeParsingOfTheRest

2022-07-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 445725. owenpan added a comment. Uploaded the correct diff. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129982/new/ https://reviews.llvm.org/D129982 Files: clang/unittests/Format/TokenAnnotatorTest.cpp Index: clang/unittests/Format/TokenAnnota

[PATCH] D129311: [clang-format] Update return code

2022-07-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/tools/clang-format/git-clang-format:579 with temporary_index_file(old_tree): - subprocess.check_call(['git', 'checkout', '--patch', new_tree]) + subprocess.run(['git', 'checkout', '--patch', new_tree], check=True)

[PATCH] D130136: [clang-format] Indent tokens after hash only if it starts a line

2022-07-19 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] D130136: [clang-format] Indent tokens after hash only if it starts a line

2022-07-20 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG892a9968ec77: [clang-format] Indent tokens after hash only if it starts a line (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130136/ne

[PATCH] D129982: [clang-format][NFC] Refactor RequiresDoesNotChangeParsingOfTheRest

2022-07-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 rGa4c62f66545d: [clang-format][NFC] Refactor RequiresDoesNotChangeParsingOfTheRest (authored by owenpan). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D130411: [clang-format] Fix a hang when formatting C# $@ string literals

2022-07-22 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] D130299: [clang-format] FIX: Misannotation 'auto' as trailing return type in lambdas

2022-07-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:752 +TEST_F(TokenAnnotatorTest, UnderstandsTrailingReturnTypeAutoInLabmdas) { + auto Tokens = annotate("[]() -> auto {}"); HazardyKnusperke

[PATCH] D130417: [clang-format] Missing space between trailing return type 'auto' and left brace

2022-07-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:23555-23556 + FormatStyle Style = getLLVMStyle(); + verifyFormat("[]() -> auto { return Val; }", Style); + verifyFormat("auto foo() -> auto { return Val; }", Style)

[PATCH] D129311: [clang-format] Update return code

2022-07-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/tools/clang-format/git-clang-format:201 if opts.diff: -print_diff(old_tree, new_tree) - elif opts.diffstat: -print_diffstat(old_tree, new_tree) - else: -changed_files = apply_changes(old_tree, new_tree, force=opts.

[PATCH] D130411: [clang-format] Fix a hang when formatting C# $@ string literals

2022-07-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/FormatTokenLexer.cpp:536 + // $"{x ?? "null"}" + // should not be split into $"{x ?? ", null, "}" but should treated as a + // single string-literal. curdeius wrote: > I left the original comments al

[PATCH] D125085: [clang-format] Correctly handle SpaceBeforeParens for builtins.

2022-05-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/D125085/new/ https://reviews.llvm.org/D125085 _

[PATCH] D125137: [clang-format] Don't remove braces if a 1-statement body would wrap

2022-05-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 428468. owenpan added a comment. Added saving/restoring the children of `UnwrappedLineNode` and addressed review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125137/new/ https://reviews.llvm.org/D125137 Files: clang/lib/Format/Unwrapp

[PATCH] D125137: [clang-format] Don't remove braces if a 1-statement body would wrap

2022-05-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:766 + assert(!Tokens.empty()); + const auto *LastToken = Tokens.back().Tok; + assert(LastToken); curdeius wrote: > It might be a matter of taste but adding this variable makes

[PATCH] D125451: [clang-format] Handle comments below r_brace in RemoveBracesLLVM

2022-05-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: curdeius, HazardyKnusperkeks, MyDeveloperDay. Herald added a project: All. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. If a closing brace is followed by a non-trailing comm

[PATCH] D125137: [clang-format] Don't remove braces if a 1-statement body would wrap

2022-05-12 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 rGb6d8c84f2810: [clang-format] Don't remove braces if a 1-statement body would wrap (authored by owenpan). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D125451: [clang-format] Handle comments below r_brace in RemoveBracesLLVM

2022-05-12 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 rG6cd9633c1da5: [clang-format] Handle comments below r_brace in RemoveBracesLLVM (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D125510: [clang-format][NFC] Format unit tests with insert/remove braces

2022-05-12 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. This patch is

[PATCH] D125528: [clang-format] Fix PointerAlignment: Right not working with tab indentation.

2022-05-13 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:14222 + TabAlignment.UseTab = FormatStyle::UT_ForIndentation; + TabAlignment.AlignConsecutiveDeclarations.Enabled =

[PATCH] D125510: [clang-format][NFC] Format unit tests with insert/remove braces

2022-05-13 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2601355dc982: [clang-format][NFC] Format unit tests with insert/remove braces (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125510/new

[PATCH] D125593: [clang-format] Handle "if consteval { ... }" for RemoveBracesLLVM

2022-05-13 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] D125593: [clang-format] Handle "if consteval { ... }" for RemoveBracesLLVM

2022-05-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 429406. owenpan added a comment. Fixed a bug and added a test case. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125593/new/ https://reviews.llvm.org/D125593 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/Format/FormatTest.cpp

[PATCH] D125593: [clang-format] Handle "if consteval { ... }" for RemoveBracesLLVM

2022-05-15 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2cdabc032292: [clang-format] Handle "if consteval { ... }" for RemoveBracesLLVM (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125593/n

[PATCH] D125626: [clang-format][NFC] Don't call mightFitOnOneLine() unnecessarily

2022-05-15 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. Clean up `Unwr

[PATCH] D125626: [clang-format][NFC] Don't call mightFitOnOneLine() unnecessarily

2022-05-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 429560. owenpan added a reviewer: sstwcw. owenpan removed a subscriber: sstwcw. owenpan added a comment. Fixes typos and makes `KeepElseBraces` depend on `KeepIfBraces`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125626/new/ https://reviews.llvm.

[PATCH] D125626: [clang-format][NFC] Don't call mightFitOnOneLine() unnecessarily

2022-05-16 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9dffab9d524a: [clang-format][NFC] Don't call mightFitOnOneLine() unnecessarily (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125626/ne

[PATCH] D125959: [clang-format] Fix a bug in "AfterControlStatement: MultiLine"

2022-05-19 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] D126052: [clang-format] Handle "complex" conditionals in RemoveBracesLLVM

2022-05-20 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. Do not remove

[PATCH] D126052: [clang-format] Handle "complex" conditionals in RemoveBracesLLVM

2022-05-20 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 431100. owenpan added a comment. Changed an unnecessary condition to an assertion. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126052/new/ https://reviews.llvm.org/D126052 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/lib/Format/Unwra

[PATCH] D125959: [clang-format] Fix a bug in "AfterControlStatement: MultiLine"

2022-05-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:3213 Style.BraceWrapping.AfterFunction = true; - Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_MultiLine; Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All; --

[PATCH] D126052: [clang-format] Handle "complex" conditionals in RemoveBracesLLVM

2022-05-21 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1443dbaba6f0: [clang-format] Handle "complex" conditionals in RemoveBracesLLVM (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126052/ne

[PATCH] D125959: [clang-format] Fix a bug in "AfterControlStatement: MultiLine"

2022-05-21 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf4d52cad6713: [clang-format] Fix a bug in "AfterControlStatement: MultiLine" (authored by owenpan). Changed prior to commit: https://reviews.llvm.org/D125959?vs=430622&id=431182#toc Repository: rG LL

[PATCH] D126132: [clang-format] Fix a crash on lambda trailing return type

2022-05-21 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] D126132: [clang-format] Fix a crash on lambda trailing return type

2022-05-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D126132#3530076 , @curdeius wrote: > LGTM. It seems it has landed already. Yeah. I pushed it by mistake. :( Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126132/new/ https://re

[PATCH] D126132: [clang-format] Fix a crash on lambda trailing return type

2022-05-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D126132#3531643 , @MyDeveloperDay wrote: > LGTM (sorry I've been slow on the reviews, my day job keeps getting in the > way ;-)) Np! It's really that @curdeius and @HazardyKnusperkeks are fast. :) Commen

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

2022-05-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2769 - if (Style.isCSharp()) { do { From https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements, it's u

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

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

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

2022-05-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D126157#3531635 , @MyDeveloperDay wrote: > LGTM too.. @owenpan this is one of my favourite features!! I love it too! :D Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126157/new

[PATCH] D126132: [clang-format] Fix a crash on lambda trailing return type

2022-05-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @HazardyKnusperkeks I think you know this better than any of us as you added the assertion to `setType()`. Does this look ok to you? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126132/new/ https://reviews.llvm.org/D12613

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

2023-10-20 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7c15dd60ec45: [clang-format] Add space in placement new expression (authored by omarahmed, committed by owenpan). Changed prior to commit: https://reviews.llvm.org/D127270?vs=445172&id=557807#toc Repos

[PATCH] D156370: [clang-format] Fix bug with parsing of function/variable names.

2023-10-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D156370#4540257 , @HazardyKnusperkeks wrote: > Yes that stuff. Tests are in: > https://github.com/llvm/llvm-project/blob/main/clang/unittests/Format/TokenAnnotatorTest.cpp > If there is none that matches, just create a new on

[PATCH] D150083: [clang-format] ObjCPropertyAttributeOrder to sort ObjC property attributes

2023-10-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @jaredgrubb, a few quick comments: - Please undo the (unrelated) changes to `clang-formatted-files.txt`. - Add a warning to the option in `Format.h`. See here for an example. - Rerun `dump_format_st

[PATCH] D110252: Added note about Whatstyle and Unformat

2023-10-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan commandeered this revision. owenpan edited reviewers, added: Volker-Weissmann; removed: owenpan. Herald added a project: All. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment Your review contains a change to ClangFormatStyleOptions.rst but not a change to clang/in

[PATCH] D33944: git-clang-format: Add --cached option to format index

2023-10-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan commandeered this revision. owenpan edited reviewers, added: kevinoid; removed: owenpan. owenpan added a comment. Herald added a project: All. We have `--cached` now. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment It looks like your clang-format review does no

[PATCH] D139834: [clang-format] AllowShortCompoundRequirementOnASingleLine

2023-10-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 rG69209e30a716: [clang-format] AllowShortCompoundRequirementOnASingleLine (authored by Backl1ght, committed by owenpan). Changed prior to commit: h

[PATCH] D123676: [clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline.

2023-10-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan closed this revision. owenpan added a comment. Herald added a subscriber: wangpc. Herald added a project: clang-format. Herald added a reviewer: rymiel. Fixed in D132001 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D61663: [clang-format] Fix a JavaScript import order bug.

2023-10-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan commandeered this revision. owenpan edited reviewers, added: bowenni; removed: owenpan. owenpan added a comment. The test case doesn't pass. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61663/new/ https://reviews.llvm.org/D61663

[PATCH] D61663: [clang-format] Fix a JavaScript import order bug.

2023-10-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 557879. owenpan added a comment. Make the test case pass. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61663/new/ https://reviews.llvm.org/D61663 Files: clang/lib/Format/SortJavaScriptImports.cpp clang/unittests/Format/SortImportsTestJS.cpp

[PATCH] D61663: [clang-format] Fix a JavaScript import order bug.

2023-10-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 rG265ed6819409: [clang-format] Fix a JavaScript import order bug (authored by owenpan). Changed prior to commit: https://reviews.llvm.org/D61663?vs=

[PATCH] D50403: [clang-format]AlignConsecutiveAssignments

2023-10-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan abandoned this revision. owenpan added a comment. We habe `AlignCompound` now. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment Your review contains a change to clang/include/clang/Format/Format.h but does not contain an update to ClangFormatStyleOptions.rst C

[PATCH] D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren

2019-08-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2618 +// using (FileStream fs... +if (Style.isCSharp() && Left.is(tok::kw_using) && Right.is(tok::l_paren)) + return true; `if (Style.isCSharp() && Left.is(tok::kw_using))

[PATCH] D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren

2019-08-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:169 +TEST_F(FormatTestCSharp, CSharpUsing) { + verifyFormat("using (StreamWriter sw = new StreamWriter(filename) { }"); +} owenpan wrote: > Maybe set `SpaceBeforeParens` to `A

[PATCH] D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren

2019-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:169 +TEST_F(FormatTestCSharp, CSharpUsing) { + verifyFormat("using (StreamWriter sw = new StreamWriter(filename) { }"); +} owenpan wrote: > owenpan wrote: > > Maybe set `Space

[PATCH] D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren

2019-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. The test case fails after the missing `)` is added, so it seems that the patch has no effect. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D2/new/ https://reviews.llvm.org/D2 ___ cfe

[PATCH] D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren

2019-08-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. The patch would have no effect if the `using` statement is not in a block, but that would probably be against C# syntax. Please see my comments about the test cases. Otherwise, LGTM. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:168 +TEST_

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

2021-10-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D95168#3038531 , @MyDeveloperDay wrote: > @tiagoma are you still interested in pursuing this? I have some suggestions > > 1. I'd like to move the BraceInserter Into its own .cpp and .h files (like I > did with the QualifierAli

[PATCH] D110833: [clang-format] Add ControlStatementsAndFunctionDefinitionsExceptControlMacros option to SpaceBeforeParens

2021-10-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:3649 ``SBPO_ControlStatementsExceptForEachMacros`` remains an alias for backward compatibility. HazardyKnusperkeks wrote: > crayroud wrote: > > MyDeveloperDay wrote: > >

[PATCH] D104774: [clang-format] Fix a bug that indents else-comment-if incorrectly

2021-06-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: djasper, klimek, MyDeveloperDay. owenpan added a project: clang-format. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. If there is a comment between "else" and "if", the "if"

[PATCH] D104774: [clang-format] Fix a bug that indents else-comment-if incorrectly

2021-06-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104774/new/ https://reviews.llvm.org/D104774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[PATCH] D107267: [clang-format] don't break between function and function name in JS

2021-08-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107267/new/ https://reviews.llvm.org/D107267 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D107269: [clan-format] detect function definitions more conservatively

2021-08-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2485-2486 if (Next->Next && Next->Next->is(tok::identifier) && - !(Next->MatchingParen->Next && Next->MatchingParen->Next->is(tok::semi))) + (!Next->MatchingParen->Next || + Next->Ma

[PATCH] D107269: [clan-format] detect function definitions more conservatively

2021-08-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. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107269/new/ https://reviews.llvm.org/D107269 _

[PATCH] D107907: [clang-format] handle trailing comments in function definition detection

2021-08-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I thought of it last time but didn't try hard to come up with a test case that would make a difference. :( Thanks for finding the hole! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107907/new/ https://reviews.llvm.org/D10

[PATCH] D107907: [clang-format] handle trailing comments in function definition detection

2021-08-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2484-2490 + if (Next->Next && Next->Next->is(tok::identifier)) { +const FormatToken *Last = Line.Last; +if (Last && Last->is(tok::comment)) + Last = Last->getPreviousNonComment(); +if

[PATCH] D107950: [clang-format] improve distinction of K&R function definitions vs attributes

2021-08-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D107950#2941015 , @MyDeveloperDay wrote: > I personally think tok::identifier tends to be just too general However, you can't avoid it as it's used for user-defined types: typedef unsigned char byte; byte *f(a) byte

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: krasimir, MyDeveloperDay. owenpan added a project: clang-format. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This is a follow-up on https://reviews.llvm.org/D107950 which m

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:17 #include "FormatToken.h" -#include "clang/Basic/TokenKinds.h" #include "llvm/ADT/STLExtras.h" HazardyKnusperkeks wrote: > Why is this not needed anymore? It was added in [[ h

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 366176. owenpan added a comment. Added keywords `register`, `struct`, and `union` back. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107961/new/ https://reviews.llvm.org/D107961 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/F

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D107961#2943223 , @MyDeveloperDay wrote: > Did the original change make it into the 13 branch? What's //the 13 branch//? > I'm seeing some unexpected behavior. > > bool foo(int a, Bar) override; > bool foo(int a, Bar) ov

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D107961#2943225 , @MyDeveloperDay wrote: > Logged as https://bugs.llvm.org/show_bug.cgi?id=51470 @krasimir fix resolves > this. > > I've marked this bug as a 13.0 release blocker ((@tstellar), we can take > @krasimir fix or

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D107961#2943291 , @MyDeveloperDay wrote: >> The above C++ declarations should be inside a class definition, no? > > Not really, we don't have to have any context of where we are (in class or > struct). if you had for example

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 366234. owenpan added a comment. Add checking for `final` and `override`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107961/new/ https://reviews.llvm.org/D107961 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/Format/FormatTe

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D107961#2943445 , @MyDeveloperDay wrote: > This is better as it will catch more cases but there can still be cases we > could fall foul. > > Bar foo(a, Bar) > LLVM_OVERRIDE; > Bar foo(a, Bar) > LLVM_FINAL; > Bar foo

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 366237. owenpan added a comment. Check for `tok::semi` (in addition to `tok::l_paren`) after the first token of a potential K&R C parameter declaration. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107961/new/ https://reviews.llvm.org/D107961 Fil

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 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 rGde763c403715: [clang-format] Distinguish K&R C function definition and attribute (authored by Owen , committed by o

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1388 break; - if (!Line->Tokens.begin()->Tok->is(tok::kw_typedef) && - isC78ParameterDecl(FormatTok)) { + const FormatToken *Next = AllTokens[Tokens->getPosition() + 1]

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 366342. owenpan added a comment. This revision is now accepted and ready to land. Fix the assertion failure and add more test cases. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107961/new/ https://reviews.llvm.org/D107961 Files: clang/lib/Forma

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked 3 inline comments as done. owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:17 #include "FormatToken.h" -#include "clang/Basic/TokenKinds.h" #include "llvm/ADT/STLExtras.h" HazardyKnusperkeks wrote: > owenpan wr

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-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 rGf6928cf45516: [clang-format] Distinguish K&R C function definition and attribute (authored by Owen , committed by o

[PATCH] D108094: [clang-format] Improve detection of parameter declarations in K&R C

2021-08-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, krasimir. owenpan added a project: clang-format. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Clean up the detection of parameter declara

[PATCH] D108094: [clang-format] Improve detection of parameter declarations in K&R C

2021-08-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 366541. owenpan added a comment. Simplified the code slightly. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108094/new/ https://reviews.llvm.org/D108094 Files: clang/lib/Format/UnwrappedLineParser.cpp Index: clang/lib/Format/UnwrappedLineParse

[PATCH] D108094: [clang-format] Improve detection of parameter declarations in K&R C

2021-08-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1025 if (!isC78Type(*Tok) && !Tok->isOneOf(tok::kw_register, tok::kw_struct, tok::kw_union)) return false; MyDeveloperDay wrote: > should we have test cases showing

[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

2021-08-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D107961#2946183 , @MyDeveloperDay wrote: > Nit: There is something niggling in the back of my mind that this is too much > logic here to be in parseStructuralElement that sort of suggests to me that > this isn't the correct

[PATCH] D108094: [clang-format] Improve detection of parameter declarations in K&R C

2021-08-18 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG643f2be7b6af: [clang-format] Improve detection of parameter declarations in K&R C (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108094

[PATCH] D108094: [clang-format] Improve detection of parameter declarations in K&R C

2021-08-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D108094#2951973 , @MyDeveloperDay wrote: > @owenpan Can we push all these commits to 13 RC2 via > https://bugs.llvm.org/show_bug.cgi?id=51470 > > We need to mark the commits we want to cherry pick I think. Thanks! Updated 5

[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 created this revision. owenpan added reviewers: djasper, klimek, krasimir, 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 PR50549

[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#2847332 , @MyDeveloperDay wrote: > We already have > > `AllowAllConstructorInitializersOnNextLine` and > `ConstructorInitializerAllOnOneLineOrOnePerLine` > > Sort of feels like we need to combine them with this, > > I

[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#2847933 , @HazardyKnusperkeks wrote: > In D105099#2847328 , > @MyDeveloperDay wrote: > >> Seem similar to D90232: [clang-format] Formatting constructor initializer >> lists b

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