From 2c1c9a240776e5ccfb29b8a22bb32bb7e87ac2dd Mon Sep 17 00:00:00 2001
From: Julie Hockett
Date: Fri, 12 Jul 2019 18:32:00 +0000
Subject: [clang-doc] Add html links to references
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
tags are added for the parents and members of records and return type and
params of functions. The link redirects to the reference's info file.
The directory path where each info file will be saved is now generated in the
serialization phase and stored as an attribute in each Info.
Bitcode writer and reader were modified to handle the new attributes.
Committed on behalf of Diego Astiazarán (diegoaat97@gmail.com).
Differential Revision: https://reviews.llvm.org/D63663
llvm-svn: 365937
---
.../unittests/clang-doc/HTMLGeneratorTest.cpp | 28 +++++++++++++---------
1 file changed, 17 insertions(+), 11 deletions(-)
(limited to 'clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp')
diff --git a/clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp b/clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
index fe6bc61..e95ceb8 100644
--- a/clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
+++ b/clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
@@ -57,7 +57,7 @@ TEST(HTMLGeneratorTest, emitNamespaceHTML) {
OneFunction
- OneFunction()
+ OneFunction()
Enums
@@ -73,14 +73,16 @@ TEST(HTMLGeneratorTest, emitNamespaceHTML) {
TEST(HTMLGeneratorTest, emitRecordHTML) {
RecordInfo I;
I.Name = "r";
+ I.Path = "X/Y/Z";
I.Namespace.emplace_back(EmptySID, "A", InfoType::IT_namespace);
I.DefLoc = Location(10, llvm::SmallString<16>{"test.cpp"});
I.Loc.emplace_back(12, llvm::SmallString<16>{"test.cpp"});
- I.Members.emplace_back("int", "X", AccessSpecifier::AS_private);
+ I.Members.emplace_back("int", "X/Y", "X", AccessSpecifier::AS_private);
I.TagType = TagTypeKind::TTK_Class;
- I.Parents.emplace_back(EmptySID, "F", InfoType::IT_record);
+ I.Parents.emplace_back(EmptySID, "F", InfoType::IT_record,
+ llvm::SmallString<128>("path/to"));
I.VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record);
I.ChildRecords.emplace_back(EmptySID, "ChildStruct", InfoType::IT_record);
@@ -104,11 +106,13 @@ TEST(HTMLGeneratorTest, emitRecordHTML) {
Defined at line 10 of test.cpp
- Inherits from F, G
+ Inherits from
+ F
+ , G
Members
- - private int X
+ - private int X
Records
@@ -118,7 +122,7 @@ TEST(HTMLGeneratorTest, emitRecordHTML) {
OneFunction
- OneFunction()
+ OneFunction()
Enums
@@ -139,8 +143,8 @@ TEST(HTMLGeneratorTest, emitFunctionHTML) {
I.DefLoc = Location(10, llvm::SmallString<16>{"test.cpp"});
I.Loc.emplace_back(12, llvm::SmallString<16>{"test.cpp"});
- I.ReturnType = TypeInfo(EmptySID, "void", InfoType::IT_default);
- I.Params.emplace_back("int", "P");
+ I.ReturnType = TypeInfo(EmptySID, "float", InfoType::IT_default, "path/to");
+ I.Params.emplace_back("int", "path/to", "P");
I.IsMethod = true;
I.Parent = Reference(EmptySID, "Parent", InfoType::IT_record);
@@ -156,7 +160,10 @@ TEST(HTMLGeneratorTest, emitFunctionHTML) {
f
- void f(int P)
+ float
+ f(
+ int
+ P)
Defined at line 10 of test.cpp
@@ -261,8 +268,7 @@ TEST(HTMLGeneratorTest, emitCommentHTML) {
Brief description.
- Extended description that
- continues onto the next line.
+ Extended description that continues onto the next line.
--
cgit v1.1