This is an archive of the discontinued LLVM Phabricator instance.

[clang-doc] Centralize TypeInfo creation.
ClosedPublic

Authored by brettw on Sep 19 2022, 2:29 PM.

Details

Summary

Several different places in the code had similar computations for the parameters that were eventually passed to the TypeInfo constructor.

This centralizes that code in one function, and allows passing TypeInfo to the various other *Info structures that need it.

Remove some "auto" types and replace with the real type for getting declarations. This was making some duplicate checking difficult to see.

Diff Detail

Event Timeline

brettw created this revision.Sep 19 2022, 2:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 2:29 PM
brettw requested review of this revision.Sep 19 2022, 2:29 PM
brettw edited the summary of this revision. (Show Details)Sep 19 2022, 2:29 PM
paulkirth accepted this revision.Sep 19 2022, 3:22 PM

Thanks for the code cleanup. The patch is LGTM, with some small nits.

clang-tools-extra/clang-doc/Serialize.cpp
240

nit: can we invert this condition and use an early return to reduce nesting?

This revision is now accepted and ready to land.Sep 19 2022, 3:22 PM

Also, can you take a look at the premerge check failure? it looks like it had trouble applying your patch, so you may need to rebase.

brettw updated this revision to Diff 461397.Sep 19 2022, 3:53 PM
brettw marked an inline comment as done.

Comment addressed

This revision was automatically updated to reflect the committed changes.