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
Event Timeline
clang-tools-extra/clang-doc/Serialize.cpp | ||
---|---|---|
357 | You're probably going to want the path in this too, here and below | |
429–430 | 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–53 | 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–45 | Extract this logic into a mapDecl function, since it's repeated so much | |
404 | 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 | ||
---|---|---|
390 | 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. | |
398 | nit: generally try to make comments full sentences | |
429–430 | 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.
Comment here what each of these represents, e.g. the first info contains the relevant information about the declaration, the second records the parent.