This is an archive of the discontinued LLVM Phabricator instance.

Add an API to construct an XcodeSDK from an SDK type.
ClosedPublic

Authored by aprantl on May 7 2020, 3:02 PM.

Details

Summary

Unfortunately I discovered that I do need to be able to go full round-trip in swift-lldb.

Also, this moves numSDKs out of the actual enum, as to not mess with the switch-cases-covered warning.

Diff Detail

Event Timeline

aprantl created this revision.May 7 2020, 3:02 PM
vsk added inline comments.May 7 2020, 4:40 PM
lldb/source/Utility/XcodeSDK.cpp
44

I'd expect -Wcovered-switch to break the build if a new case gets added and this list isn't updated. Wdyt of dropping numSDKTypes and using an llvm_unreachable here instead?

aprantl updated this revision to Diff 262883.May 8 2020, 8:46 AM

Remove redundant static_assert. It was only needed in the other function because that one used cascading ifs.

aprantl updated this revision to Diff 262884.May 8 2020, 8:47 AM

(Upload the full patch)

JDevlieghere accepted this revision.May 8 2020, 10:44 AM
JDevlieghere added inline comments.
lldb/source/Utility/XcodeSDK.cpp
147

Cool :P

This revision is now accepted and ready to land.May 8 2020, 10:44 AM
vsk accepted this revision.May 8 2020, 10:45 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2020, 11:15 AM