From 379b97f2856afebc4fbdfb8bdde2251c046a10a3 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Wed, 2 Jul 2014 17:08:00 +0000 Subject: 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 --- clang/lib/ARCMigrate/TransformActions.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'clang/lib/ARCMigrate/TransformActions.cpp') 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(Impl)->isInTransaction() && "Errors should be emitted out of a transaction"); - - SourceManager &SM = static_cast(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; } -- cgit v1.2.3