<div dir="ltr"><div class="gmail_default" style>I suspected as much .. But one step at a time ;-)..</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 9, 2013 at 6:43 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Jan 9, 2013, at 0:36 , Daniel Jasper <<a href="mailto:djasper@google.com">djasper@google.com</a>> wrote:<br>
<br>
> Author: djasper<br>
> Date: Wed Jan  9 02:36:49 2013<br>
> New Revision: 171959<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=171959&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=171959&view=rev</a><br>
> Log:<br>
> Fix ObjC block declarations.<br>
><br>
> Before: int ( ^ Block1) (int, int) = ^ (int i, int j)<br>
> After:  int (^Block1) (int, int) = ^(int i, int j)<br>
><br>
<br>
</div>Much better, but for the variable I think there's conventionally no space between the name and the parameters (like function pointers).<br>
<br>
int (^Block1)(int, int);<br>
<br>
(reference: <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Blocks/Articles/bxDeclaringCreating.html" target="_blank">https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Blocks/Articles/bxDeclaringCreating.html</a>)<br>

<div class="HOEnZb"><div class="h5"><br>
<br>
> Modified:<br>
>    cfe/trunk/lib/Format/Format.cpp<br>
>    cfe/trunk/test/Index/comment-c-decls.c<br>
>    cfe/trunk/test/Index/format-comment-cdecls.c<br>
>    cfe/trunk/unittests/Format/FormatTest.cpp<br>
><br>
> Modified: cfe/trunk/lib/Format/Format.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=171959&r1=171958&r2=171959&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=171959&r1=171958&r2=171959&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/lib/Format/Format.cpp (original)<br>
> +++ cfe/trunk/lib/Format/Format.cpp Wed Jan  9 02:36:49 2013<br>
> @@ -846,8 +846,9 @@<br>
>     if (Current.Type == TT_Unknown) {<br>
>       if (Current.is(tok::star) || Current.is(tok::amp)) {<br>
>         Current.Type = determineStarAmpUsage(Current, IsRHS);<br>
> -      } else if (Current.is(tok::minus) || Current.is(tok::plus)) {<br>
> -        Current.Type = determinePlusMinusUsage(Current);<br>
> +      } else if (Current.is(tok::minus) || Current.is(tok::plus) ||<br>
> +                 Current.is(tok::caret)) {<br>
> +        Current.Type = determinePlusMinusCaretUsage(Current);<br>
>       } else if (Current.is(tok::minusminus) || Current.is(tok::plusplus)) {<br>
>         Current.Type = determineIncrementUsage(Current);<br>
>       } else if (Current.is(tok::exclaim)) {<br>
> @@ -905,7 +906,7 @@<br>
>     return TT_PointerOrReference;<br>
>   }<br>
><br>
> -  TokenType determinePlusMinusUsage(const AnnotatedToken &Tok) {<br>
> +  TokenType determinePlusMinusCaretUsage(const AnnotatedToken &Tok) {<br>
>     // At the start of the line, +/- specific ObjectiveC method declarations.<br>
>     if (Tok.Parent == NULL)<br>
>       return TT_ObjCMethodSpecifier;<br>
><br>
> Modified: cfe/trunk/test/Index/comment-c-decls.c<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/comment-c-decls.c?rev=171959&r1=171958&r2=171959&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/comment-c-decls.c?rev=171959&r1=171958&r2=171959&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/test/Index/comment-c-decls.c (original)<br>
> +++ cfe/trunk/test/Index/comment-c-decls.c Wed Jan  9 02:36:49 2013<br>
> @@ -95,10 +95,10 @@<br>
>  *\brief block declaration<br>
> */<br>
> int (^Block) (int i, int j);<br>
> -// CHECK: <Declaration>int ( ^ Block) (int, int)</Declaration><br>
> +// CHECK: <Declaration>int (^Block) (int, int)</Declaration><br>
><br>
> /**<br>
>  *\brief block declaration<br>
> */<br>
> int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; };<br>
> -// CHECK: <Declaration>int ( ^ Block1) (int, int) = ^ (int i, int j) {\n}</Declaration><br>
> +// CHECK: <Declaration>int (^Block1) (int, int) = ^(int i, int j) {\n}</Declaration><br>
><br>
> Modified: cfe/trunk/test/Index/format-comment-cdecls.c<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/format-comment-cdecls.c?rev=171959&r1=171958&r2=171959&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/format-comment-cdecls.c?rev=171959&r1=171958&r2=171959&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/test/Index/format-comment-cdecls.c (original)<br>
> +++ cfe/trunk/test/Index/format-comment-cdecls.c Wed Jan  9 02:36:49 2013<br>
> @@ -90,10 +90,10 @@<br>
>  *\brief block declaration<br>
> */<br>
> int (^Block) (int i, int j);<br>
> -// CHECK: <Declaration>int ( ^ Block) (int, int)</Declaration><br>
> +// CHECK: <Declaration>int (^Block) (int, int)</Declaration><br>
><br>
> /**<br>
>  *\brief block declaration<br>
> */<br>
> int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; };<br>
> -// CHECK: <Declaration>int ( ^ Block1) (int, int) = ^ (int i, int j) {\n}</Declaration><br>
> +// CHECK: <Declaration>int (^Block1) (int, int) = ^(int i, int j) {\n}</Declaration><br>
><br>
> Modified: cfe/trunk/unittests/Format/FormatTest.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=171959&r1=171958&r2=171959&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=171959&r1=171958&r2=171959&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/unittests/Format/FormatTest.cpp (original)<br>
> +++ cfe/trunk/unittests/Format/FormatTest.cpp Wed Jan  9 02:36:49 2013<br>
> @@ -1122,6 +1122,11 @@<br>
>           "outRange8:(NSRange) out_range8  outRange9:(NSRange) out_range9;"));<br>
> }<br>
><br>
> +TEST_F(FormatTest, FormatObjCBlocks) {<br>
> +  verifyFormat("int (^Block) (int, int);");<br>
> +  verifyFormat("int (^Block1) (int, int) = ^(int i, int j)");<br>
> +}<br>
> +<br>
> TEST_F(FormatTest, ObjCAt) {<br>
>   verifyFormat("@autoreleasepool");<br>
>   verifyFormat("@catch");<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br>
</div></div></blockquote></div><br></div>