diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-12 22:48:25 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-12 22:48:25 +0000 |
commit | 135aa60c613bdcc0e8e237b12bf93cab04284419 (patch) | |
tree | 477b413758618079be5d00b30c630b5641004603 /lib/ARCMigrate | |
parent | 9b629fcb8b2606886ed30630f8a896a8bf606518 (diff) |
[objc] For the ARC error that is emitted when a synthesized property implementation
has inconsistent ownership with the backing ivar, point the error location to the
ivar.
Pointing to the ivar (instead of the @synthesize) is better since this is where a fix is needed.
Also provide the location of @synthesize via a note.
This also fixes the problem where an auto-synthesized property would emit an error without
any location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170039 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate')
-rw-r--r-- | lib/ARCMigrate/TransProperties.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/ARCMigrate/TransProperties.cpp b/lib/ARCMigrate/TransProperties.cpp index bf64831309..7196a54efc 100644 --- a/lib/ARCMigrate/TransProperties.cpp +++ b/lib/ARCMigrate/TransProperties.cpp @@ -226,8 +226,10 @@ private: for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) { if (I->ImplD) - Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership, - I->ImplD->getLocation()); + Pass.TA.clearDiagnostic(diag::err_arc_strong_property_ownership, + diag::err_arc_assign_property_ownership, + diag::err_arc_inconsistent_property_ownership, + I->IvarD->getLocation()); } } @@ -253,8 +255,10 @@ private: } } if (I->ImplD) - Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership, - I->ImplD->getLocation()); + Pass.TA.clearDiagnostic(diag::err_arc_strong_property_ownership, + diag::err_arc_assign_property_ownership, + diag::err_arc_inconsistent_property_ownership, + I->IvarD->getLocation()); } } @@ -276,8 +280,10 @@ private: canUseWeak ? "__weak " : "__unsafe_unretained "); } if (I->ImplD) { - Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership, - I->ImplD->getLocation()); + Pass.TA.clearDiagnostic(diag::err_arc_strong_property_ownership, + diag::err_arc_assign_property_ownership, + diag::err_arc_inconsistent_property_ownership, + I->IvarD->getLocation()); Pass.TA.clearDiagnostic( diag::err_arc_objc_property_default_assign_on_object, I->ImplD->getLocation()); |