diff options
Diffstat (limited to 'lib/ARCMigrate')
-rw-r--r-- | lib/ARCMigrate/ARCMT.cpp | 8 | ||||
-rw-r--r-- | lib/ARCMigrate/TransAPIUses.cpp | 4 | ||||
-rw-r--r-- | lib/ARCMigrate/TransProtectedScope.cpp | 12 | ||||
-rw-r--r-- | lib/ARCMigrate/TransRetainReleaseDealloc.cpp | 4 | ||||
-rw-r--r-- | lib/ARCMigrate/Transforms.h | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp index 72f35205ca..a6d48762fe 100644 --- a/lib/ARCMigrate/ARCMT.cpp +++ b/lib/ARCMigrate/ARCMT.cpp @@ -140,12 +140,6 @@ public: // Non-ARC warnings are ignored. Diags.setLastDiagnosticIgnored(); } - - DiagnosticConsumer *clone(DiagnosticsEngine &Diags) const { - // Just drop any diagnostics that come from cloned consumers; they'll - // have different source managers anyway. - return new IgnoringDiagConsumer(); - } }; } // end anonymous namespace @@ -482,7 +476,7 @@ public: : ARCMTMacroLocs(ARCMTMacroLocs) { } virtual void MacroExpands(const Token &MacroNameTok, const MacroDirective *MD, - SourceRange Range) { + SourceRange Range, const MacroArgs *Args) { if (MacroNameTok.getIdentifierInfo()->getName() == getARCMTMacroName()) ARCMTMacroLocs.push_back(MacroNameTok.getLocation()); } diff --git a/lib/ARCMigrate/TransAPIUses.cpp b/lib/ARCMigrate/TransAPIUses.cpp index 2305b6defd..a0994a6b45 100644 --- a/lib/ARCMigrate/TransAPIUses.cpp +++ b/lib/ARCMigrate/TransAPIUses.cpp @@ -91,12 +91,12 @@ public: E->getSelector() == zoneSel && Pass.TA.hasDiagnostic(diag::err_unavailable, diag::err_unavailable_message, - E->getInstanceReceiver()->getExprLoc())) { + E->getSelectorLoc(0))) { // Calling -zone is meaningless in ARC, change it to nil. Transaction Trans(Pass.TA); Pass.TA.clearDiagnostic(diag::err_unavailable, diag::err_unavailable_message, - E->getInstanceReceiver()->getExprLoc()); + E->getSelectorLoc(0)); Pass.TA.replace(E->getSourceRange(), getNilString(Pass.Ctx)); } return true; diff --git a/lib/ARCMigrate/TransProtectedScope.cpp b/lib/ARCMigrate/TransProtectedScope.cpp index b8b25f2594..237aa42877 100644 --- a/lib/ARCMigrate/TransProtectedScope.cpp +++ b/lib/ARCMigrate/TransProtectedScope.cpp @@ -109,7 +109,12 @@ public: SourceRange BodyRange = BodyCtx.getTopStmt()->getSourceRange(); const CapturedDiagList &DiagList = Pass.getDiags(); - CapturedDiagList::iterator I = DiagList.begin(), E = DiagList.end(); + // Copy the diagnostics so we don't have to worry about invaliding iterators + // from the diagnostic list. + SmallVector<StoredDiagnostic, 16> StoredDiags; + StoredDiags.append(DiagList.begin(), DiagList.end()); + SmallVectorImpl<StoredDiagnostic>::iterator + I = StoredDiags.begin(), E = StoredDiags.end(); while (I != E) { if (I->getID() == diag::err_switch_into_protected_scope && isInRange(I->getLocation(), BodyRange)) { @@ -120,8 +125,9 @@ public: } } - void handleProtectedScopeError(CapturedDiagList::iterator &DiagI, - CapturedDiagList::iterator DiagE) { + void handleProtectedScopeError( + SmallVectorImpl<StoredDiagnostic>::iterator &DiagI, + SmallVectorImpl<StoredDiagnostic>::iterator DiagE){ Transaction Trans(Pass.TA); assert(DiagI->getID() == diag::err_switch_into_protected_scope); SourceLocation ErrLoc = DiagI->getLocation(); diff --git a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp index 0c8d155446..446a284a28 100644 --- a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp +++ b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp @@ -118,7 +118,7 @@ public: return true; case ObjCMessageExpr::SuperInstance: { Transaction Trans(Pass.TA); - clearDiagnostics(E->getSuperLoc()); + clearDiagnostics(E->getSelectorLoc(0)); if (tryRemoving(E)) return true; Pass.TA.replace(E->getSourceRange(), "self"); @@ -132,7 +132,7 @@ public: if (!rec) return true; Transaction Trans(Pass.TA); - clearDiagnostics(rec->getExprLoc()); + clearDiagnostics(E->getSelectorLoc(0)); ObjCMessageExpr *Msg = E; Expr *RecContainer = Msg; diff --git a/lib/ARCMigrate/Transforms.h b/lib/ARCMigrate/Transforms.h index cb7d1535c6..e20fe5927f 100644 --- a/lib/ARCMigrate/Transforms.h +++ b/lib/ARCMigrate/Transforms.h @@ -169,7 +169,7 @@ bool isPlusOne(const Expr *E); /// source location will be invalid. SourceLocation findLocationAfterSemi(SourceLocation loc, ASTContext &Ctx); -/// \brief \arg Loc is the end of a statement range. This returns the location +/// \brief 'Loc' is the end of a statement range. This returns the location /// of the semicolon following the statement. /// If no semicolon is found or the location is inside a macro, the returned /// source location will be invalid. |