<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 2, 2008, at 12:48 PM, Daniel Dunbar wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Two comments:<br><br>(1) I think this is a typo:<br> +    DefineBuiltinMacro(Buf, "__block=__attribute__((__<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">blocks__(byref)))");</blockquote> <div><br></div></div></blockquote><div><br></div>It's not a typo, but it is a bug:-) __byref is deprecated and clang doesn't need to support it. I will remove it (thanks).</div><div><br><blockquote type="cite"><div dir="ltr"><div>(2) Should we really be defining the attributes to nothing when<br>block support is not enabled? This may break working code which<br>uses those names.<br></div><br></div></blockquote><div><br></div><div>I am following the GCC "lead" here. I thought it was odd as well.</div><div><br></div><div>Variables names with __ preceding them are less likely to break code.</div><div><br></div><div>I will discuss with Fariborz...</div><div><br></div><div>snaroff</div><div><br></div><blockquote type="cite"><div dir="ltr"> - Daniel<br><br><div class="gmail_quote">On Tue, Sep 2, 2008 at 8:20 AM, Steve Naroff <span dir="ltr"><<a href="mailto:snaroff@apple.com">snaroff@apple.com</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Author: snaroff<br> Date: Tue Sep  2 10:20:19 2008<br> New Revision: 55635<br> <br> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=55635&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=55635&view=rev</a><br> Log:<br> Implement block pseudo-storage class modifiers (__block, __byref).<br> <br> Added:<br>    cfe/trunk/test/Parser/block-block-storageclass.c<br> Modified:<br>    cfe/trunk/lib/Lex/Preprocessor.cpp<br> <br> Modified: cfe/trunk/lib/Lex/Preprocessor.cpp<br> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=55635&r1=55634&r2=55635&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=55635&r1=55634&r2=55635&view=diff</a><br> <br> ==============================================================================<br> --- cfe/trunk/lib/Lex/Preprocessor.cpp (original)<br> +++ cfe/trunk/lib/Lex/Preprocessor.cpp Tue Sep  2 10:20:19 2008<br> @@ -476,6 +476,13 @@<br>     DefineBuiltinMacro(Buf, "__int64=long long");<br>     DefineBuiltinMacro(Buf, "__declspec(X)=");<br>   }<br> +  if (PP.getLangOptions().Blocks) {<br> +    DefineBuiltinMacro(Buf, "__byref=__attribute__((__blocks__(byref)))");<br> +    DefineBuiltinMacro(Buf, "__block=__attribute__((__blocks__(byref)))");<br> +  } else {<br> +    DefineBuiltinMacro(Buf, "__byref=");<br> +    DefineBuiltinMacro(Buf, "__block=");<br> +  }<br>   // FIXME: Should emit a #line directive here.<br>  }<br> <br> <br> Added: cfe/trunk/test/Parser/block-block-storageclass.c<br> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/block-block-storageclass.c?rev=55635&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/block-block-storageclass.c?rev=55635&view=auto</a><br> <br> ==============================================================================<br> --- cfe/trunk/test/Parser/block-block-storageclass.c (added)<br> +++ cfe/trunk/test/Parser/block-block-storageclass.c Tue Sep  2 10:20:19 2008<br> @@ -0,0 +1,18 @@<br> +// RUN: clang -fsyntax-only -verify -parse-noop %s<br> +<br> +#include <stdio.h><br> +void _Block_byref_release(void*src){}<br> +<br> +int main() {<br> +   __block  int X = 1234;<br> +   __block  const char * message = "HELLO";<br> +<br> +   X = X - 1234;<br> +<br> +   X += 1;<br> +<br> +   printf ("%s(%d)\n", message, X);<br> +   X -= 1;<br> +<br> +   return X;<br> +}<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> </blockquote></div><br></div></blockquote></div><br></body></html>