This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Remove duplicate minimum version info
ClosedPublic

Authored by keith on Mar 3 2023, 12:10 PM.

Details

Reviewers
int3
Group Reviewers
Restricted Project
Commits
rG6578e0d1d0e4: [lld-macho] Remove duplicate minimum version info
Summary

At some point PlatformInfo's Target changed types to a type that also
has minimum deployment target info. This caused ambiguity if you tried
to get the target triple from the Target, as the actual minimum version
info was being stored separately. This bulk of this change is changing
the parsing of these values to support this.

Diff Detail

Event Timeline

keith created this revision.Mar 3 2023, 12:10 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 3 2023, 12:10 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
keith requested review of this revision.Mar 3 2023, 12:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 12:10 PM
keith updated this revision to Diff 502217.Mar 3 2023, 12:20 PM

remove redundent return

int3 added a subscriber: int3.Mar 3 2023, 12:39 PM
int3 added inline comments.
lld/MachO/Driver.cpp
685–688

can we set both platformInfo and secondaryPlatformInfo in this function, and make it return void? It doesn't seem like return them as values helps readability + I would like to avoid std::pair as much as possible (again for readability).

remember to update the "side-effect" comment above as well :)

688

while we're here, could we change this to a DenseMap or IndexedMap?

Doesn't really matter for perf but we try to avoid std::map in general. And this might save some binary size

lld/test/MachO/tapi-link.s
20

I think we should not put NFC in the commit title. Minor change but a change nonetheless...

keith retitled this revision from [lld-macho] Remove duplicate minimum version info (NFC) to [lld-macho] Remove duplicate minimum version info.Mar 3 2023, 12:59 PM
keith updated this revision to Diff 502233.Mar 3 2023, 1:04 PM
keith marked 2 inline comments as done.

update function to mutate instead of return

lld/MachO/Driver.cpp
688

it looks like both of those have new requirements for the key type, I will do it in a separate change to avoid noise in this diff

int3 accepted this revision.Mar 3 2023, 1:12 PM

Thanks Keith!

lld/MachO/Driver.cpp
688

ah ok. No worries either way, it's not super important

This revision is now accepted and ready to land.Mar 3 2023, 1:12 PM
This revision was automatically updated to reflect the committed changes.