This is an archive of the discontinued LLVM Phabricator instance.

[clang-doc] Add basic support for templates and typedef
ClosedPublic

Authored by DiegoAstiazaran on Jun 14 2019, 3:39 PM.

Details

Summary

In serialize::parseBases(...), when a base record is a template specialization, the specialization was used as the parent. It should be the base template so there is only one file generated for this record. When the specialized template is implicitly declared the reference USR corresponded to the GlobalNamespace's USR, this will now be the base template's USR.
More information about templates will be added later.

In serialize::emiInfo(RecorDecl*, ...), typedef records were not handled and the name was empty. This is now handled and a IsTypeDef attribute is added to RecordInfo struct.

In serialize::emitInfo(CXXMethodDecl*, ...), template specialization is handled like in serialize::parseBases(...).

Bitcode writer and reader are modified to handle the new attribute of RecordInfo.

Diff Detail

Repository
rL LLVM

Event Timeline

Eugene.Zelenko added inline comments.
clang-tools-extra/clang-doc/Serialize.cpp
182 ↗(On Diff #204865)

Please don't use auto because type is not spelled in same statement.

252 ↗(On Diff #204865)

Please don't use auto because type is not spelled in same statement.

255 ↗(On Diff #204865)

Please don't use auto because type is not spelled in same statement.

350 ↗(On Diff #204865)

Please don't use auto because type is not spelled in same statement.

juliehockett added inline comments.Jun 17 2019, 12:21 PM
clang-tools-extra/clang-doc/Representation.h
244 ↗(On Diff #204865)

Run clang-format? Not totally sure what it'll do, but I think it should line up the comments.

clang-tools-extra/clang-doc/Serialize.cpp
387 ↗(On Diff #204865)

Generally, it's not a great idea to declare a pointer without initializing it. Either initialize it on declaration or initialize to nullptr.

DiegoAstiazaran marked 2 inline comments as done.Jun 17 2019, 1:34 PM
DiegoAstiazaran added inline comments.
clang-tools-extra/clang-doc/Representation.h
244 ↗(On Diff #204865)

There are no changes after running clang-format.

DiegoAstiazaran marked an inline comment as done.

Specify type in declarations where auto keyword was used.
Initialize pointer to nullptr in empty declaration.

DiegoAstiazaran marked 5 inline comments as done.Jun 17 2019, 1:41 PM
juliehockett accepted this revision.Jun 21 2019, 10:06 AM
This revision is now accepted and ready to land.Jun 21 2019, 10:06 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2019, 12:32 PM