Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
include/clang/Tooling/DiagnosticsYaml.h | ||
---|---|---|
75 ↗ | (On Diff #227644) | We should serialize the ranges too. |
Updated to serialize the ranges in yaml. This required making a few abstractions around the representation of CharSourceRange.
Thanks for the update!
Please upload patches with full context. That makes navigating the code much easier during reviews. See https://llvm.org/docs/Phabricator.html
A few more comments inline.
include/clang/Tooling/Core/Diagnostic.h | ||
---|---|---|
62–70 ↗ | (On Diff #244737) | 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. |
lib/Tooling/Core/Diagnostic.cpp | ||
51 ↗ | (On Diff #244737) | With emplace_back constructor parameters can be used directly: Ranges.emplace_back(Sources, Range); That's the whole point of emplace_back. |
Sorry about the lack of context on the last upload, this one should have it all
include/clang/Tooling/Core/Diagnostic.h | ||
---|---|---|
62–70 ↗ | (On Diff #244737) | 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. |
include/clang/Tooling/Core/Diagnostic.h | ||
---|---|---|
51 ↗ | (On Diff #245207) | This comment was lost by Phabricator (or I just wanted to leave it without actually doing it?). The name assumes a specific usage. I'd try to make it more generic in case there's another use case for the struct, for example: ByteRange (as opposed to TextRange, which would be {start line, start column, end line, end column}) or FileByteRange (if we want to stress that it contains a file name). |
Added tests for Yaml serialization
include/clang/Tooling/Core/Diagnostic.h | ||
---|---|---|
51 ↗ | (On Diff #245207) | Ah good idea, I like that name, Done |
LG. Thanks!
Do you have commit rights or should someone help you committing the patch?
I don't have commit rights (this is my first llvm commit!), so could someone help out? Thanks!
Fixed include paths and a broken test and committed as b26c88e3c6e08f8f78ab4291bc85b5685241f493.