summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp
diff options
context:
space:
mode:
authorDiego Astiazaran <diegoaat97@gmail.com>2019-08-16 00:10:49 +0000
committerDiego Astiazaran <diegoaat97@gmail.com>2019-08-16 00:10:49 +0000
commitba3d595f93a45965adb4f47bfc57e28c00ba8942 (patch)
treeee16fc68101e6222c8bb9cf10f93f994f74cf423 /clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp
parent76053297bd779ae13bd456c8ddbd405754ee39f2 (diff)
downloadbcm5719-llvm-ba3d595f93a45965adb4f47bfc57e28c00ba8942.tar.gz
bcm5719-llvm-ba3d595f93a45965adb4f47bfc57e28c00ba8942.zip
[clang-doc] Serialize inherited attributes and methods
clang-doc now serializes the inherited attributes and methods, not only the name of the base class. All inherited are tracked, if B:A and C:B, info of A is included in C. This data is stored in attribute Bases in a RecordInfo. Previously tracked inheritance data, stored in Parents and VParents, hasn't been removed to reduce review load. Differential revision: https://reviews.llvm.org/D66238 llvm-svn: 369075
Diffstat (limited to 'clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp b/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp
index 61a7d5615e0..8d116d8df8b 100644
--- a/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp
+++ b/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp
@@ -84,6 +84,12 @@ TEST(YAMLGeneratorTest, emitRecordYAML) {
I.Members.emplace_back("int", "path/to/int", "X",
AccessSpecifier::AS_private);
I.TagType = TagTypeKind::TTK_Class;
+ I.Bases.emplace_back(EmptySID, "F", "path/to/F", true,
+ AccessSpecifier::AS_public, true);
+ I.Bases.back().ChildFunctions.emplace_back();
+ I.Bases.back().ChildFunctions.back().Name = "InheritedFunctionOne";
+ I.Bases.back().Members.emplace_back("int", "path/to/int", "N",
+ AccessSpecifier::AS_private);
// F is in the global namespace
I.Parents.emplace_back(EmptySID, "F", InfoType::IT_record, "");
I.VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record,
@@ -123,6 +129,24 @@ Members:
Path: 'path/to/int'
Name: 'X'
Access: Private
+Bases:
+ - USR: '0000000000000000000000000000000000000000'
+ Name: 'F'
+ Path: 'path/to/F'
+ Members:
+ - Type:
+ Name: 'int'
+ Path: 'path/to/int'
+ Name: 'N'
+ Access: Private
+ ChildFunctions:
+ - USR: '0000000000000000000000000000000000000000'
+ Name: 'InheritedFunctionOne'
+ ReturnType: {}
+ Access: Public
+ IsVirtual: true
+ Access: Public
+ IsParent: true
Parents:
- Type: Record
Name: 'F'
OpenPOWER on IntegriCloud