[PATCH] D65003: [clang-doc] Add index in each info html file

Jake Ehrlich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 2 15:03:18 PDT 2019

jakehehrlich added a comment.

I think everything but the implementation of `genIndex` being confusing looks good to me. I haven't actually groked how that code works yet other than the fact that it generates the index tree that I expect and all the surrounding code looks good to me. I understand that some of the trickiness here comes from the fact that you're building from a list of values but trying to generate the tree structure from that list which is hard. I think we can structure that code better; lets see if we can't device a better algorithm.

Comment at: clang-tools-extra/clang-doc/Generators.cpp:16
+Index Generator::genIndex(const std::vector<std::unique_ptr<Info>> &Infos) {
+  Index Idx;
Please document this function with more internal comments. I have no idea what's going on here and the shifting of 'I' is super confusing to me.

Comment at: clang-tools-extra/clang-doc/Generators.cpp:20
+    Index *I = &Idx;
+    for (auto R = Info->Namespace.rbegin(), E = Info->Namespace.rend(); R != E;
+         ++R) {
Use llvm::reverse https://llvm.org/doxygen/STLExtras_8h.html



More information about the cfe-commits mailing list