Page MenuHomePhabricator

[TextAPI] Introduce TBDv4
ClosedPublic

Authored by cishida on Sep 12 2019, 4:49 PM.

Details

Summary

This format introduces new features and platforms
The motivation for this format is to support more than 1 platform since previous versions only supported additional architectures and 1 platform,
for example ios + ios-simulator and macCatalyst.

Diff Detail

Event Timeline

cishida created this revision.Sep 12 2019, 4:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2019, 4:49 PM
ributzka added inline comments.Sep 12 2019, 5:00 PM
llvm/lib/TextAPI/MachO/TextStub.cpp
353

Oops, I forgot to change this to a proper enum. Could you please fix this?

cishida updated this revision to Diff 220111.Sep 13 2019, 8:22 AM

Add enum to MetaDataSection

cishida marked an inline comment as done.Sep 13 2019, 8:23 AM
ributzka added inline comments.Sep 13 2019, 9:14 AM
llvm/lib/TextAPI/MachO/TextStub.cpp
740

I guess this should be called setFileTypeForInput, because this only gets called when a file is read.

1285

Please also update here with the new enum.

1287

ditto

llvm/unittests/TextAPI/TextStubV4Tests.cpp
222

Why do you use .at() here?

cishida updated this revision to Diff 220700.Sep 18 2019, 10:26 AM
cishida marked 4 inline comments as done.

Address comments from review

ributzka added inline comments.Sep 18 2019, 11:28 AM
llvm/lib/TextAPI/MachO/TextStub.cpp
352

I don't think the context has to be an unsigned. Now that you have an enum, you can use that instead. Please also update the coder further down that sets the context.

355

The switch statement could be improved by removing the default. That way the compiler will emit a warning if the switch statement isn't fully covered. There should also be a llvm_unreachable after the switch statement to catch unexpected values.

784

nitpick: the order it quite random now.

816

Factoring this out into a separate function would make this code easier to understand, because we fall-through to this code, but call the mappingTBD_V4 method in the other case.

cishida updated this revision to Diff 220734.Sep 18 2019, 1:02 PM
cishida marked 4 inline comments as done.

Additional Cleanup.

  • Factor out mapping
  • propogate MetdataOption enum
ributzka added inline comments.Sep 23 2019, 12:27 PM
llvm/unittests/TextAPI/TextStubV4Tests.cpp
309

s/macabi/maccatalyst

373

For TBD v4 the swift-abi-version should be just an integer. In this case it should be just 1.

388

And here the swift-abi-version should be 2.

cishida added inline comments.Sep 23 2019, 12:35 PM
llvm/unittests/TextAPI/TextStubV4Tests.cpp
373

for tbdv-4 should it be considered malformed to pass a float? as opposed to currently rounding

ributzka added inline comments.Sep 24 2019, 10:30 AM
llvm/unittests/TextAPI/TextStubV4Tests.cpp
373

I wouldn't call it a float. It used to be the Swift version string in previous TBD versions and now it is the Swift ABI version, which is only an integer. Passing anything else for TBD v4 should be considered malformed.

cishida updated this revision to Diff 222188.Sep 27 2019, 9:20 AM
cishida marked 5 inline comments as done.

Update: Enforce Integer value for swift abi version

ributzka added inline comments.Sep 27 2019, 9:28 AM
llvm/include/llvm/TextAPI/MachO/Symbol.h
56

that is not very small ;-) 20 elements seem overkill for this.

cishida marked an inline comment as done.Sep 27 2019, 10:16 AM
cishida added inline comments.
llvm/include/llvm/TextAPI/MachO/Symbol.h
56

ill change it to 5!

cishida updated this revision to Diff 223621.Oct 7 2019, 9:49 AM

Reduce inplace limit for TargetList

ributzka added inline comments.Oct 7 2019, 9:55 AM
llvm/lib/TextAPI/MachO/Target.cpp
35

Sorry, I just noticed that the simulators are missing in this list. Please add support for them and also matching tests.

cishida updated this revision to Diff 223629.Oct 7 2019, 11:08 AM

Add simulator + tests

cishida marked an inline comment as done.Oct 7 2019, 11:09 AM
ributzka accepted this revision.Oct 7 2019, 11:17 AM

Thanks Cyndy. LGTM

This revision is now accepted and ready to land.Oct 7 2019, 11:17 AM
cishida updated this revision to Diff 223630.Oct 7 2019, 11:20 AM

Fix a few typos in comments

Harbormaster completed remote builds in B39097: Diff 223629.
Harbormaster completed remote builds in B39098: Diff 223630.
This revision was automatically updated to reflect the committed changes.