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

Noah Goldstein via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 14:50:07 PDT 2022


goldstein.w.n 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:
> > 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
> Hmm? What is that suppose to link to?
Err, sorry I see now. Got it.


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