[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] D144170: [clang-format] Add simple macro replacements in formatting.

2023-03-27 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/include/clang/Format/Format.h:4343 + WhitespaceSensitiveMacros == R.WhitespaceSensitiveMacros && + Macros == R.Macros; } I put a lot of effort into bringing the stuff sorted. And n

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

2023-03-23 Thread Manuel Klimek via cfe-commits
I am so sorry, thanks for sending out the patch already and fixing the layout! On Thu, Mar 23, 2023 at 10:08 AM MyDeveloperDay via Phabricator < revi...@reviews.llvm.org> wrote: > MyDeveloperDay added a comment. > > I know this is like "telling my grandmother to suck eggs" but @klimek the > chan

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

2023-03-23 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. I know this is like "telling my grandmother to suck eggs" but @klimek the change here to Format.h means you need to regenerate ClangFormatStyleOptions.rst via docs/tools/dump_format_style.py Impacting the next change to generate - D125171: Add a new clang-format

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

2023-02-24 Thread Manuel Klimek 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 rG01402831aaae: [clang-format] Add simple macro replacements in formatting. (authored by klimek). Repository: rG LLVM Github Monorepo CHANGES SINCE

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

2023-02-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:4592 + !Macros.hasArity(ID->TokenText, Args->size())) { +// The macro is overloaded to be both object-like and function-like, +// but none of the function-like arities matc

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

2023-02-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek updated this revision to Diff 500191. klimek added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144170/new/ https://reviews.llvm.org/D144170 Files: clang/include/clang/Format/Format.h clang/lib/Forma

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

2023-02-24 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Still LG Comment at: clang/lib/Format/MacroExpander.cpp:172 assert(defined(ID->TokenText)); + assert( + (!OptionalArgs && ObjectLike.find(ID->TokenText) != ObjectLike.end()) || klimek wrote: > sammccall wrote: > > this assert

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

2023-02-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: clang/lib/Format/MacroExpander.cpp:172 assert(defined(ID->TokenText)); + assert( + (!OptionalArgs && ObjectLike.find(ID->TokenText) != ObjectLike.end()) || sammccall wrote: > this assertion failure isn't going to

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

2023-02-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek updated this revision to Diff 500181. klimek marked 5 inline comments as done. klimek added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144170/new/ https://reviews.llvm.org/D144170 Files: clang/includ

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

2023-02-24 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Great! The overloading impl is a little surprising to me. I was assuming that object would always win over function (or that it would be disallowed to combine the two). I think that is s

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

2023-02-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:22584 + Style.Macros.push_back("CALL(x)=f([] { x })"); + Style.Macros.push_back("ASSIGN_OR_RETURN(a, b, c)=a = (b) || (c)"); + sammccall wrote: > klimek wrote: > > sammccall wrote:

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

2023-02-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek updated this revision to Diff 500121. klimek marked 6 inline comments as done. klimek added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144170/new/ https://reviews.llvm.org/D144170 Files: clang/includ

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

2023-02-23 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Thanks, this all looks good, at least as far as I understand it! The two-passes-over-the-whole-file approach is easier for me to follow, too. Mostly just comment nits, but I have one annoying question left about using macros with the wrong arity - I thought this was j

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

2023-02-23 Thread Manuel Klimek via Phabricator via cfe-commits
klimek updated this revision to Diff 499777. klimek added a comment. Add comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144170/new/ https://reviews.llvm.org/D144170 Files: clang/include/clang/Format/Format.h clang/lib/Format/Continuati

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

2023-02-23 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:744 + // Align following lines within parenthesis / brackets if configured. + // For a line of macro parents, the commas that follow the opening parenthesis + // in the line come after the ope

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

2023-02-23 Thread Manuel Klimek via Phabricator via cfe-commits
klimek updated this revision to Diff 499771. klimek marked 9 inline comments as done. klimek added a comment. Address reviewer comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144170/new/ https://reviews.llvm.org/D144170 Files: clang/incl

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

2023-02-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. It's happening! Comment at: clang/lib/Format/ContinuationIndenter.cpp:743 + // Align following lines within parenthesis / brackets if configured. + // For a line of macro parents, the commas that follow the opening parenthesis ni

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

2023-02-16 Thread Manuel Klimek via Phabricator via cfe-commits
klimek created this revision. klimek added a reviewer: sammccall. Herald added a project: All. klimek requested review of this revision. Herald added a project: clang. Add configuration to specify macros. Macros will be expanded, and the code will be parsed and annotated in the expanded state. In