As a hopefully temporary workaround for a header mistake, treat

__bridge_retain as a synonym for __bridge_retained.

llvm-svn: 133295
This commit is contained in:
John McCall 2011-06-17 21:23:37 +00:00
parent f733f7d730
commit 0c32925aa0
4 changed files with 8 additions and 2 deletions

View 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.

View 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)

View 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))

View 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() {