[PATCH] D153205: [clang-format] Add new block type ListInit

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 20 08:33:28 PDT 2023


MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/FormatToken.cpp:79
 bool FormatToken::opensBlockOrBlockTypeList(const FormatStyle &Style) const {
+  auto bk = getBlockKind();
   // C# Does not indent object initialisers as continuations.
----------------
HazardyKnusperkeks wrote:
> 
why pull this out? if you are worried about speed now you do it EVERY time whereas before we wouldn't do it unless limited conditions, for me I'd get rid of bk and just use getBlockKind() directly everytime, the compiler should I hope optimise it away


================
Comment at: clang/unittests/Format/FormatTest.cpp:25625
+               "    SomeArrayT{},\n"
+               "}\n",
+               Style);
----------------
should there be a semi colon here?


================
Comment at: clang/unittests/Format/FormatTest.cpp:25642
+               "    {baz},\n"
+               "}\n",
+               Style);
----------------
should there be a semi colon here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153205



More information about the cfe-commits mailing list