This is an archive of the discontinued LLVM Phabricator instance.

[clang][ExtractAPI] Add support for namespaces
ClosedPublic

Authored by evelez7 on Aug 17 2023, 5:38 PM.

Details

Summary

Serialize namespaces, nested namespaces, and class relationships inside them.

Depends on D157076

Diff Detail

Event Timeline

evelez7 created this revision.Aug 17 2023, 5:38 PM
Herald added a project: Restricted Project. · View Herald Transcript
evelez7 requested review of this revision.Aug 17 2023, 5:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2023, 5:38 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
evelez7 updated this revision to Diff 551340.Aug 17 2023, 5:42 PM

Remove unnecessary line break.

Note that this doesn't handle anonymous namespaces. Similar problems arise with anonymous classes/structs, being worked on.

dang added inline comments.Aug 18 2023, 8:06 AM
clang/include/clang/ExtractAPI/API.h
1135

Can we get rid of these types of changes to keep the commit history. In general we don't reformat code as part of a bigger patch.

evelez7 updated this revision to Diff 551526.Aug 18 2023, 8:29 AM

Revert extraneous formatting in API.h

dang added inline comments.Aug 21 2023, 5:39 AM
clang/include/clang/ExtractAPI/ExtractAPIVisitor.h
38

I think this should compute both the parent decl and its USR.

evelez7 updated this revision to Diff 552155.Aug 21 2023, 3:31 PM
evelez7 marked an inline comment as done.

Move DetermineParentDecl to determineParentRecord in APIVisitor as a private method.

Easier to just let it fetch the record for us and return nullptr if the parent is the translation unit.
Also we don't have to cast the Decls to their most derived form for the USR.

dang accepted this revision.Aug 22 2023, 2:26 AM

LGTM

This revision is now accepted and ready to land.Aug 22 2023, 2:26 AM
This revision was landed with ongoing or failed builds.Aug 22 2023, 9:57 AM
This revision was automatically updated to reflect the committed changes.