owenpan added a comment.
In D137181#3910404 <https://reviews.llvm.org/D137181#3910404>, @goldstein.w.n
wrote:
> Doesn't that add an arbitrary +1 to the begining of the indentation?
> Shouldn't it be:
>
> // IndentPPDirectives: AfterHash
> #ifdef foo
> # define bar() \\
> if (A) { \\
> B(); \\
> } \\
> C();
> #endif
>
> // IndentPPDirectives: BeforeHash
> #ifdef foo
> #define bar() \\
> if (A) { \\
> B(); \\
> } \\
> C();
> #endif
>
> // IndentPPDirectives: NoneHash
> #ifdef foo
> #define bar() \\
> if (A) { \\
> B(); \\
> } \\
> C();
> #endif
Given the settings used in your example:
PPIndentWidth: 1
IndentWidth: 4
IMO the macro body should be shifted to the right by 1 column (except when
`IndentPPDirectives` is set to `None`). That is, the indent of the macro body
relative to the start of `define` should be the same with any setting of
`IndentPPDirective`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137181/new/
https://reviews.llvm.org/D137181
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits