This is an archive of the discontinued LLVM Phabricator instance.

[TextAPI] Add support for TBDv5 Files to nm & tapi-diff
ClosedPublic

Authored by cishida on Feb 21 2023, 6:37 PM.

Details

Summary

This includes handling of new attributes for symbols & rpath.
In the event that an older format file is compared to tbd_v5, ignore these new attributes.

Diff Detail

Event Timeline

cishida created this revision.Feb 21 2023, 6:37 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: hiraditya. · View Herald Transcript
cishida requested review of this revision.Feb 21 2023, 6:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2023, 6:37 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
cishida updated this revision to Diff 499369.Feb 21 2023, 10:27 PM

Handle multiple flags set in llvm-tapi-diff printing

I got pinged on this due to the llvm-nm change, so I took a quick look through and spotted a few nits/test issues. Someone who is more knowledgeable about TAPI/TBD etc stuff should properly review though.

llvm/lib/TextAPI/Symbol.cpp
58–59
llvm/test/Object/nm-tapi.test
71

Aside: It was confusing that the llvm-nm related testing is not in the test/tools/llvm-nm folder, unlike most llvm-nm testing. Perhaps worth considering moving this test in a separate change?

llvm/test/tools/llvm-tapi-diff/v5.test
4–5

Presumably you need to add 2>&1 here to capture stderr for any warnings?

6

Nit: duplicate blank line.

8

Isn't this unnecessary? Won't llvm-tapi-diff fail with a non-zero exit code if it encounters and error?

24

Nit: looks like you've got an extra trailing blank line.

cishida updated this revision to Diff 499498.Feb 22 2023, 7:16 AM
cishida marked 4 inline comments as done.

Fix up patch based on review comments

cishida added inline comments.Feb 22 2023, 7:20 AM
llvm/test/Object/nm-tapi.test
71

Yes, that's fair. Thinking back, the rationale was testing the libObject changes indirectly but I can certainly move this to test/tools/llvm-nm in a followup patch to avoid confusion.

llvm/test/tools/llvm-tapi-diff/v5.test
8

llvm-tapi-diff currently doesn't emit any warnings so all errors are fatal. In these two invocations the tool shouldn't report any differences.

This revision is now accepted and ready to land.Feb 22 2023, 8:55 AM
This revision was landed with ongoing or failed builds.Feb 22 2023, 7:44 PM
This revision was automatically updated to reflect the committed changes.