[PATCH] D69782: Summary: 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.
Joe Turner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 18 10:53:28 PST 2020
compositeprimes added a comment.
Sorry about the lack of context on the last upload, this one should have it all
================
Comment at: include/clang/Tooling/Core/Diagnostic.h:62-70
+/// Represents extra source ranges to be associated with a diagnostic.
+struct DiagnosticAssociatedRanges {
+ DiagnosticAssociatedRanges() = default;
+
+ DiagnosticAssociatedRanges(const SourceManager &Sources,
+ ArrayRef<CharSourceRange> SourceRanges);
+
----------------
alexfh wrote:
> Why is this needed? Shouldn't `LLVM_YAML_IS_SEQUENCE_VECTOR` be enough to allow for SmallVector<DiagnosticAssociatedRange, ...> to be yaml serializable? Seems to work with `DiagnosticMessage` and `Diagnostic::Notes`.
Yeah, you're right it's not really needed. I had been trying to make it easier to convert a vector<CharSourceRange> to vector<AssociatedRange>, but it's really not that hard as is.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69782/new/
https://reviews.llvm.org/D69782
More information about the cfe-commits
mailing list