This is an archive of the discontinued LLVM Phabricator instance.

[clang][extractapi] Tie API and serialization to the FrontendAction
ClosedPublic

Authored by dang on Mar 29 2022, 5:52 AM.

Details

Summary

Make the API records a property of the action instead of the ASTVisitor
so that it can be accessed outside the AST visitation and push back
serialization to the end of the frontend action.

This will allow accessing and modifying the API records outside of the
ASTVisitor, which is a prerequisite for supporting macros.

Diff Detail

Event Timeline

dang created this revision.Mar 29 2022, 5:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 5:52 AM
dang requested review of this revision.Mar 29 2022, 5:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 5:52 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dang updated this revision to Diff 418907.Mar 29 2022, 9:44 AM

Some errors slipped by when splitting this out of the macros patch.

Mostly LGTM after addressing the inline comments.

clang/include/clang/ExtractAPI/FrontendActions.h
42–58

Should these methods be private?

clang/lib/ExtractAPI/ExtractAPIConsumer.cpp
335

Need rebase to pull in the Language fix D122495

dang updated this revision to Diff 419197.Mar 30 2022, 10:08 AM
dang marked 2 inline comments as done.

Rebase on top of latest changes

dang updated this revision to Diff 419205.Mar 30 2022, 10:19 AM

Update using the correct patch this time around.

clang/include/clang/ExtractAPI/FrontendActions.h
42–58

Yes I checked and existing frontend actions mark these as private.

zixuw accepted this revision.Mar 30 2022, 10:26 AM

LGTM!

This revision is now accepted and ready to land.Mar 30 2022, 10:26 AM