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

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

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

2023-07-17 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added a comment. I don't see how the failed test cases could be my fault; they deal with the address sanitizer. So maybe some one could please commit this to main using `Sedenion <39583823+sedeni...@users.noreply.github.com>`? Thanks! Repository:

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

2023-07-17 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 541146. Sedeniono marked an inline comment as done. Sedeniono added a comment. Implemented review changes as suggested by @owenpan. If this is finally ok, someone please commit it to main using the following: `Sedenion <39583823+sedeni...@users.noreply.gith

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

2023-07-17 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked 6 inline comments as done. Sedeniono added inline comments. Comment at: clang/unittests/Format/FormatTestSelective.cpp:641-646 + Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Code = "namespace ns {\n" + "#define REF(alias) alias alias

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

2023-07-15 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added inline comments. Comment at: clang/unittests/Format/FormatTestSelective.cpp:664 +"#endif\n" // That this line is also formatted might be a bug. +"}};", // Dito: Bug? +format(" class Foo {\n" -

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

2023-07-15 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 540683. Sedeniono marked 4 inline comments as done. Sedeniono added a comment. Fixed typo in comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151047/new/ https://reviews.llvm.org/D151047 Files: clang

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

2023-07-15 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 540682. Sedeniono added a comment. Implemented review changes suggested by @owenpan. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155094/new/ https://reviews.llvm.org/D155094 Files: clang/lib/Format/Unwra

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

2023-07-15 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked 4 inline comments as done. Sedeniono added inline comments. Comment at: clang/unittests/Format/FormatTestSelective.cpp:641-646 + Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Code = "namespace ns {\n" + "#define REF(alias) alias alias

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

2023-07-12 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 539583. Sedeniono added a comment. @owenpan Oh wow, you are right. Phabricator shows that there are two separate commits, under "Revision Contents" > "Commits", and their commit messages. But apparently there is no way to download some proper *.patch file

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

2023-07-12 Thread Sedenion via Phabricator via cfe-commits
Sedeniono created this revision. Sedeniono added reviewers: owenpan, MyDeveloperDay, HazardyKnusperkeks. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added a reviewer: rymiel. Sedeniono requested review of this revision. - adjustToUnmodifiedLine:

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

2023-07-08 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added a comment. If everyone is ok with the changes, could someone commit it for me since I do not have commit rights? Thanks! `Sedenion <39583823+sedeni...@users.noreply.github.com>` Note: I cannot really make sense of the error reported by the pre merge checks

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

2023-06-26 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 534688. Sedeniono added a comment. As suggested by @owenpan, split the commits differently. My previous statement, that the whole fix consists of a revert of D129064 was not entirely correct: The fix reintroduces the `re

[PATCH] D153228: [clang-format] Fixed bad performance with enabled qualifier fixer.

2023-06-25 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked an inline comment as done. Sedeniono added a comment. In D153228#4446523 , @MyDeveloperDay wrote: > For us to land this for you we'll need your name and email Please use: `Sedenion <39583823+sedeni...@users.noreply.github.com>` Thanks!

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

2023-06-23 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked an inline comment as done. Sedeniono added a comment. @owenpan , @MyDeveloperDay Any opinion on the latest changes? Otherwise, since I do not have commit rights, someone needs to commit the changes to main (my name and mail: `Sedenion <39583823+sedeni...@users.noreply.github.co

[PATCH] D153228: [clang-format] Fixed bad performance with enabled qualifier fixer.

2023-06-23 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked 6 inline comments as done. Sedeniono added inline comments. Comment at: clang/lib/Format/Format.cpp:3476-3477 + + // Regarding the 16: Note that multiple passes are added in + // addQualifierAlignmentFixerPasses(). + SmallVector Passes; Hazard

[PATCH] D153228: [clang-format] Fixed bad performance with enabled qualifier fixer.

2023-06-23 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 534024. Sedeniono added a comment. As suggested by the reviewers, the noop fixes are now filtered only if the qualifier alignment passes are active. Also implemented the other minor refactorings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D153228: [clang-format] Fixed bad performance with enabled qualifier fixer.

2023-06-22 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked an inline comment as done. Sedeniono added inline comments. Comment at: clang/lib/Format/Format.cpp:3571-3585 + // Don't make replacements that replace nothing. This can affect e.g. the + // output of clang-format with the --output-replacements-xml option. + t

[PATCH] D153243: [clang-format] Don't finalize #if, #else, #endif, etc.

2023-06-19 Thread Sedenion via Phabricator via cfe-commits
Sedeniono requested changes to this revision. Sedeniono added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:1416-1421 + if (Tok->is(tok::hash) && !Tok->Previous && Tok->Next && + Tok->Next->is

[PATCH] D153228: [clang-format] Fixed bad performance with enabled qualifier fixer.

2023-06-19 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked 2 inline comments as done. Sedeniono added inline comments. Comment at: clang/lib/Format/Format.cpp:3475 AnalyzerPass; SmallVector Passes; HazardyKnusperkeks wrote: > Just increase here, and add a comment that there are multiple passe

[PATCH] D153228: [clang-format] Fixed bad performance with enabled qualifier fixer.

2023-06-19 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 532721. Sedeniono added a comment. As suggested by HazardyKnusperkeks, increased the number of stack elements and removed the reserve(). That causes all Passes to be stored on the stack. (I counted 17 distinct possible passes, but not all of them can be ac

[PATCH] D153228: [clang-format] Fixed bad performance with enabled qualifier fixer.

2023-06-18 Thread Sedenion via Phabricator via cfe-commits
Sedeniono created this revision. Sedeniono added a reviewer: MyDeveloperDay. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan. Sedeniono requested review of this revision. This fixes github issue #5

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

2023-06-12 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked an inline comment as done. Sedeniono added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:80 + // directive, since these do not terminate a code block. + if (!Line.InPPDirective && Line.Level < IndentForLevel.size()) +I

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

2023-06-12 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 530627. Sedeniono marked an inline comment as done. Sedeniono added a comment. Updated diff: Captured the intention of "going to lower levels" via a debug assert in nextLine(). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

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

2023-06-08 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked an inline comment as done. Sedeniono added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:169-170 /// The indent in characters for each level. + /// It remembers the indent of previous lines (that are not PP directives) of + /// e

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

2023-06-08 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 529631. Sedeniono added a comment. Next try at getting all changes to phabricator. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151047/new/ https://reviews.llvm.org/D151047 Files: clang/lib/Format/Unwrapp

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

2023-06-08 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 529630. Sedeniono added a comment. Reformatted comment, and submitting it via `arc diff --update` now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151047/new/ https://reviews.llvm.org/D151047 Files: clan

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

2023-06-08 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked an inline comment as done. Sedeniono added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:169-170 /// The indent in characters for each level. + /// It remembers the indent of previous lines (that are not PP directives) of + /// e

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

2023-06-08 Thread Sedenion via Phabricator via cfe-commits
Sedeniono marked an inline comment as done. Sedeniono added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:80 + // directive, since these do not terminate a code block. + if (!Line.InPPDirective && Line.Level < IndentForLevel.size()) +I

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

2023-06-08 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 529517. Sedeniono added a comment. Reformatted comment as requested. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151047/new/ https://reviews.llvm.org/D151047 Files: clang/lib/Format/UnwrappedLineFormatter.cpp Index: clang/lib/Format/Unwrapp

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

2023-06-05 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added a comment. @barannikov88 ok, thanks. I just did that. The latest diff looks right. I wondered because phabricator suddenly showed changes in ocaml files, which I certainly did not want. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

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

2023-06-05 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 528547. Sedeniono added a comment. Next try at getting the 2nd attempt into review. This is again the complete fix, since the previous revision got reverted. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1510

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

2023-06-05 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added a comment. Oh damn, I executed `arc diff --update D151047` on the main branch instead of my own local branch... Sorry. Can I somehow revert that? Or should I simply use the "abandon review" action and create a entirely new one? Repository: rG LLVM Github Monorepo CHANGES SIN

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

2023-06-05 Thread Sedenion via Phabricator via cfe-commits
Sedeniono updated this revision to Diff 528531. Sedeniono added a comment. Herald added subscribers: llvm-commits, pcwang-thead. Herald added a project: LLVM. Fixes github issues #59178, #58464 and #62799. The problem was that the LevelIndentTracker remembered the indentation level of pre

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

2023-06-05 Thread Sedenion via Phabricator via cfe-commits
Sedeniono reopened this revision. Sedeniono added a comment. This revision is now accepted and ready to land. Ok, here is the 2nd attempt at fixing the issue. The patch is based on the current main branch. Regarding `LineJoiner::join()`: Turns out, not setting `A.Level` but reverting the origin

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

2023-05-24 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added a comment. Heh, ok, so I wasn't that naive then to not run the tests of everything :-) I had a look at the issue. The ClangRenameTests first do some replacements, and then call formatAndApplyReplacements()

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

2023-05-23 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added a comment. Ok, sorry, the test failures are on me. There is a lesson learned for me: I naively ran only the formatter unit tests, not the whole test suite of llvm. I somehow assumed that my code changes only affected clang-format, since the UnwrappedLineFormatter is in the "Form

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

2023-05-23 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added a comment. @owenpan Here is the name and mail in the <> format: `Sedenion <39583823+sedeni...@users.noreply.github.com>` @HazardyKnusperkeks Ok, I will remember it for the next one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1510

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

2023-05-22 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added a comment. @MyDeveloperDay Thanks for the positive review. Regarding https://github.com/llvm/llvm-project/issues/56352 and the Beyoncé Rule, the original fix for the crash actually added a test (see the changes made at that time

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

2023-05-21 Thread Sedenion via Phabricator via cfe-commits
Sedeniono added a comment. The build failures seem to be unrelated to my changes. The builds of other reviews also show them, and the error messages point to things I haven't changed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151047/new/ http

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

2023-05-21 Thread Sedenion via Phabricator via cfe-commits
Sedeniono created this revision. Sedeniono added a reviewer: curdeius. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. Sedeniono requested review of this revision. Fixes github iss