This builds on D59407 to provide YAML and RIFF serialization support.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tools-extra/clangd/index/Serialization.cpp | ||
---|---|---|
29 ↗ | (On Diff #201431) | no need for errors, use llvm_unreachable instead. |
45 ↗ | (On Diff #201431) | same for error |
79 ↗ | (On Diff #201431) | I believe reader should not care about the high level representation of data. therefore error state should be internal and only set if the low level read has failed. high level reads are out of Readers scope and should be propagated by the caller. |
394 ↗ | (On Diff #201431) | could you also add a comment saying, we might prefer a packed representation if need arises in future? |
clang-tools-extra/clangd/index/Serialization.h | ||
81 ↗ | (On Diff #201431) | why not start from zero? Also let's change the index::SymbolRole in Relation with this one. |
81 ↗ | (On Diff #201431) | why not just store baseof ? do we need both directions for typehierarchy? |
clang-tools-extra/clangd/unittests/SerializationTests.cpp | ||
225 ↗ | (On Diff #201431) | let's incorporate these data into existing yaml string at top of the file, I believe you just need to add `--- !Relations``` section |
clang-tools-extra/clangd/index/Serialization.h | ||
---|---|---|
81 ↗ | (On Diff #201431) |
You previously asked for the opposite change in this comment :) Did your opinion change? |
Addressed most review comments
clang-tools-extra/clangd/index/Serialization.h | ||
---|---|---|
81 ↗ | (On Diff #201431) |
The original motivation was so that we had a distinct value to return in case of an error. However, now that we use llvm_unreachable that doesn't seem to be necessary any more. |
81 ↗ | (On Diff #201431) |
In the future, we may want to be able to look up supertypes in the index as well (for example, to handle scenarios where a type that is only forward-declared in the current TU is queried). However, we can add that later, and just focus on subtypes for now, which only require BaseOf. |
LG, thanks for the patch!
clang-tools-extra/clangd/index/Serialization.cpp | ||
---|---|---|
34 ↗ | (On Diff #202370) | nit: no need for braces |
44 ↗ | (On Diff #202370) | nit: braces |
clang-tools-extra/clangd/index/Serialization.h | ||
81 ↗ | (On Diff #201431) | ahaha good catch :D for some reason I thought we were also storing our own struct in Symbol for SmybolInfo but apparently we are not. Just ignore that one. |