diff options
author | Alp Toker <alp@nuanti.com> | 2014-07-02 17:08:00 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-07-02 17:08:00 +0000 |
commit | 3cb5e19adf10673769111bae06cdb0b27b5a46cb (patch) | |
tree | e74f5a557c67eb50e0d4c0d716692011414a5b2f /lib/ARCMigrate/TransformActions.cpp | |
parent | 5129a09a42cde8dfa8c490a1b8dd289a4bb93b23 (diff) |
ARCMigrate: simplify diagnostic handling
Recent enhancements in the diagnostics engine mean that
TransformActions::report() no longer needs to duplicate this suppression logic.
That's great because the old code was flawed and would have attached notes to
the wrong primary diagnostic in non-trivial use.
With these changes it becomes safe to use reportNote() freely in the migration
tool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate/TransformActions.cpp')
-rw-r--r-- | lib/ARCMigrate/TransformActions.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/ARCMigrate/TransformActions.cpp b/lib/ARCMigrate/TransformActions.cpp index e6268a1792..6d178bea09 100644 --- a/lib/ARCMigrate/TransformActions.cpp +++ b/lib/ARCMigrate/TransformActions.cpp @@ -601,7 +601,7 @@ TransformActions::RewriteReceiver::~RewriteReceiver() { } TransformActions::TransformActions(DiagnosticsEngine &diag, CapturedDiagList &capturedDiags, ASTContext &ctx, Preprocessor &PP) - : Diags(diag), CapturedDiags(capturedDiags), ReportedErrors(false) { + : Diags(diag), CapturedDiags(capturedDiags) { Impl = new TransformActionsImpl(capturedDiags, ctx, PP); } @@ -677,17 +677,6 @@ DiagnosticBuilder TransformActions::report(SourceLocation loc, unsigned diagId, SourceRange range) { assert(!static_cast<TransformActionsImpl *>(Impl)->isInTransaction() && "Errors should be emitted out of a transaction"); - - SourceManager &SM = static_cast<TransformActionsImpl *>(Impl) - ->getASTContext() - .getSourceManager(); - DiagnosticsEngine::Level L = Diags.getDiagnosticLevel(diagId, loc); - // TODO: Move this check to the caller to ensure consistent note attachments. - if (L == DiagnosticsEngine::Ignored || - SM.isInSystemHeader(SM.getExpansionLoc(loc))) - return DiagnosticBuilder::getEmpty(); - if (L >= DiagnosticsEngine::Error) - ReportedErrors = true; return Diags.Report(loc, diagId) << range; } |