[PATCH] D104242: Removes an unused variable and alters a lit test to simplify and avoid a buildbot error

Fred Grim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 14 10:18:04 PDT 2021


feg208 created this revision.
feg208 added reviewers: HazardyKnusperkeks, Bigcheese.
feg208 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104242

Files:
  clang/lib/Format/WhitespaceManager.cpp
  clang/test/Format/struct-array-initializer.cpp


Index: clang/test/Format/struct-array-initializer.cpp
===================================================================
--- clang/test/Format/struct-array-initializer.cpp
+++ clang/test/Format/struct-array-initializer.cpp
@@ -1,9 +1,5 @@
-// RUN: grep -Ev "// *[A-Z-]+:" %s \
-// RUN:   | clang-format -style="{BasedOnStyle: LLVM, AlignArrayOfStructures: Right}" %s \
-// RUN:   | FileCheck -strict-whitespace -check-prefix=CHECK1 %s
-// RUN: grep -Ev "// *[A-Z-]+:" %s \
-// RUN:   | clang-format -style="{BasedOnStyle: LLVM, AlignArrayOfStructures: Left}" %s \
-// RUN:   | FileCheck -strict-whitespace -check-prefix=CHECK2 %s
+// RUN: clang-format -style="{BasedOnStyle: LLVM, AlignArrayOfStructures: Right}" %s | FileCheck -strict-whitespace -check-prefix=CHECK1 %s
+// RUN: clang-format -style="{BasedOnStyle: LLVM, AlignArrayOfStructures: Left}" %s | FileCheck -strict-whitespace -check-prefix=CHECK2 %s
 struct test {
   int a;
   int b;
Index: clang/lib/Format/WhitespaceManager.cpp
===================================================================
--- clang/lib/Format/WhitespaceManager.cpp
+++ clang/lib/Format/WhitespaceManager.cpp
@@ -1068,9 +1068,6 @@
     Changes[CellIter->Index].Spaces = CellDescs.InitialSpaces;
   ++CellIter;
   for (auto i = 1U; i < CellDescs.CellCount; i++, ++CellIter) {
-    unsigned NetWidth = 0U;
-    if (isSplitCell(*CellIter))
-      NetWidth = getNetWidth(Cells.begin(), CellIter, CellDescs.InitialSpaces);
     auto MaxNetWidth = getMaximumNetWidth(
         Cells.begin(), CellIter, CellDescs.InitialSpaces, CellDescs.CellCount);
     auto ThisNetWidth =


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104242.351913.patch
Type: text/x-patch
Size: 1606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210614/acc3e873/attachment.bin>


More information about the cfe-commits mailing list