diff options
author | Diego Astiazaran <diegoaat97@gmail.com> | 2019-08-15 23:04:27 +0000 |
---|---|---|
committer | Diego Astiazaran <diegoaat97@gmail.com> | 2019-08-15 23:04:27 +0000 |
commit | 6a29ae4bde963b4f271bd9c0dfb0edd4c0de893c (patch) | |
tree | 01dc5ba80a5a4769e609e483c9f45aff436bc53c /clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp | |
parent | 75344955fcd43b67cedec8d5b29ad3419b5aaa81 (diff) | |
download | bcm5719-llvm-6a29ae4bde963b4f271bd9c0dfb0edd4c0de893c.tar.gz bcm5719-llvm-6a29ae4bde963b4f271bd9c0dfb0edd4c0de893c.zip |
[clang-doc] Fix bitcode writer for access specifiers
Bitcode writer was not emitting the corresponding record for the Access attribute of a FunctionInfo. This has been added.
AS_none was being used as the default value for any AcesssSpecifier attribute
(in FunctionInfo and MemberTypeInfo), this has been changed to AS_public
because this is the enum value that evaluates to 0.
The bitcode writer doesn't write values that are 0 so if an attribute
was set to AS_public, this value is not written and after reading the
bitcode it would have the default value which is AS_none. This is why
the default value is now AS_public.
Differential Revision: https://reviews.llvm.org/D66151
llvm-svn: 369063
Diffstat (limited to 'clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp')
-rw-r--r-- | clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp b/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp index 449bb5abf46..61a7d5615e0 100644 --- a/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp +++ b/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp @@ -34,6 +34,7 @@ TEST(YAMLGeneratorTest, emitNamespaceYAML) { "path/to/A/Namespace"); I.ChildFunctions.emplace_back(); I.ChildFunctions.back().Name = "OneFunction"; + I.ChildFunctions.back().Access = AccessSpecifier::AS_none; I.ChildEnums.emplace_back(); I.ChildEnums.back().Name = "OneEnum"; @@ -138,6 +139,7 @@ ChildFunctions: - USR: '0000000000000000000000000000000000000000' Name: 'OneFunction' ReturnType: {} + Access: Public ChildEnums: - USR: '0000000000000000000000000000000000000000' Name: 'OneEnum' @@ -154,6 +156,8 @@ TEST(YAMLGeneratorTest, emitFunctionYAML) { I.DefLoc = Location(10, llvm::SmallString<16>{"test.cpp"}); I.Loc.emplace_back(12, llvm::SmallString<16>{"test.cpp"}); + I.Access = AccessSpecifier::AS_none; + I.ReturnType = TypeInfo(EmptySID, "void", InfoType::IT_default, "path/to/void"); I.Params.emplace_back("int", "path/to/int", "P"); @@ -242,6 +246,7 @@ TEST(YAMLGeneratorTest, emitCommentYAML) { I.ReturnType = TypeInfo(EmptySID, "void", InfoType::IT_default); I.Params.emplace_back("int", "I"); I.Params.emplace_back("int", "J"); + I.Access = AccessSpecifier::AS_none; CommentInfo Top; Top.Kind = "FullComment"; |