This is an archive of the discontinued LLVM Phabricator instance.

[Doxygen] Ignore llvm::Expected<T> forward decl so doxgen recommends right header file
AbandonedPublic

Authored by abrachet on Jul 6 2019, 12:42 AM.

Details

Summary

The documentation for llvm::Expected currently suggests that the header file for Expected is Support/CachePruning.h, this is wrong, adding \cond and \endcond forces doxygen to ignore this forward declaration. This does work, and the outputted documentation correctly recommends Support/Error.h, but it is also an ugly addition we shouldn't have to make. This is kind of an unwinnable battle.

Diff Detail

Event Timeline

abrachet created this revision.Jul 6 2019, 12:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2019, 12:42 AM

I don't really know anything about Doxygen, so I don't know if I can really review this issue. However, it seems to me like this isn't a good method, because it's likely only one "bad" place, and we'd have to litter everywhere with these @cond expressions, when in fact it's Doxygen picking a declaration rather than a definition of a class that's the problem.

abrachet abandoned this revision.Jul 8 2019, 1:46 AM

I agree. I looked if doxygen had any flags to ignore forward declarations, it seems like there isn’t. It’s certainly true that if it can’t be done on doxygens end it would be impossible for us to track all of these down, and as you mention super ugly for the code base. I’ve even seen it get tripped up on friend declarations!

I’m hopeful clang-doc won’t have these issues :)