[cfe-commits] r172307 - /cfe/trunk/lib/Format/Format.cpp

Dmitri Gribenko gribozavr at gmail.com
Sat Jan 12 05:29:16 PST 2013


On Sat, Jan 12, 2013 at 9:05 AM, Nico Weber <nicolasweber at gmx.de> wrote:
> Author: nico
> Date: Sat Jan 12 01:05:25 2013
> New Revision: 172307
>
> URL: http://llvm.org/viewvc/llvm-project?rev=172307&view=rev
> Log:
> Formatter: Remove an always-false condition.
>
> canBreakBefore() does not allow breaking after ':' for LT_ObjCMethodDecl lines,
> so if Newline is true in addTokenToState() for ':' then LT_ObjCMethodDecl
> cannot be set. No functionality change.
>
>
> Modified:
>     cfe/trunk/lib/Format/Format.cpp
>
> Modified: cfe/trunk/lib/Format/Format.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=172307&r1=172306&r2=172307&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Format/Format.cpp (original)
> +++ cfe/trunk/lib/Format/Format.cpp Sat Jan 12 01:05:25 2013
> @@ -386,8 +386,7 @@
>        }
>
>        State.Stack[ParenLevel].LastSpace = State.Column;
> -      if (Current.is(tok::colon) && CurrentLineType != LT_ObjCMethodDecl &&
> -          State.NextToken->Type != TT_ConditionalExpr)
> +      if (Current.is(tok::colon) && State.NextToken->Type != TT_ConditionalExpr)
>          State.Stack[ParenLevel].Indent += 2;
>      } else {
>        if (Current.is(tok::equal) && RootToken.is(tok::kw_for))

Hello Nico,

Seems like CurrentLineType is unused now:

llvm/tools/clang/lib/Format/Format.cpp:590:18: warning: private field
'CurrentLineType' is not used [-Wunused-private-field]
  const LineType CurrentLineType;
                 ^

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list