[PATCH] D91950: [clang-format] Add BreakBeforeInlineASMColon configuration

2022-11-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D91950#3915777 , @HazardyKnusperkeks wrote: > @MyDeveloperDay @owenpan What shall we do? > > 1. Abandon this > 2. Commit it in our name > 3. Use the email from this commit: > https://github.com/Wandalen/game_chess/commit/a84bb

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137181#3916488 , @goldstein.w.n wrote: > In D137181#3916474 , @owenpan wrote: > >> You can still simply the changes to UnwrappedLineParser.cpp a lot. In fact, >> instead of adjusting

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137181#3916521 , @goldstein.w.n wrote: > I think we can remove the places I set `InitialPPLevel` and `OldPPLevel` but > anything else I remove causes at least one test to fail. > > What did you do? Just set `PPLevel = PPBran

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:112 : Line(Line), TokenSource(TokenSource), ResetToken(ResetToken), -PreviousLineLevel(Line.Level), PreviousTokenSource(TokenSource), -Token(nullptr), PreviousToken(nullptr)

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.h:66 + /// #endifPPLevel still at : 0 + int PPLevel; + goldstein.w.n wrote: > owenpan wrote: > > You need to initialize `PPLevel` in the constructor. FWIW I'd use >

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137181#3916558 , @goldstein.w.n wrote: > In D137181#3916547 , @owenpan wrote: > >> Yes, if there is a header guard. Otherwise, set `PPLevel` to `PPBranchLevel >> + 1`. > > That fails

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137181#3918117 , @goldstein.w.n wrote: >>> maybe you did something different? >> >> Here is what I did: >> >> $ git diff UnwrappedLineParser.cpp >> diff --git a/clang/lib/Format/UnwrappedLineParser.cpp >> b/clang/lib/For

[PATCH] D137486: [clang-format] Correctly annotate function names before attributes

2022-11-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 rG96e23906b5e8: [clang-format] Correctly annotate function names before attributes (authored by owenpan). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D137755: [clang-format] Treats &/&& as reference when followed by ',' or ')'.

2022-11-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 rGe864ac694540: [clang-format] Treats &/&& as reference when followed by ',' or ')' (authored by red1bluelost, committed by owenpan). Repository: r

[PATCH] D137883: [clang-format][NFC] Improve documentation of FixNamespaceComments

2022-11-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/include/clang/Format/Format.h:2124-2126 + /// namespaces and fixes invalid existing ones. This is omitted for short + /// namespaces, what a short namespace is, is controlled by + /// "ShortNamespaceLines". Or s

[PATCH] D137823: [clang-format][NFC] Moved configuration parsing tests in own file

2022-11-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/ConfigParseTest.cpp:14 + +#define DEBUG_TYPE "parse-test" + You can delete it. Comment at: clang/unittests/Format/ConfigParseTest.cpp:1006 + +TEST(FormatStyle, GetStyleWithEmptyF

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137181#3918715 , @goldstein.w.n wrote: > In D137181#3918673 , @owenpan wrote: > >> Below is how I defined `PPLevel`: >> >> $ git diff UnwrappedLineParser.h >> diff --git a/clang/l

[PATCH] D137865: [clang-format][NFC] Improve documentation on ReflowComments

2022-11-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/include/clang/Format/Format.h:3073-3076 + /// If ``true``, clang-format will attempt to re-flow comments. That is it + /// will touch a comment and *reflow* long comments into new lines, trying to + /// obey the ``ColumnLimit``.

[PATCH] D137865: [clang-format][NFC] Improve documentation on ReflowComments

2022-11-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/include/clang/Format/Format.h:3864 /// \endcode + /// This option has only effect if ``ReflowComments`` is set to ``true``. /// \version 13 owenpan wrote: > We need an empty line after `/// \endcode`. > We n

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I think we are close to the finishing line. Can you revisit the change to the formatter and clean it up? For example, casting `PPLevel` to `unsigned` is redundant now. IMO you can simply the change too. Comment at: clang/lib/Format/UnwrappedLineFormat

[PATCH] D137823: [clang-format][NFC] Moved configuration parsing tests in own file

2022-11-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/ConfigParseTest.cpp:1006 + +TEST(FormatStyle, GetStyleWithEmptyFileName) { + llvm::vfs::InMemoryFileSystem FS; HazardyKnusperkeks wrote: > owenpan wrote: > > Otherwise, the test will be skipped. >

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137181#3924002 , @sstwcw wrote: > Can you make `TokenAnnotator::printDebugInfo` print `PPLevel`? @goldstein.w.n can you add it as follows? $ git diff TokenAnnotator.cpp diff --git a/clang/lib/Format/TokenAnnotator.cpp b

[PATCH] D137823: [clang-format][NFC] Moved configuration parsing tests in own file

2022-11-15 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. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137823/new/ https://reviews.llvm.org/D137823 ___ cfe-commits mailing list cfe-comm

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @gedare thanks for changing `EXPECT_EQ` to `verifyFormat`, but IMO we should do that in another patch so that it would be easier (at least for me) to review the new tests and to make sure no existing tests have been changed by accident. Comment at: cl

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-17 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/D137762/new/ https://reviews.llvm.org/D137762 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Please mark review comments as done if you have addressed them. Can you also clean up the test cases, removing overlapping/redundant ones, making sure a test case doesn't end with a newline (e.g., line 5380), etc? Comment at: clang/lib/Format/Unwrappe

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:838 + // If this changes PPLevel needs to be used for get correct indentation. + assert(!(Line.InMacroBody && InPPDirective)); return Line.Level * Style.IndentWidth + Length <= ColumnLimit; -

[PATCH] D138234: [clang-format] Support new file formatting with vim

2022-11-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/tools/clang-format/clang-format.py:48 import vim +import os.path Can you move it up to keep the module names sorted? Comment at: clang/tools/clang-format/clang-format.py:80 lines = ['-lin

[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

2022-11-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137181#3935856 , @goldstein.w.n wrote: > In D137181#3935752 , @owenpan wrote: > >> Please mark review comments as done if you have addressed them. Can you also >> clean up the test c

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

2022-11-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I suppose it's fairly easy to annotate the `l_brace` of a namespace? If so, then wouldn't it be better to do that? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138263/new/ https://reviews.llvm.org/D138263 ___

[PATCH] D142412: [clang-format] Put peekNextToken(/*SkipComment=*/true) to good use

2023-01-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3592-3601 case tok::kw_bool: // bool is only allowed if it is directly followed by a paren for a cast: // concept C = bool(...); // and bool is the only type, all other t

[PATCH] D142412: [clang-format] Put peekNextToken(/*SkipComment=*/true) to good use

2023-01-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 rG56313f65cce7: [clang-format] Put peekNextToken(/*SkipComment=*/true) to good use (authored by owenpan). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D142412: [clang-format] Put peekNextToken(/*SkipComment=*/true) to good use

2023-01-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3592-3601 case tok::kw_bool: // bool is only allowed if it is directly followed by a paren for a cast: // concept C = bool(...); // and bool is the only type, all other t

cfe-commits@lists.llvm.org

2023-01-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:116-117 + SmallVector &TrackedScopes) + : Scopes(TrackedScopes), Style(Style), Line(Line), +CurrentToken(Line.First), AutoFound(false), Keywords(Keywords) { Contexts

cfe-commits@lists.llvm.org

2023-01-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2488-2490 +(NextToken && NextToken->Tok.isAnyIdentifier()) && +(NextToken->getNextNonComment() && + (NextToken->getNextNonComment()->isOneOf( dkt01 wrote: > owe

[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2023-01-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D14484#4079711 , @HantaoPan wrote: > Hi, > I am interesting in this feature too. You know, consistency is crucial to a > large program... > > regards, As mentioned above, it has been added in D108752

[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2023-01-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D14484#4087879 , @HantaoPan wrote: > Thank you! Is there a similar flag wrt function parameter? (say a "Never" > other than "false", which can always put each function parameter on its own > line.) Nope. Repository: rL LL

[PATCH] D142804: [clang-format] Support clang-format on/off line comments as prefixes

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

[PATCH] D142804: [clang-format] Support clang-format on/off line comments as prefixes

2023-01-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/Format.cpp:3893 +bool isClangFormatOn(StringRef Comment) { + if (Comment == "/* clang-format on */") alexolog wrote: > alexolog wrote: > > Here's my attempt at something flexible: > > Disclaimer: this

[PATCH] D142804: [clang-format] Support clang-format on/off line comments as prefixes

2023-01-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 493069. owenpan added a comment. Only allows `:` as the first character after `// clang-format on` or `// clang-format off`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142804/new/ https://reviews.llvm.org/D142804 Files: clang/docs/ClangFormat

[PATCH] D142804: [clang-format] Support clang-format on/off line comments as prefixes

2023-01-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 493180. owenpan added a comment. Improves `isClangFormatOnOff()` a little bit. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142804/new/ https://reviews.llvm.org/D142804 Files: clang/docs/ClangFormatStyleOptions.rst clang/include/clang/Format/F

[PATCH] D142804: [clang-format] Support clang-format on/off line comments as prefixes

2023-01-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/Format.cpp:3901 + return Comment.startswith(Prefix) && + (Comment.size() == Size || isblank(Comment[Size])); +} HazardyKnusperkeks wrote: > owenpan wrote: > > HazardyKnusperkeks wrote: > > > rym

[PATCH] D142804: [clang-format] Support clang-format on/off line comments as prefixes

2023-01-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/Format.cpp:3893 +bool isClangFormatOn(StringRef Comment) { + if (Comment == "/* clang-format on */") alexolog wrote: > owenpan wrote: > > alexolog wrote: > > > alexolog wrote: > > > > Here's my attemp

cfe-commits@lists.llvm.org

2023-02-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:123-125 + bool braceTokenMatchesScope(FormatToken &Token) { +if (!Token.is(tok::l_brace) || Scopes.empty()) + return false; Comment at: clang/lib/Format/T

[PATCH] D142804: [clang-format] Support clang-format on/off line comments as prefixes

2023-02-01 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG25e2d0f3c803: [clang-format] Support clang-format on/off line comments as prefix (authored by owenpan). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D143091: [clang-format] PackConstructorInitializers support PCIS_OnlyNextLine

2023-02-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:3891 + * ``PCIS_OnlyNextLine`` (in configuration: ``OnlyNextLine``) +Put all constructor initializers on the next line if they fit. Backl1ght wrote: > @HazardyKnusperkeks M

[PATCH] D142891: [clang-format] Recognize Verilog non-blocking assignment

2023-02-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1628 bool InCSharpAttributeSpecifier = false; +bool AssignmentFound = false; enum { Comment at: clang/lib/Format/TokenAnnotator.cpp:1935-1936 + }

cfe-commits@lists.llvm.org

2023-02-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:123 private: + ScopeType getScopeType(FormatToken &Token) { +switch (Token.getType()) { As suggested before. Comment at: clang/

[PATCH] D143091: [clang-format] PackConstructorInitializers support PCIS_NextLineOnly

2023-02-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/Format.cpp:446 IO.enumCase(Value, "NextLine", FormatStyle::PCIS_NextLine); +IO.enumCase(Value, "OnlyNextLine", FormatStyle::PCIS_NextLineOnly); } Comment at: clang/unittes

cfe-commits@lists.llvm.org

2023-02-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 rG35f2ac1763ad: [clang-format] Fix inconsistent annotation of operator& (authored by dkt01, committed by owenpan). Repository: rG LLVM Github Monore

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

2023-02-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Why don't we fix the buildbot instead? Why does it use a pre-16 version to test 16 source? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141098/new/ https://reviews.llvm.org/D141098 ___

[PATCH] D141563: [clang-format] Fix a bug in DerivePointerAlignment fallback

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

[PATCH] D141230: [clang-format-diff.py] give clang-format-diff a job pool (10x speed)

2023-01-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Can you add an option e.g. `-j N` where `N` is a positive integer and defaults to 1? Also, can you include a use case in which we can see the ~10x improvement on runtime? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D14123

[PATCH] D141098: [clang-format][NFC] Set DeriveLineEnding to false in config files

2023-01-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Unfortunately, changing the default value of `DeriveLineEnding` to `false` would break too many unit tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141098/new/ https://reviews.llvm.org/D141098 __

[PATCH] D141654: [clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding

2023-01-12 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] D141098: [clang-format][NFC] Set DeriveLineEnding to false in config files

2023-01-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I will change `DeriveLineEnding: false` to `LineEnding: LF` after D141654 lands. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141098/new/ https://reviews.llvm.org/D141098 __

[PATCH] D141230: [clang-format-diff.py] give clang-format-diff a job pool (10x speed)

2023-01-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141230#4048069 , @seanptmaher wrote: > The use case I was using this with was running diff formatting of very large > diffs (automated mass refactors changing thousands of files) on the chromium > codebase -- I'm not sure h

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

2023-01-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a reviewer: rymiel. owenpan added a comment. We should get this patch landed. Can we use `Michael Kirk ` as the author (see the same/similar patch at https://bugs.llvm.org/show_bug.cgi?id=28654) because @Eitot hasn't responded for quite some time now? Repository: rG LLVM Githu

[PATCH] D141563: [clang-format] Fix a bug in DerivePointerAlignment fallback

2023-01-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 rG2e2aa8bb6dea: [clang-format] Fix a bug in DerivePointerAlignment fallback (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D141654: [clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding

2023-01-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 489125. owenpan added a comment. Rebased and ran the latest `dump_format_style.py` to generate `ClangFormatStyleOptions.rst`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141654/new/ https://reviews.llvm.org/D141654 Files: clang/docs/ClangForma

[PATCH] D141654: [clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding

2023-01-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141654#4052510 , @HazardyKnusperkeks wrote: > In D141654#4050852 , @rymiel wrote: > >> (This needs to run the updated dump script from D138446 >> )

[PATCH] D141654: [clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding

2023-01-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141654#4050852 , @rymiel wrote: > I'm not sure what the strict //benefit// of squishing the two options > together is, but I support it See D108752 and the added table in the summary. CH

[PATCH] D141654: [clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding

2023-01-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 rGe3eca3359402: [clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding (authored by owenpan). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D142296: [clang-format] Fix a bug in parsing C++20 import statements

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

[PATCH] D141654: [clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding

2023-01-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141654#4053551 , @HazardyKnusperkeks wrote: > In D141654#4053470 , @rymiel wrote: > >> This also made me wonder, is there an actual policy on deprecated options? >> As in, when they

[PATCH] D141654: [clang-format] Replace DeriveLineEnding and UseCRLF with LineEnding

2023-01-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141654#4053470 , @rymiel wrote: > This also made me wonder, is there an actual policy on deprecated options? As > in, when they are actually removed. We deprecate options only as a cleanup (as in this patch) or when adding n

[PATCH] D142296: [clang-format] Fix bugs in parsing C++20 module import statements

2023-01-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 491135. owenpan retitled this revision from "[clang-format] Fix a bug in parsing C++20 import statements" to "[clang-format] Fix bugs in parsing C++20 module import statements". owenpan edited the summary of this revision. owenpan added a comment. Also fixed

[PATCH] D142296: [clang-format] Fix bugs in parsing C++20 module import statements

2023-01-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 491137. owenpan added a comment. Simplified `parseModuleImport()` a little bit. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142296/new/ https://reviews.llvm.org/D142296 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/lib/Format/Unwrappe

[PATCH] D142296: [clang-format] Fix bugs in parsing C++20 module import statements

2023-01-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 491138. owenpan added a comment. Added test cases with `import` followed by comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142296/new/ https://reviews.llvm.org/D142296 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/lib/Format/Un

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

2023-01-22 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdadfc6b38b00: [clang-format][NFC] Set LineEnding to LF in config files (authored by owenpan). Changed prior to commit: https://reviews.llvm.org/D141098?vs=486708&id=491142#toc Repository: rG LLVM Git

[PATCH] D142296: [clang-format] Fix bugs in parsing C++20 module import statements

2023-01-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 491221. owenpan added a comment. Put back the inadvertently removed line `nextToken();`, which was just before the outer `while` loop in `parseModuleImport()`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142296/new/ https://reviews.llvm.org/D1422

[PATCH] D142296: [clang-format] Fix bugs in parsing C++20 module import statements

2023-01-23 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG02fd0020e577: [clang-format] Fix bugs in parsing C++20 module import statements (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D142412: [clang-format] Put peekNextToken(/*SkipComment=*/true) to good use

2023-01-23 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. To prevent poten

[PATCH] D142412: [clang-format] Put peekNextToken(/*SkipComment=*/true) to good use

2023-01-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3592-3601 case tok::kw_bool: // bool is only allowed if it is directly followed by a paren for a cast: // concept C = bool(...); // and bool is the only type, all other t

[PATCH] D142412: [clang-format] Put peekNextToken(/*SkipComment=*/true) to good use

2023-01-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3592-3601 case tok::kw_bool: // bool is only allowed if it is directly followed by a paren for a cast: // concept C = bool(...); // and bool is the only type, all other t

[PATCH] D127532: [clang-format] Fix a bug in RemoveBracesLLVM

2022-06-10 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. Remove the bra

[PATCH] D127484: [clang-format] Use tabs on GNU style

2022-06-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D127484#3574992 , @MyDeveloperDay wrote: > Oh gosh! It hard to make such changes and someone else not call them a > regression, I’m not sure how I feel. We do kind of have to be able to fix > bugs and if this gets closer to

[PATCH] D127484: [clang-format] Use tabs on GNU style

2022-06-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D127484#3574803 , @curdeius wrote: > It seems like a breaking change that may be painful for users of GNU style. Yeah. There are tens of thousands of lines starting with 8 spaces but none starting with a tab in all .c files u

[PATCH] D127532: [clang-format] Fix a bug in RemoveBracesLLVM

2022-06-11 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 rG05d771021ad9: [clang-format] Fix a bug in RemoveBracesLLVM (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2022-06-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D127390#3575628 , @MyDeveloperDay wrote: > If we remove it from here, then it will get removed from the documentation > > F23403281: image.png > > Also if you remove it, then the ClangForm

[PATCH] D127578: [clang-format] Handle deprecated options in dump_format_style.py

2022-06-11 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. Also add two d

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

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

[PATCH] D127484: [clang-format] Use tabs on GNU style

2022-06-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D127484#3576061 , @a4lg wrote: > Interesting. > > I measured some development branch (targeting `*.c`, `*.cc`, `*.cpp` and > `*.h`): > > | Program | prefix: 8 spaces | prefix: 1 tab | 8sp percentage | > | Coreutils | 23494

[PATCH] D127578: [clang-format] Handle deprecated options in dump_format_style.py

2022-06-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan closed this revision. owenpan added a comment. Landed in b1c300f . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127578/new/ https://reviews.llvm.org/D127578 ___

[PATCH] D127614: [clang-format] Handle more cases for RemoveBracesLLVM

2022-06-13 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. Call mightFitO

[PATCH] D127614: [clang-format] Handle more cases for RemoveBracesLLVM

2022-06-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 rG7cb0bc8abf6e: [clang-format] Handle more cases for RemoveBracesLLVM (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D127685: [clang-format] Never analyze insert/remove braces in the same pass

2022-06-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. Turn off `Remo

[PATCH] D127685: [clang-format] Never analyze insert/remove braces in the same pass

2022-06-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 rG07b3446d7243: [clang-format] Never analyze insert/remove braces in the same pass (authored by owenpan). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D127827: [clang-format][NFC] Fix braces in ClangFormat.cpp

2022-06-14 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] D127827: [clang-format][NFC] Fix braces in ClangFormat.cpp

2022-06-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 rG2d82c9ccf32c: [clang-format][NFC] Fix braces in ClangFormat.cpp (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2319-2320 + // enable_if<>{} && ... + if (MatchingLBrace && MatchingLBrace->getPreviousNonComment() && + MatchingLBrace->getPreviousNonComment()->is

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D127873#3600978 , @jackhong12 wrote: > Thanks. I am not sure which modification will be better, the patch I > submitted or the following code. > > FormatToken *BeforeLBraceToken = nullptr; > if (MatchingLBrace) > Befo

[PATCH] D128496: [clang-format] Further improve requires clause detection

2022-06-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3163-3169 + default: +if (!PreviousNonComment->isTypeOrIdentifier()) { + // It's an expression. + parseRequiresExpression(RequiresToken); + return false; +} +LLVM_FALLT

[PATCH] D128574: [clang-format] Quit analyzing solution space for large state count

2022-06-24 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] D126358: clang-format][NFC] Refactor UnwrappedLineParser::parseBlock()

2022-05-25 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] D126358: clang-format][NFC] Refactor UnwrappedLineParser::parseBlock()

2022-05-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:874 - if (SimpleBlock && !KeepBraces) { + auto RemoveBraces = [=]() mutable { +if (KeepBraces || !SimpleBlock) curdeius wrote: > Are there many captures here? Wouldn't it

[PATCH] D126438: [clang-format] Fix an invalid code generation in RemoveBracesLLVM

2022-05-25 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] D126365: [git-clang-format] Stop ignoring changes for files with space in path

2022-05-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Can you update the diff with context? See https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126365/new/ https://reviews.llvm.org/D126365 __

[PATCH] D126438: [clang-format] Fix an invalid code generation in RemoveBracesLLVM

2022-05-26 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5221875a957d: [clang-format] Fix an invalid code generation in RemoveBracesLLVM (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D126358: clang-format][NFC] Refactor UnwrappedLineParser::parseBlock()

2022-05-26 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5bf44aa434ff: [clang-format][NFC] Refactor UnwrappedLineParser::parseBlock() (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126358/new/

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

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

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

2022-05-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D126365#3536736 , @curdeius wrote: > Would it be possible to add a test please? There are no tests for this script, but I have tested this patch on macOS. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

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

2022-06-01 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. If a do-while

[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/unittests/Format/FormatTest.cpp:25103 - // The following eight test cases are fully-braced versions of the examples at + // The following nine test cases are fully-braced versions of the examples at // "llvm.org/docs/Coding

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

2022-06-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 433432. owenpan added a comment. Removed the numbering of the examples from the coding standards. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126758/new/ https://reviews.llvm.org/D126758 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/l

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