Serialization of child namespaces and records is now handled.
Namespaces can have child records and child namespaces.
Records can only have child records.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tools-extra/clang-doc/Serialize.cpp | ||
---|---|---|
341 ↗ | (On Diff #206974) | You're probably going to want the path in this too, here and below |
398 ↗ | (On Diff #206974) | Maybe return the parent in the second position, and then comment about how the info itself is wrapped in its parent scope? That would make more sense logically, and they all end up in the same place. Same for methods/enums. |
clang-tools-extra/clang-doc/Serialize.h | ||
30 ↗ | (On Diff #206974) | Comment here what each of these represents, e.g. the first info contains the relevant information about the declaration, the second records the parent. |
clang-tools-extra/unittests/clang-doc/SerializeTest.cpp | ||
41–44 ↗ | (On Diff #206974) | Extract this logic into a mapDecl function, since it's repeated so much |
362 ↗ | (On Diff #206974) | Just use the EmptySID -- the checking function ignores the USRs since they can be system-dependent. Here and below. |
Add comments.
Extract repeated logic into mapDecl function in SerializeTest.cpp
Use EmptySID instead of specific USR in tests.
Use {} instead of {nullptr, nullptr}.
clang-tools-extra/clang-doc/Serialize.cpp | ||
---|---|---|
366 ↗ | (On Diff #207126) | Can you make this a switch statement, doing the appropriate things for IT_record and IT_namespace and using llvm_unreachable("Invalid reference type") for all other possible values? This will help prevent silent regressions down the line. |
374 ↗ | (On Diff #207126) | nit: generally try to make comments full sentences |
398 ↗ | (On Diff #207126) | nit: spelling, here and below |
Change an if statement for a switch statement in emitInfo(const RecordDecl *D, ...), it now handles correctly unexpected info types.
Fix spelling in comments.