diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-12-16 22:54:37 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-12-16 22:54:37 +0000 |
commit | 381edf5759d163eb1fb0517891b60379543ec4f0 (patch) | |
tree | 924e0d88e335be090d6c704da1c43e2c88ea4dfd /clang/lib/Sema/SemaExpr.cpp | |
parent | 04c685b5e4da7c86d8336a41f9e4cf1ab9a96795 (diff) | |
download | bcm5719-llvm-381edf5759d163eb1fb0517891b60379543ec4f0.tar.gz bcm5719-llvm-381edf5759d163eb1fb0517891b60379543ec4f0.zip |
ObjectiveC. Further improvements of use
of objc_bridge_related attribute; eliminate
unnecessary diagnostics which is issued elsewhere,
fixit now produces a valid AST tree per convention.
This results in some simplification in handling of
this attribute as well. // rdar://15499111
llvm-svn: 197436
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index d1e3c1f41e2..e4a6102b067 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -6612,6 +6612,13 @@ Sema::CheckSingleAssignmentConstraints(QualType LHSType, ExprResult &RHS, if (getLangOpts().ObjCAutoRefCount) CheckObjCARCConversion(SourceRange(), Ty, E, CCK_ImplicitConversion, DiagnoseCFAudited); + if (getLangOpts().ObjC1 && + CheckObjCBridgeRelatedConversions(E->getLocStart(), + LHSType, E->getType(), E)) { + RHS = Owned(E); + return Compatible; + } + RHS = ImpCastExprToType(E, Ty, Kind); } return result; @@ -10648,9 +10655,6 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy, MayHaveConvFixit = true; break; case IncompatiblePointer: - if (getLangOpts().ObjC1 && - CheckObjCBridgeRelatedConversions(Loc, DstType, SrcType, SrcExpr)) - return false; MakeObjCStringLiteralFixItHint(*this, DstType, SrcExpr, Hint, IsNSString); DiagKind = (Action == AA_Passing_CFAudited ? @@ -10730,9 +10734,6 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy, DiagKind = diag::err_arc_weak_unavailable_assign; break; case Incompatible: - if (getLangOpts().ObjC1 && - CheckObjCBridgeRelatedConversions(Loc, DstType, SrcType, SrcExpr)) - return true; DiagKind = diag::err_typecheck_convert_incompatible; ConvHints.tryToFixConversion(SrcExpr, SrcType, DstType, *this); MayHaveConvFixit = true; |