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 | 379b97f2856afebc4fbdfb8bdde2251c046a10a3 (patch) | |
tree | f927fd7be3b5c4ebb73f4a518be6e449598fae9d /clang/lib/ARCMigrate/TransformActions.cpp | |
parent | 292fa1907786cb4b0d11641a5ef34889b012b5b1 (diff) | |
download | bcm5719-llvm-379b97f2856afebc4fbdfb8bdde2251c046a10a3.tar.gz bcm5719-llvm-379b97f2856afebc4fbdfb8bdde2251c046a10a3.zip |
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.
llvm-svn: 212191
Diffstat (limited to 'clang/lib/ARCMigrate/TransformActions.cpp')
-rw-r--r-- | clang/lib/ARCMigrate/TransformActions.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/clang/lib/ARCMigrate/TransformActions.cpp b/clang/lib/ARCMigrate/TransformActions.cpp index e6268a1792b..6d178bea090 100644 --- a/clang/lib/ARCMigrate/TransformActions.cpp +++ b/clang/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; } |