This is an archive of the discontinued LLVM Phabricator instance.

[clang-doc] Fix typedef/using output.
ClosedPublic

Authored by brettw on Oct 24 2022, 2:10 PM.

Details

Summary

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.

Diff Detail

Event Timeline

brettw created this revision.Oct 24 2022, 2:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 2:10 PM
brettw requested review of this revision.Oct 24 2022, 2:10 PM
brettw edited the summary of this revision. (Show Details)Oct 24 2022, 2:13 PM

Can you add a test that checks the IsUsing == false case? Otherwise LGTM modulo one small nit.

clang-tools-extra/clang-doc/BitcodeReader.cpp
395–396

nit: I know this is in the style of the rest of the file, but I believe that code was written before LLVM allowed C++17. I think we can just return the reference from emplace_back() directly, right?

clang-tools-extra/unittests/clang-doc/BitcodeTest.cpp
184

This seems to be a test for the IsUsing == true case, are there tests where it is false? I realize that's the default now, but I'm not sure it's covered.

brettw updated this revision to Diff 470598.Oct 25 2022, 12:49 PM
brettw marked 2 inline comments as done.
paulkirth accepted this revision.Oct 25 2022, 1:40 PM

LGTM.

clang-tools-extra/clang-doc/BitcodeReader.cpp
395–396

oh, I didn't intend for you to update the whole file, just what was in your change, but thank you for the code clean up!

This revision is now accepted and ready to land.Oct 25 2022, 1:40 PM
This revision was landed with ongoing or failed builds.Oct 25 2022, 1:47 PM
This revision was automatically updated to reflect the committed changes.