[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
Sun Nov 13 18:33:45 PST 2022


owenpan added a comment.

I think we are close to the finishing line. Can you revisit the change to the formatter and clean it up? For example, casting `PPLevel` to `unsigned` is redundant now. IMO you can simply the change too.



================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:63
     skipLine(Line, /*UnknownIndent=*/true);
-    if (Line.InPPDirective ||
-        (Style.IndentPPDirectives == FormatStyle::PPDIS_BeforeHash &&
-         Line.Type == LT_CommentAbovePPDirective)) {
-      unsigned IndentWidth =
+    if (Style.IndentPPDirectives != FormatStyle::PPDIS_None &&
+        (Line.InPPDirective ||
----------------
You don't need to add this condition.


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