[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 23 02:37:08 PDT 2020


MyDeveloperDay marked an inline comment as done.
MyDeveloperDay added a comment.

I'm generally in agreement but I think we should let some others comment



================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:652
+      (Current.isNot(TT_LineComment) ||
+       Previous.getBlockKind() == BK_BracedInit)) {
     State.Stack.back().Indent = State.Column + Spaces;
----------------
I think this is better in that its now easier perhaps to see when the block kind gets checked:

I wonder if it would read even better as if we added `is(BraceBlockKind)`   `isNot(BraceBlockKind)` 

e.g.

`Previous.is(BK_BraceInit)`


================
Comment at: clang/lib/Format/FormatToken.h:151
+        BlockKind(BK_Unknown), Type(TT_Unknown), Decision(FD_Unformatted),
+        PackingKind(PPK_Inconclusive) {}
 
----------------
I much prefer putting the initialization here, I think it makes it MUCH clearer


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84306/new/

https://reviews.llvm.org/D84306





More information about the cfe-commits mailing list