This is an archive of the discontinued LLVM Phabricator instance.

[LTO][Legacy] Add new API to query Mach-O CPU (sub)type
ClosedPublic

Authored by thegameg on Feb 24 2020, 10:57 AM.

Details

Summary

Tools working with object files on Darwin (e.g. lipo) may need to know properties like the CPU type and subtype of a bitcode file. The logic of converting a triple to a Mach-O CPU_(SUB_)TYPE should be provided by LLVM instead of relying on tools to re-implement it.

Diff Detail

Event Timeline

thegameg created this revision.Feb 24 2020, 10:57 AM

@thegameg , tests are usually done through the llvm-lto or llvm-lto2 tools.

thegameg updated this revision to Diff 246315.Feb 24 2020, 2:48 PM
thegameg edited the summary of this revision. (Show Details)

Add test through llvm-lto. More extensive testing of the BinaryFormat logic was added in https://reviews.llvm.org/rG7b0a5683fa09be4e60bc93526aad7b63bbca687c.

mtrent accepted this revision.Feb 28 2020, 11:08 AM
This revision is now accepted and ready to land.Feb 28 2020, 11:08 AM
steven_wu accepted this revision.Feb 28 2020, 11:19 AM
This revision was automatically updated to reflect the committed changes.