[PATCH] Implements a way to retrieve information about whether some lines werenot formatted due to syntax errors.

Manuel Klimek klimek at google.com
Thu May 7 05:28:44 PDT 2015


================
Comment at: lib/Format/UnwrappedLineFormatter.cpp:479
@@ -478,1 +478,3 @@
     }
+    if (TheLine.Type == LT_Invalid && ShouldFormat && IncompleteFormat) {
+      *IncompleteFormat = true;
----------------
djasper wrote:
> No braces.
Done.

================
Comment at: unittests/Format/FormatTest.cpp:25-27
@@ +24,5 @@
+  enum IncompleteCheck {
+    IFA_ExpectComplete,
+    IFA_ExpectIncomplete,
+    IFA_DoNotCheck
+  };
----------------
djasper wrote:
> IFA?
Done.

================
Comment at: unittests/Format/FormatTest.cpp:40
@@ +39,3 @@
+    if (CheckIncomplete != IFA_DoNotCheck)
+      EXPECT_EQ(CheckIncomplete == IFA_ExpectIncomplete, IncompleteFormat)
+          << Code << "\n\n";
----------------
djasper wrote:
> I suspect that this looks a bit complicated in the test output when it actually triggers. Might be better to pull out the comparison into a local variable.
Done.

http://reviews.llvm.org/D9532

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list