From 7231c9966e523a6fa20aa63b9a9245aff49cf881 Mon Sep 17 00:00:00 2001 From: Brett Wilson Date: Mon, 24 Oct 2022 13:48:55 -0700 Subject: [clang-doc] Fix typedef/using output. Provides an initializer for the TypedefInfo.IsUsing member. Previously this member was uninitialized and would produce random output. Adds the Description (code comments) to the bitcode reader/writer. Previously the typedef/using descriptions were lost during the bitcode round-trip. Adds a test for this. Differential Revision: https://reviews.llvm.org/D136638 --- clang-tools-extra/clang-doc/BitcodeReader.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'clang-tools-extra/clang-doc/BitcodeReader.cpp') diff --git a/clang-tools-extra/clang-doc/BitcodeReader.cpp b/clang-tools-extra/clang-doc/BitcodeReader.cpp index 8e1db35..524b82d 100644 --- a/clang-tools-extra/clang-doc/BitcodeReader.cpp +++ b/clang-tools-extra/clang-doc/BitcodeReader.cpp @@ -368,28 +368,27 @@ template llvm::Expected getCommentInfo(T I) { } template <> llvm::Expected getCommentInfo(FunctionInfo *I) { - I->Description.emplace_back(); - return &I->Description.back(); + return &I->Description.emplace_back(); } template <> llvm::Expected getCommentInfo(NamespaceInfo *I) { - I->Description.emplace_back(); - return &I->Description.back(); + return &I->Description.emplace_back(); } template <> llvm::Expected getCommentInfo(RecordInfo *I) { - I->Description.emplace_back(); - return &I->Description.back(); + return &I->Description.emplace_back(); } template <> llvm::Expected getCommentInfo(MemberTypeInfo *I) { - I->Description.emplace_back(); - return &I->Description.back(); + return &I->Description.emplace_back(); } template <> llvm::Expected getCommentInfo(EnumInfo *I) { - I->Description.emplace_back(); - return &I->Description.back(); + return &I->Description.emplace_back(); +} + +template <> llvm::Expected getCommentInfo(TypedefInfo *I) { + return &I->Description.emplace_back(); } template <> llvm::Expected getCommentInfo(CommentInfo *I) { -- cgit v1.1