[clang-doc] Fix link generation
authorDiego Astiazaran <diegoaat97@gmail.com>
Tue, 6 Aug 2019 00:11:34 +0000 (00:11 +0000)
committerDiego Astiazaran <diegoaat97@gmail.com>
Tue, 6 Aug 2019 00:11:34 +0000 (00:11 +0000)
commit15e468e0d5b7c7ac64a387513c9c9115d8875ef8
tree205f3c36056f75510738093fc6b3bd6819f2e7d6
parentb31f60b9c2e7cc452d9600e1014d42822a2cd7c6
[clang-doc] Fix link generation

Before making a link to a reference it is required to check that the
reference has a path (eg. primitives won't have paths).
This was done by checking if the path was empty; that worked because
when generating paths the outdirectory was included, so if the path was
assigned it had that outdirectory at least.
The path generation was changed, it's now only the composite of the
namespaces without the outdirectory. So if the info is in the global
namespace the path would be empty and the old check wouldn't work as expected.
A new attribute has been added to the Reference struct that indicates if
the info's parent is the global namespace.
Paths generation now fails if the path is empty and if the info
is not in the global namespace.

Differential Revision: https://reviews.llvm.org/D64958

llvm-svn: 367958
clang-tools-extra/clang-doc/BitcodeReader.cpp
clang-tools-extra/clang-doc/BitcodeWriter.cpp
clang-tools-extra/clang-doc/BitcodeWriter.h
clang-tools-extra/clang-doc/HTMLGenerator.cpp
clang-tools-extra/clang-doc/Representation.h
clang-tools-extra/clang-doc/YAMLGenerator.cpp
clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp