]> granicus.if.org Git - clang/commitdiff
As a hopefully temporary workaround for a header mistake, treat
authorJohn McCall <rjmccall@apple.com>
Fri, 17 Jun 2011 21:23:37 +0000 (21:23 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 17 Jun 2011 21:23:37 +0000 (21:23 +0000)
__bridge_retain as a synonym for __bridge_retained.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133295 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/TokenKinds.def
lib/Basic/Targets.cpp
lib/Parse/ParseExpr.cpp
test/SemaObjC/arc-bridged-cast.m

index dd105a169b6cfd513a381702ae86327df7ad4811..86172b83ff42220f51edf161fa7922c1a23945e1 100644 (file)
@@ -426,6 +426,7 @@ KEYWORD(__pixel                     , KEYALTIVEC)
 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.
index 7a062fcd6294d32db1d6992463a9075899d65600..5fcd0d2af9290cff78225dd20d5a004987b34db9 100644 (file)
@@ -104,6 +104,7 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
     Builder.defineMacro("__bridge", "");
     Builder.defineMacro("__bridge_transfer", "");
     Builder.defineMacro("__bridge_retained", "");
+    Builder.defineMacro("__bridge_retain", "");
   }
   
   if (Opts.Static)
index 01bd0ed336e76a4e3a631567dc5ccd5aacabb6ae..14f3805cd9712ca03a9ec53916de9b9b5ec0210c 100644 (file)
@@ -1780,7 +1780,8 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
   } 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))
index 227cce2248fcb8a813a4f5a333ebad48c2c94f1c..d302182476d02ad540a24ffb97c34d14f1038148 100644 (file)
@@ -27,7 +27,10 @@ void to_cf(id obj) {
   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() {