owenpan added inline comments.

================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:398-400
+      if (Tok && Tok->is(tok::kw_typedef))
+        Tok = Tok->getNextNonComment();
+      if (Tok && Tok->isOneOf(tok::kw_class, tok::kw_struct)) {
----------------
Nits:
- It's unnecessary to add the checking for a null `TheLine->First` on line 398 
since `TheLine->Last` is nonnull.
- The suggested `assert` is optional.
- Since the first token is `typedef` and the last `{`, checking for a null 
`Tok` on line 400 is unnecessary.


================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:404
                        !Style.BraceWrapping.SplitEmptyRecord);
+      } else if (Tok && Tok->is(tok::kw_enum)) {
+        ShouldMerge = Style.AllowShortEnumsOnASingleLine;
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116188

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to