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,


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,
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to