[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros
Owen Pan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 2 22:29:50 PDT 2022
owenpan added inline comments.
================
Comment at: clang/unittests/Format/FormatTest.cpp:5056-5059
+ " if (A) { \\\n"
+ " B(); \\\n"
+ " } \\\n"
+ " C();\n"
----------------
goldstein.w.n wrote:
> owenpan wrote:
> > I just noticed that here and below you got an extra `IndentWidth` than in the summary, so the patch only works for `PPDIS_None`?
> To a degree.
>
> `Level` is used by both scope depth and PP depth so nested PP directives with before/after will essentially have `IndentWidth * (PPLevel + ScopeLevel)` as net indentation.
>
> AFAICT `UnwrappedLineParser.cpp::parsePPDefine` needs to something other than `Line->Level` with `PBBranchLevel + 1`.
>
> I started doing that but the diff got a bit bigger given that it needs to get propegated between Wrapper/Unwrapped/Annotated (AFAICT).
>
> Would you prefer its implemented like that?
See D137181#3904383
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137181/new/
https://reviews.llvm.org/D137181
More information about the cfe-commits
mailing list