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

2023-11-22 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 except the final nits. Comment at: clang/lib/Format/ObjCPropertyAttributeOrderFixer.cpp:48 +const FormatToken *BeginTok, const FormatToken *EndTok) const { + // I

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

2023-11-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. BTW, it may be simpler and more efficient to use a set (e.g. `llvm::SmallSet`) for `Indices`, especially if we don't need/want to handle duplicate attributes that have a value. (See D150083#inline-1551778 .) CHANGES SIN

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

2023-11-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Thank you for your patience! There are still a few comments not done from the previous round. In D150083#4655528 , @owenpan wrote: > See also D153228 . Would this patch have a similar performan

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

2023-11-13 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa852869398af: [clang-format] Fix a bug in parsing function/variable names (authored by gedare, committed by owenpan). Changed prior to commit: https://reviews.llvm.org/D156370?vs=558061&id=558088#toc R

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

2023-11-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan requested changes to this revision. owenpan added a comment. This revision now requires changes to proceed. In D155529#4509686 , @MyDeveloperDay wrote: > We should never make assumptions about what people do/don't use > If you have this you ha

[PATCH] D156360: [clang-format] Support function and overloaded operator SpacesInParensOption

2023-11-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3970-4009 if (Left.is(tok::l_paren) || Right.is(tok::r_paren)) { if (Right.is(TT_CastRParen) || (Left.MatchingParen && Left.MatchingParen->is(TT_CastRParen))) { return Style.Spa

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25814-25824 + " if (quitelongname < alsolongname ||\n" + " anotherevenlongername <=\n" + " thisreallyreallyreallyreallyreallyreallylongername

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:773-792 if ((Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak || Style.AlignAfterOpenBracket == FormatStyle::BAS_BlockIndent) && (Previous.isOneOf(tok::l_paren, TT_Te

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

2023-11-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:-2224 if (PreviousNotConst->is(tok::r_paren) && -PreviousNotConst->is(TT_TypeDeclarationParen)) { +(PreviousNotConst->isOneOf(TT_TypeDeclaration

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

2023-10-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ObjCPropertyAttributeOrderFixer.cpp:184 + for (AnnotatedLine *Line : AnnotatedLines) { +if (!Line->Affected || Line->InPPDirective) + continue; Why not `InPPDirective`? CHANGES SINCE LAST ACT

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

2023-10-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ObjCPropertyAttributeOrderFixer.cpp:104 + // for missing values. + auto sortIndex = [&](const StringRef &needle) -> unsigned { +auto i = SortOrderMap.find(needle); owenpan wrote: > owenpan wrote: >

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

2023-10-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. See also D153228 . Comment at: clang/include/clang/Format/Format.h:3204 + /// \warning + /// Setting this option to ``true`` could lead to incorrect code formatting + /// due to clang-format's lack of complete sema

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

2023-10-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D150083#4655479 , @jaredgrubb wrote: > Should I open a GitHub issue for this patch? That'd be great. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150083/new/ https://reviews.llvm.org/D150083 _

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

2023-10-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Herald added a reviewer: rymiel. In D126132#3546767 , @HazardyKnusperkeks wrote: > One should define what is the difference between `TT_LambdaArrow` and > `TT_TrailingReturnArrow`. But if there is a difference, then the lambda

[PATCH] D71659: [clang-format] Added new option to allow setting spaces before and after the operator

2023-10-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan commandeered this revision. owenpan edited reviewers, added: Luis; removed: owenpan. Herald added a project: All. Herald added reviewers: rymiel, HazardyKnusperkeks. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment Your review contains a change to clang/include/cla

[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] 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] 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
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] 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] 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] 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] 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] 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] 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] 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] D145262: [clang-format] Treat AttributeMacros more like __attribute__

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

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

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

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

2023-10-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145262/new/ https://reviews.llvm.org/D145262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2023-09-08 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG210e7b3ca773: [clang-format] Improve line-breaking in LambdaBodyIndentation: OuterScope (authored by jp4a50, committed by owenpan). Changed prior to

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

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

[PATCH] D129050: [clang-format] Update documentation

2023-09-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/docs/ClangFormat.rst:20 - $ clang-format -help + $ clang-format --help OVERVIEW: A tool to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code. owenpan wrote: > This should be edited in `dump_for

[PATCH] D135115: [clang-format] update --files help description

2023-09-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/docs/ClangFormat.rst:72-73 Used only with --dry-run or -n ---files= - Provide a list of files to run clang-format +--files= - A file containing a list of file

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

2023-09-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. LG with a couple of minor comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:334 + // enabled. + !(Current.is(TT_LambdaLBrace) && Style.BraceWrapping.BeforeLambdaBody) && CurrentState.NoLineB

[PATCH] D129050: [clang-format] Update documentation

2023-09-05 Thread Owen Pan via Phabricator via cfe-commits
Herald added a subscriber: wangpc. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment It looks like your clang-format review does not contain any unit tests, please try to ensure all code changes have a unit test

[PATCH] D135115: [clang-format] update --files help description

2023-09-05 Thread Owen Pan via Phabricator via cfe-commits
Herald added a subscriber: wangpc. Herald added a reviewer: rymiel. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment It looks like your clang-format review does not contain any unit tests, please try to ensure all code changes have a unit test (unless this is an `NFC` or

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

2023-09-05 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf465a482caa9: [clang-format] Fix segmentation fault when formatting nested namespaces (authored by d0nc1h0t, committed by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https

[PATCH] D159233: [clang-format][NFC] Change duplicate config files to symlinks

2023-09-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan abandoned this revision. owenpan added a comment. It seems that git doesn't recreate symbolic links by default on Windows. (See e.g. `clang/test/Driver/Inputs/CUDA-symlinks/usr/bin/ptxas`.) I'll abandon this patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

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

2023-09-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. We need the name and email you want to use in order to commit the patch for you. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158363/new/ https://reviews.llvm.org/D158363 ___ cf

[PATCH] D158795: Fix AlignArrayOfStructures + Cpp11BracedListStyle=false

2023-08-31 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG58c67e724f71: [clang-format] Fix AlignArrayOfStructures + Cpp11BracedListStyle=false (authored by galenelias, committed by owenpan). Changed prior to commit: https://reviews.llvm.org/D158795?vs=553809&i

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

2023-08-31 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Do you need us to commit it for you? See https://llvm.org/docs/Phabricator.html#committing-someone-s-change-from-phabricator. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158363/new/ https://reviews.llvm.org/D158363

[PATCH] D137338: Fix dupe word typos

2023-08-31 Thread Owen Pan via Phabricator via cfe-commits
Herald added a comment. NOTE: Clang-Format Team Automated Review Comment It looks like your clang-format review does not contain any unit tests, please try to ensure all code changes have a unit test (unless this is an `NFC` or refactoring, adding documentation etc..) Add your unit tests in `c

[PATCH] D159233: [clang-format][NFC] Change duplicate config files to symlinks

2023-08-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D15

[PATCH] D159051: [clang-format][NFC] Change EXPECT_EQ to verifyFormat or verifyNoChang

2023-08-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. rG14feca5d14f1 concludes the cleanup of this gigantic file WRT `EXPECT_EQ`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159051/new/ https://reviews.l

[PATCH] D147969: Add InsertBraces to ChromiumStyle

2023-08-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @pbos can you abandon this revision? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147969/new/ https://reviews.llvm.org/D147969 ___ cfe-commits mailing list cfe-commits@lists.llv

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

2023-08-29 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG086305120887: Reland "[clang-format] Annotate constructor/destructor names" (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157963/new/

[PATCH] D159051: [clang-format][NFC] Change EXPECT_EQ to verifyFormat or verifyNoChang

2023-08-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:23933 verifyNoChange("FOO(String-ized&Messy+But(: :Still)=Intentional);", Style); - EXPECT_EQ( - "FOO(String-ized&Messy+But\\(: :Still)=Intentional);", - format("FOO(String-ized&Messy+B

[PATCH] D158947: [clang-format][NFC] Test formatting the input before messing it up

2023-08-29 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6982f1fc2e75: [clang-format][NFC] Test formatting the input before messing it up (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158947/

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

2023-08-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 554051. owenpan added a comment. Fixed the crash and added a test case in `TokenAnnotatorTest.cpp`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157963/new/ https://reviews.llvm.org/D157963 Files: clang/lib/Format/TokenAnnotator.cpp clang/unit

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

2023-08-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3135 + if (!Tok) +break; +} When simplifying the function, I forgot that we are in the inner loop here and thus `break` won't exit the outer loop. Repository: rG

[PATCH] D158795: Fix AlignArrayOfStructures + Cpp11BracedListStyle=false

2023-08-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:20888 + " { 7, 5,\"!!\" }\n" + "};\n", + Style); galenelias wrote: > owenpan wrote: > > galenelias

[PATCH] D158795: Fix AlignArrayOfStructures + Cpp11BracedListStyle=false

2023-08-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:20888 + " { 7, 5,\"!!\" }\n" + "};\n", + Style); galenelias wrote: > owenpan wrote: > > > This is consistent with basically every

[PATCH] D158947: [clang-format][NFC] Test formatting the input before messing it up

2023-08-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D15

[PATCH] D158925: [clang-format][NFC] Skip stability test if input is pre-formatted

2023-08-26 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc8521451708a: [clang-format][NFC] Skip stability test if input is pre-formatted (authored by owenpan). Changed prior to commit: https://reviews.llvm.org/D158925?vs=553714&id=553765#toc Repository: rG

[PATCH] D158925: [clang-format][NFC] Skip stability test if input is pre-formatted

2023-08-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTestBase.h:88 testing::ScopedTrace t(File, Line, ::testing::Message() << Code.str()); -EXPECT_EQ(Expected.str(), - format(Expected, Style, SC_ExpectComplete, Ranges)) -<< "Expect

[PATCH] D158925: [clang-format][NFC] Skip stability test if input is pre-formatted

2023-08-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. This shortens the run-time of `FormatTests` by about 10% on average

[PATCH] D158795: Fix AlignArrayOfStructures + Cpp11BracedListStyle=false

2023-08-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:1247 if (Previous && Previous->isNot(TT_LineComment)) { - Changes[Next->Index].Spaces = 0; + Changes[Next->Index].Spaces = BracePadding; Changes[Next->Index].Ne

[PATCH] D158805: [clang-format][NFC] Remove extraneous newlines at end of test cases

2023-08-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked an inline comment as done. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:24187 // Newlines are important here. + verifyFormat("FOO(1+2 )", Style); HazardyKnusperkeks wrote: > This. Good catch! Though `verify

[PATCH] D158795: Fix AlignArrayOfStructures + Cpp11BracedListStyle=false

2023-08-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. > I'm not exactly sure why this function needs to override the Spaces as it > seems to generally already be set to either 0 or 1 according to the other > formatting settings If so, can we address the issue without the "explicit fix"? Comment at: clan

[PATCH] D154093: [clang-format] Break long string literals in C#, etc.

2023-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D154093#4615948 , @sstwcw wrote: > In the JavaScript tests that I added, it was wrong to use `SmallString`. > Would you prefer me changing it to `string` or expanding the 6 test cases so > we don't need a variable for the st

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

2023-08-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 rG0e63f1aacc00: [clang-format] Annotate constructor/destructor names (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2023-08-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 rG91c4db00612b: [clang-format][NFC] Replace !is() with isNot() (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2023-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 553032. owenpan added a comment. Rebased to 825cec2 and ran `git-clang-format`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158571/new/ https://reviews.llvm.org/D158571 Files

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

2023-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:389 auto *ClosingLine = AnnotatedLines.begin() + ClosingLineIndex + 1; - auto OutdentBy = I[

[PATCH] D154093: [clang-format] Break long string literals in C#, etc.

2023-08-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @sstwcw this patch caused a crash in `FormatTestJS.StringLiteralConcatenation`: Assertion failed: ((!RequiresNullTerminator || BufEnd[0] == 0) && "Buffer is not null terminated!"), function init, file MemoryBuffer.cpp, line 54. Can you revert it if you can reproduce t

[PATCH] D158697: [clang-format][doc] Correct typos

2023-08-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. This revision is now accepted and ready to land. Comment at: clang/docs/ClangFormatStyleOptions.rst:5129 * ``bool AfterControlStatements`` If ``true``, put space between control statement keywords (for/if/w

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

2023-08-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan requested changes to this revision. owenpan added a comment. This revision now requires changes to proceed. It seems that you forgot to update the diff? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158363/new/ https://reviews.llvm.org/D158

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

2023-08-23 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd06b92391513: [clang-format] Fix a bug that wraps before function arguments (authored by jp4a50, committed by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

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

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

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

2023-08-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Format/FormatTest.cpp:7954 + verifyFormat( + "Class::Class(int some, int arguments, int loonoog,\n" + "

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

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

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

2023-08-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D15

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

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

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

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

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

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

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

2023-08-17 Thread Owen Pan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe3a79503a30f: [clang-format] Exclude kw_decltype in RemoveParentheses (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LA

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

2023-08-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. >From https://en.cppreference.com/w/cpp/language/decltype: Note tha

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

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

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

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

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

2023-08-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D15

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

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

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

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

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

2023-08-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Annotate constructor/destructor names as `FunctionDeclarationName`.

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

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

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

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

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

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

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

2023-08-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Fixes https://github.com/llvm/llvm-project/issues/63795. Reposito

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

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

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

2023-08-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Fixes https://github.com/llvm/llvm-project/issues/63882. Reposito

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

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

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

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

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

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

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

2023-08-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay. owenpan requested review of this revision. Fixes https://github.com/llvm/llvm-project/issues/63519. Reposito

  1   2   3   4   5   6   7   8   9   10   >