[PATCH] D68887: Copy the Ranges field from the Diagnostic when creating the ClangTidyError

Joe Turner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 11 13:25:39 PDT 2019


compositeprimes created this revision.
compositeprimes added a reviewer: clang-tools-extra.
compositeprimes added a project: clang-tools-extra.
Herald added subscribers: cfe-commits, mgehre.
Herald added a project: clang.

Part 2 of the change:
The goal is instead of dropping all the ranges associated with a Diagnostic when converting them to a ClangTidy error, instead attach them to the ClangTidyError, so they can be consumed by other APIs.

I could move this to the ClangTidyError class itself, but I thought it could be useful here, as Diagnostic could use a concept of ranges not associated with a FixIt


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D68887

Files:
  clang-tidy/ClangTidyDiagnosticConsumer.cpp


Index: clang-tidy/ClangTidyDiagnosticConsumer.cpp
===================================================================
--- clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -61,6 +61,7 @@
     }
     assert(Error.Message.Message.empty() && "Overwriting a diagnostic message");
     Error.Message = TidyMessage;
+    Error.Ranges = Ranges;
   }
 
   void emitDiagnosticLoc(FullSourceLoc Loc, PresumedLoc PLoc,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68887.224669.patch
Type: text/x-patch
Size: 451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191011/52349551/attachment-0001.bin>


More information about the cfe-commits mailing list