[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] 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

[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

[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.

[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 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:

[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

[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

[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

[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] 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:

[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] 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

[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

[PATCH] D140956: [clang-format] Add an option for breaking after C++11 attributes

2023-01-11 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140956#4042990 , @krasimir wrote: >> Was it actually a regression or did this patch also fix a bug? It seems that >> the continuation indent before the & in your example is inconsistent with >> other similar function

[PATCH] D140956: [clang-format] Add an option for breaking after C++11 attributes

2023-01-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140956#4038988 , @krasimir wrote: > It looks like this regressed the following example: > > % cat test.cc # formatted with older clang-format > a > () { > return 1; > } > %

[PATCH] D141288: [clang-format] Inherit RightAlign options across scopes

2023-01-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/D141288/new/ https://reviews.llvm.org/D141288

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

2023-01-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141098#4032951 , @rymiel wrote: >> I think we should combine `DeriveLineEnding` and `UseCRLF` > > Do you mean a single `LineEnding` options which is an enum with `LF`, `CRLF` > and `Derive`, or similar? Yep. Repository:

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

2023-01-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141098#4030426 , @rymiel wrote: > The LLVM Coding Standard apparently doesn't mention line endings..? Line endings probably should never be specified in coding standards, but the default should match the majority, and in

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

2023-01-05 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

[PATCH] D141035: [clang-format] Add an option to insert a newline at EOF if missing

2023-01-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 rG2c6ecc9db624: [clang-format] Add an option to insert a newline at EOF if missing (authored by owenpan). Changed prior to commit:

[PATCH] D141035: [clang-format] Add an option to insert a newline at EOF if missing

2023-01-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D141035#4028134 , @MyDeveloperDay wrote: > I think I've died an gone to heaven!! LGTM... Happy New Year! Happy New Year to you too! Thanks to your comment in D19031#1747112 , I

[PATCH] D140835: [clang-format] Improve UnwrappedLineParser::mightFitOnOneLine()

2023-01-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140835#4028479 , @HazardyKnusperkeks wrote: > In D140835#4028274 , @owenpan wrote: > >> If `RemoveBracesLLVM` is false, the line is too long and will wrap. > > That's what I fail to

[PATCH] D140835: [clang-format] Improve UnwrappedLineParser::mightFitOnOneLine()

2023-01-05 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5751c439be7d: [clang-format] Improve UnwrappedLineParser::mightFitOnOneLine() (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D140843: [clang-format] fix template closer followed by >

2023-01-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140843#4028142 , @MyDeveloperDay wrote: > I'd like one of @owenpan, @HazardyKnusperkeks or @rymiel to comment before > commit, just to get another view. Perhaps clang-format should never insert a space in `>>`. CHANGES

[PATCH] D140956: [clang-format] Add an option for breaking after C++11 attributes

2023-01-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 rGa28f0747c2f3: [clang-format] Add an option for breaking after C++11 attributes (authored by owenpan). Repository: rG LLVM Github Monorepo

[PATCH] D140956: [clang-format] Add an option for breaking after C++11 attributes

2023-01-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140956#4028147 , @MyDeveloperDay wrote: > If someone wants to extend this to include the old form, then that can be a > completely different review. Better yet, use another tool like clang-tidy to replace the old with the

[PATCH] D140835: [clang-format] Improve UnwrappedLineParser::mightFitOnOneLine()

2023-01-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140835#4028257 , @HazardyKnusperkeks wrote: > In D140835#4023132 , @owenpan wrote: > >> In D140835#4023080 , >> @HazardyKnusperkeks wrote:

[PATCH] D141035: [clang-format] Add an option to insert a newline at EOF if missing

2023-01-05 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

[PATCH] D140956: [clang-format] Add an option for breaking after C++11 attributes

2023-01-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140956#4025614 , @MyDeveloperDay wrote: > Should we care about other forms of attributes like `__stdcall` etc..? I > personally don't, just I assume from the tests this isn't covered (maybe just > add that limitation to

[PATCH] D140956: [clang-format] Add an option for breaking after C++11 attributes

2023-01-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 486445. owenpan retitled this revision from "[clang-format] Add an option for breaking after C++ attributes" to "[clang-format] Add an option for breaking after C++11 attributes". owenpan edited the summary of this revision. owenpan added a comment. -

[PATCH] D140956: [clang-format] Add an option for breaking after C++ attributes

2023-01-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/FormatToken.h:324 + /// \c true if this token starts a C++ attribute. + unsigned StartsCppAttribute : 1; + Can be removed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D140956: [clang-format] Add an option for breaking after C++ attributes

2023-01-04 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. This patch only

[PATCH] D140835: [clang-format] Improve UnwrappedLineParser::mightFitOnOneLine()

2023-01-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140835#4023080 , @HazardyKnusperkeks wrote: > On second thought, shouldn't we test for removing the braces? Hmm. This patch including the added test case //is// for removing braces. Repository: rG LLVM Github Monorepo

[PATCH] D140339: [clang-format] Remove special logic for parsing concept definitions.

2023-01-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:23593-23594 - "template \n" - "concept DelayedCheck = static_cast(0) ||\n" - " requires(T t) { t.bar(); } && sizeof(T) <= 8;");

[PATCH] D140835: [clang-format] Improve UnwrappedLineParser::mightFitOnOneLine()

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

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-31 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 rG89aad1e6a397: Reland [clang-format] Add an option to format integer literal separators (authored by owenpan). Repository: rG LLVM Github Monorepo

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan requested review of this revision. owenpan added inline comments. Comment at: clang/lib/Format/IntegerLiteralSeparatorFixer.cpp:81-82 + + llvm::SpecificBumpPtrAllocator Allocator; + auto Tok = new (Allocator.Allocate()) Token; + Lex->LexFromRawLexer(*Tok);

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 485658. owenpan added a comment. It turns out that the memory bug had nothing to do with whether to use the stack or heap memory for the `Token` object. The culprit was passing `getFormattingLangOpts(Style)` directly to the `Lexer` constructor. I suppose

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan requested review of this revision. owenpan added a comment. In D140543#4016184 , @thakis wrote: > In D140543#4016181 , @owenpan wrote: > >> In D140543#4016156 ,

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 485600. owenpan added a comment. Fix a memory bug, which doesn't surface in Debug build. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140543/new/ https://reviews.llvm.org/D140543 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140543#4016156 , @thakis wrote: > This seems to break tests everywhere, eg > http://45.33.8.238/linux/95289/step_7.txt > > Please take a look and revert for now if it takes a while to fix. I had run FormatTests on Windows

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-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 rG46c94e5067b5: [clang-format] Add an option to format integer literal separators (authored by owenpan). Repository: rG LLVM Github Monorepo

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 485210. owenpan added a comment. Cleaned up the unit tests a little bit: - Made them a little more varied. - Removed some overlapping test cases. - Removed integer literal suffixes for JavaScript. - Added an octal `BigInt` test case for JavaScript. CHANGES

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 485188. owenpan added a comment. This revision is now accepted and ready to land. - Fixed an assertion failure. - Added unit tests . - Moved all unit tests to another file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140543/new/

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan planned changes to this revision. owenpan added a comment. Will add more unit tests and perhaps move them to their own file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140543/new/ https://reviews.llvm.org/D140543 ___ cfe-commits

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 485180. owenpan added a comment. This revision is now accepted and ready to land. - Adds support for C#, Java, and JavaScript using `_`. - Adds support for only formatting affected ranges. - Simplifies ``IntegerLiteralSeparatorFixer::format()``. - Adds more

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan planned changes to this revision. owenpan added a comment. Will extend this option to support C#, Java, and JavaScript using the underscore character `_` as the separator. Comment at: clang/unittests/Format/FormatTest.cpp:25124 +TEST_F(FormatTest,

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked an inline comment as done. owenpan added inline comments. Comment at: clang/include/clang/Format/Format.h:2395 + /// >0: Insert separators between digits, starting from the rightmost digit. + struct IntegerLiteralSeparatorStyle { +/// \code

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 484841. owenpan added a comment. Fixed another bug and added some unit tests. Also updated ReleaseNotes.rst and addressed some review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140543/new/ https://reviews.llvm.org/D140543 Files:

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 484801. owenpan added a comment. Fixes a couple of bugs. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140543/new/ https://reviews.llvm.org/D140543 Files: clang/docs/ClangFormatStyleOptions.rst clang/include/clang/Format/Format.h

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan planned changes to this revision. owenpan added a comment. Will add unit tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140543/new/ https://reviews.llvm.org/D140543 ___ cfe-commits mailing

[PATCH] D140543: [clang-format] Add an option to format integer literal separators

2022-12-22 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

[PATCH] D139801: [clang-format] Adds 'friend' to QualifierOrder.

2022-12-22 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 rG4cafc3727b35: [clang-format] Add friend to QualifierOrder (authored by red1bluelost, committed by owenpan). Repository: rG LLVM Github Monorepo

[PATCH] D139801: [clang-format] Adds 'friend' to QualifierOrder.

2022-12-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D139801#3991108 , @MyDeveloperDay wrote: > I also appreciate the concessions made by others to allow clang-format to > alter code as this has opened the doors in my view to 1 or 2 other great code > modification changes.

[PATCH] D140058: [clang-format][NFC] Turn on some code-changing options one by one

2022-12-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D140058#4000332 , @rupprecht wrote: > In D140058#4000311 , @rupprecht > wrote: > >> This is causing a test failure: >>

[PATCH] D140058: [clang-format][NFC] Turn on some code-changing options one by one

2022-12-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 rG240e29c5015d: [clang-format][NFC] Turn on some code-changing options one by one (authored by owenpan). Repository: rG LLVM Github Monorepo

[PATCH] D140058: [clang-format][NFC] Turn on some code-changing options one by one

2022-12-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks, rymiel. owenpan added a project: clang-format. Herald added a project: All. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. For the

[PATCH] D139999: [clang-format][NFC] Don't run any passes if Environment::make fails

2022-12-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 rG0e89f1cca495: [clang-format][NFC] Dont run any passes if Environment::make fails (authored by owenpan). Repository: rG LLVM Github Monorepo

[PATCH] D139999: [clang-format][NFC] Don't run any passes if Environment::make fails

2022-12-14 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:

[PATCH] D139801: [clang-format] Adds 'friend' to QualifierOrder.

2022-12-12 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D139801#3989812 , @HazardyKnusperkeks wrote: > My idea would be hardcoded `friend` as first entry, regardless of the chosen > sequence. > But others may have a different opinion on that. It would be confusing with

[PATCH] D139760: Revert "[clang-format] Link the braces of a block in UnwrappedLineParser"

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

[PATCH] D139760: Revert "[clang-format] Link the braces of a block in UnwrappedLineParser"

2022-12-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: HazardyKnusperkeks, MyDeveloperDay, rymiel. owenpan added a project: clang-format. Herald added a project: All. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. But keep the

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

2022-12-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. See https://github.com/llvm/llvm-project/issues/59417. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139257/new/ https://reviews.llvm.org/D139257 ___ cfe-commits mailing list

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

2022-12-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D138263#3975828 , @owenpan wrote: > Can you rebase (preferably after landing D138402 > )? See D139257#3983332 . If it gets reverted, we have to do

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

2022-12-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I have second thoughts about linking block braces in `UnwrappedLineParser`. Consider the following example: #if A while (a) { // Linked to the r_brace below #else while(b) { // Also linked to the r_brace below #endif foo(); } // Linked to the l_brace of

[PATCH] D139281: [clang-format] Fix an assertion failure in block parsing

2022-12-06 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 rG15f121e85384: [clang-format] Fix an assertion failure in block parsing (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE

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

2022-12-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Can you rebase (preferably after landing D138402 )? Comment at: clang/lib/Format/WhitespaceManager.cpp:991 +bool DontAlignThisComment = +i > 0 && Changes[i - 1].Tok->is(TT_NamespaceRBrace); bool

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

2022-12-06 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 rGb40e9dce0a67: [clang-format] Avoid breaking )( with BlockIndent (authored by gedare, committed by owenpan). Repository: rG LLVM Github Monorepo

[PATCH] D139281: [clang-format] Fix an assertion failure in block parsing

2022-12-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 480364. owenpan added a comment. Moved `isBlockBegin()` to `UnwrappedLineParser`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139281/new/ https://reviews.llvm.org/D139281 Files: clang/lib/Format/FormatToken.h

[PATCH] D139281: [clang-format] Fix an assertion failure in block parsing

2022-12-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D139281#3969880 , @HazardyKnusperkeks wrote: > We should rename, remove, or re add the functionality for this function. Or > else someone new will come along and be confused. +1 Repository: rG LLVM Github Monorepo

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

2022-12-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @gedare do you need us to commit this patch on your behalf (using "Gedare Bloom ")? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762

[PATCH] D139281: [clang-format] Fix an assertion failure in block parsing

2022-12-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: sstwcw, HazardyKnusperkeks, MyDeveloperDay, rymiel. owenpan added a project: clang-format. Herald added a project: All. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This

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

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

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

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

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

2022-12-04 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe33243c950ac: [clang-format] Link the braces of a block in UnwrappedLineParser (authored by owenpan). Repository: rG LLVM Github Monorepo

[PATCH] D138378: [clang-format][NFC] Skip unneeded calculations

2022-12-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. The refactoring `std::max(0, C.Spaces)` part still looks good though, but probably it's not worth it to have a patch just for that. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138378/new/ https://reviews.llvm.org/D138378

[PATCH] D138358: [clang-format] Match all block braces

2022-12-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D138358#3968759 , @HazardyKnusperkeks wrote: > In D138358#3968610 , @owenpan wrote: > >> Please see D139257 for a different >> approach. > > All my

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

2022-12-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 479884. owenpan added a comment. Updated `resetOptional()` to make resetting `Optional` more obvious. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139257/new/ https://reviews.llvm.org/D139257 Files: clang/lib/Format/UnwrappedLineParser.cpp

[PATCH] D138358: [clang-format] Match all block braces

2022-12-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Please see D139257 for a different approach. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138358/new/ https://reviews.llvm.org/D138358 ___

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

2022-12-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: HazardyKnusperkeks, MyDeveloperDay, rymiel, klimek. 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] D138358: [clang-format] Match all block braces

2022-12-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. This wouldn't work for deeply nested loops: $ cat test.cpp for (;;) { for (;;) { for (;;) { a; } } } $ clang-format -style='{RemoveBracesLLVM: true}' test.cpp for (;;) for (;;) for (;;) a; Expected output: for

[PATCH] D139029: [clang-format] Don't move comments if AlignTrailingComments: Kind: Leave

2022-12-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 rGad83bead3d42: [clang-format] Dont move comments if AlignTrailingComments: Leave (authored by mairacanal, committed by owenpan). Repository: rG

[PATCH] D139029: [clang-format] Don't move comments if AlignTrailingComments: Kind: Leave

2022-12-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. Please mark comments as done if you have addressed them. Comment at: clang/unittests/Format/FormatTestComments.cpp:3071 +"\n" +"// comment\n", +format("// do not touch\n"

[PATCH] D138378: [clang-format][NFC] Skip unneeded calculations

2022-12-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. To my surprise, tools/clang/unittests/Format/FormatTests with the patch ran a little bit slower: | | Run 1 | Run 2 | Run 3 | Average | | w/o patch | 2707ms | 2697ms | 2710ms | 2705ms | | w/ patch | 2720ms | 2719ms | 2724ms | 2721ms | CHANGES SINCE LAST

[PATCH] D138378: [clang-format][NFC] Skip unneeded calculations

2022-12-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I ran (on macOS Ventura) the release build of clang-format 8627811 on the entire clang codebase and saw only a 0.12% reduction in runtime, which is what I expected. | | Run 1 | Run 2 |

[PATCH] D138402: [clang-format] Correctly count a tab's width in a comment

2022-12-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. Thanks for unstacking it! Comment at: clang/unittests/Format/FormatTestComments.cpp:66-67 const FormatStyle = getLLVMStyle()) { EXPECT_EQ(Code.str(), format(Code, Style)) << "Expected code is

[PATCH] D138402: [clang-format] Correctly count a tab's width in a comment

2022-11-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestComments.cpp:736 + "//* 0.2)", + "//\t\t\t\tofMap(message.velocity, 0, 127, 0, ofGetWidth() * 0.2)"); } owenpan wrote: > HazardyKnusperkeks wrote: > > owenpan wrote: > > > ```

[PATCH] D138402: [clang-format] Correctly count a tab's width in a comment

2022-11-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestComments.cpp:736 + "//* 0.2)", + "//\t\t\t\tofMap(message.velocity, 0, 127, 0, ofGetWidth() * 0.2)"); } HazardyKnusperkeks wrote: > owenpan wrote: > > ``` > > error: reference

[PATCH] D138378: [clang-format][NFC] Skip unneeded calculations

2022-11-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:1434-1436 + if (Style.UseTab == FormatStyle::UT_Never) { +ReplacementText.append(Spaces, ' '); + } else { HazardyKnusperkeks wrote: > owenpan wrote: > > Doing

[PATCH] D138402: [clang-format] Correctly count a tab's width in a comment

2022-11-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestComments.cpp:736 + "//* 0.2)", + "//\t\t\t\tofMap(message.velocity, 0, 127, 0, ofGetWidth() * 0.2)"); } ``` error: reference to type 'const clang::format::FormatStyle' could

[PATCH] D138371: [clang-format] Fix a crash due to dereferencing null MatchingParen

2022-11-21 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4daeb8c73354: [clang-format] Fix a crash due to dereferencing null MatchingParen (authored by owenpan). Repository: rG LLVM Github Monorepo

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

2022-11-21 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/D138234/new/ https://reviews.llvm.org/D138234

[PATCH] D138378: [clang-format][NFC] Skip unneeded calculations

2022-11-20 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:1433 // assert((int)C.StartOfTokenColumn >= C.Spaces); - appendIndentText( - ReplacementText, C.Tok->IndentLevel, std::max(0, C.Spaces), -

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

2022-11-19 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 rG92bccf5d3d21: [clang-format] Dont use PPIndentWidth inside multi-line macros (authored by goldstein.w.n, committed by owenpan). Repository: rG

[PATCH] D138371: [clang-format] Fix a crash due to dereferencing null MatchingParen

2022-11-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 476719. owenpan added a comment. Added a test case. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138371/new/ https://reviews.llvm.org/D138371 Files: clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format/FormatTest.cpp Index:

[PATCH] D138371: [clang-format] Fix a crash due to dereferencing null MatchingParen

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

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

2022-11-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137181#3938913 , @goldstein.w.n wrote: > Anything left for me todo (can't imagine I have push access). See here . We will need your name and email. Repository:

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

2022-11-18 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/D137181/new/ https://reviews.llvm.org/D137181

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

2022-11-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D137181#3935951 , @owenpan wrote: > In D137181#3935856 , @goldstein.w.n > wrote: > >> I could remove either the `PPDIS_BeforeHash` or `PPDIS_AfterHash` though as >> the they really

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