[cfe-commits] r133295 - in /cfe/trunk: include/clang/Basic/TokenKinds.def lib/Basic/Targets.cpp lib/Parse/ParseExpr.cpp test/SemaObjC/arc-bridged-cast.m
Douglas Gregor
dgregor at apple.com
Fri Jun 17 14:39:42 PDT 2011
On Jun 17, 2011, at 2:23 PM, John McCall wrote:
> Author: rjmccall
> Date: Fri Jun 17 16:23:37 2011
> New Revision: 133295
>
> URL: http://llvm.org/viewvc/llvm-project?rev=133295&view=rev
> Log:
> As a hopefully temporary workaround for a header mistake, treat
> __bridge_retain as a synonym for __bridge_retained.
I really hate to say it, but… we should probably have a hard error + Fix-It for this mis-spelling, but not emit the error if we're in a system header. Otherwise, this bug is likely to leak into user code and we'll *never* get rid of the wrong spelling.
- Doug
>
> Modified:
> cfe/trunk/include/clang/Basic/TokenKinds.def
> cfe/trunk/lib/Basic/Targets.cpp
> cfe/trunk/lib/Parse/ParseExpr.cpp
> cfe/trunk/test/SemaObjC/arc-bridged-cast.m
>
> Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=133295&r1=133294&r2=133295&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
> +++ cfe/trunk/include/clang/Basic/TokenKinds.def Fri Jun 17 16:23:37 2011
> @@ -426,6 +426,7 @@
> KEYWORD(__bridge , KEYARC)
> KEYWORD(__bridge_transfer , KEYARC)
> KEYWORD(__bridge_retained , KEYARC)
> +KEYWORD(__bridge_retain , KEYARC)
>
> // Alternate spelling for various tokens. There are GCC extensions in all
> // languages, but should not be disabled in strict conformance mode.
>
> Modified: cfe/trunk/lib/Basic/Targets.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=133295&r1=133294&r2=133295&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Fri Jun 17 16:23:37 2011
> @@ -104,6 +104,7 @@
> Builder.defineMacro("__bridge", "");
> Builder.defineMacro("__bridge_transfer", "");
> Builder.defineMacro("__bridge_retained", "");
> + Builder.defineMacro("__bridge_retain", "");
> }
>
> if (Opts.Static)
>
> Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=133295&r1=133294&r2=133295&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
> +++ cfe/trunk/lib/Parse/ParseExpr.cpp Fri Jun 17 16:23:37 2011
> @@ -1780,7 +1780,8 @@
> } else if (ExprType >= CompoundLiteral &&
> (Tok.is(tok::kw___bridge) ||
> Tok.is(tok::kw___bridge_transfer) ||
> - Tok.is(tok::kw___bridge_retained))) {
> + Tok.is(tok::kw___bridge_retained) ||
> + Tok.is(tok::kw___bridge_retain))) { // FIXME: temporary workaround
> // Parse an Objective-C ARC ownership cast expression.
> ObjCBridgeCastKind Kind;
> if (Tok.is(tok::kw___bridge))
>
> Modified: cfe/trunk/test/SemaObjC/arc-bridged-cast.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-bridged-cast.m?rev=133295&r1=133294&r2=133295&view=diff
> ==============================================================================
> --- cfe/trunk/test/SemaObjC/arc-bridged-cast.m (original)
> +++ cfe/trunk/test/SemaObjC/arc-bridged-cast.m Fri Jun 17 16:23:37 2011
> @@ -27,7 +27,10 @@
> CFTypeRef cf1 = (__bridge_retained CFTypeRef)CreateSomething();
> CFStringRef cf2 = (__bridge_retained CFStringRef)CreateNSString();
> CFTypeRef cf3 = (__bridge CFTypeRef)CreateSomething();
> - CFStringRef cf4 = (__bridge CFStringRef)CreateNSString();
> + CFStringRef cf4 = (__bridge CFStringRef)CreateNSString();
> +
> + // rdar://problem/9629566 - temporary workaround
> + CFTypeRef cf5 = (__bridge_retain CFTypeRef)CreateSomething();
> }
>
> void fixits() {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list