This is an archive of the discontinued LLVM Phabricator instance.

[TextAPI] Implement TBDv5 Writer
ClosedPublic

Authored by cishida on Feb 18 2023, 6:23 PM.

Details

Summary

Create writer for new JSON format.
The new JSON format allows practically all attributes to be defined per
target in a universal library however the internal representation only
allows one for the time being. For now the write will always write those
attributes as default available for all targets (install name,
compatability & current version, swift abi, flags e.g. flatnamepace &
app exenstion safety)

rdar://102076911

Diff Detail

Event Timeline

cishida created this revision.Feb 18 2023, 6:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2023, 6:23 PM
cishida requested review of this revision.Feb 18 2023, 6:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2023, 6:23 PM
ributzka added inline comments.Feb 20 2023, 9:05 AM
llvm/include/llvm/TextAPI/InterfaceFile.h
399–408

Re-exported symbols are also exported symbols. Won't this affect the existing users of this function (e.g. TextStub serializer)?

cishida added inline comments.Feb 20 2023, 9:16 AM
llvm/include/llvm/TextAPI/InterfaceFile.h
399–408

I don't think so. All the writers also emit a reexport section so those symbols still get printed out. In an installAPI case we wouldn't know whether an export is a reexport so those symbols just look like exports (unless reexported and in that case they just get deleted so there's nothing to print).

ributzka added inline comments.Feb 20 2023, 11:38 AM
llvm/lib/TextAPI/TextStub.cpp
887–892

This is the section of code that might need changes.

cishida added inline comments.
llvm/lib/TextAPI/TextStub.cpp
887–892

This is addressed in https://reviews.llvm.org/D144428 along with other related fixes.

ributzka added inline comments.Feb 21 2023, 8:42 AM
llvm/lib/TextAPI/TextStub.cpp
887–892

Shouldn't D144428 go first then?

cishida added inline comments.Feb 21 2023, 8:45 AM
llvm/lib/TextAPI/TextStub.cpp
887–892

I made the patch on top of this one using the new InterfaceFile methods.

gentle ping

ributzka accepted this revision.Feb 22 2023, 8:51 AM

LGTM

llvm/lib/TextAPI/TextStubV5.cpp
748

You could use llvm:for_each here instead, which takes a range as argument instead.

This revision is now accepted and ready to land.Feb 22 2023, 8:51 AM
cishida marked an inline comment as done.Feb 22 2023, 10:01 AM
This revision was landed with ongoing or failed builds.Feb 22 2023, 11:35 AM
This revision was automatically updated to reflect the committed changes.