[cfe-commits] r172306 - in /cfe/trunk: lib/Format/Format.cpp unittests/Format/FormatTest.cpp

Nico Weber nicolasweber at gmx.de
Fri Jan 11 23:00:16 PST 2013


Author: nico
Date: Sat Jan 12 01:00:16 2013
New Revision: 172306

URL: http://llvm.org/viewvc/llvm-project?rev=172306&view=rev
Log:
Formatter: Remove a redundant CurrentLineType check.

The containing if checks for this already. No functionality change.


Modified:
    cfe/trunk/lib/Format/Format.cpp
    cfe/trunk/unittests/Format/FormatTest.cpp

Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=172306&r1=172305&r2=172306&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Sat Jan 12 01:00:16 2013
@@ -1176,8 +1176,8 @@
       if (Right.is(tok::identifier) && !Right.Children.empty() &&
           Right.Children[0].is(tok::colon) && Left.is(tok::identifier))
         return true;
-      if (CurrentLineType == LT_ObjCMethodDecl && Right.is(tok::identifier) &&
-          Left.is(tok::l_paren) && Left.Parent->is(tok::colon))
+      if (Right.is(tok::identifier) && Left.is(tok::l_paren) &&
+          Left.Parent->is(tok::colon))
         // Don't break this identifier as ':' or identifier
         // before it will break.
         return false;

Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=172306&r1=172305&r2=172306&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Sat Jan 12 01:00:16 2013
@@ -1515,7 +1515,6 @@
   verifyFormat("[self stuffWithInt:a ? (e ? f : g) : c];");
   verifyFormat("[cond ? obj1 : obj2 methodWithParam:param]");
   
-
   verifyFormat("arr[[self indexForFoo:a]];");
   verifyFormat("throw [self errorFor:a];");
   verifyFormat("@throw [self errorFor:a];");





More information about the cfe-commits mailing list