diff options
author | Steven Wu <stevenwu@apple.com> | 2017-01-23 20:07:55 +0000 |
---|---|---|
committer | Steven Wu <stevenwu@apple.com> | 2017-01-23 20:07:55 +0000 |
commit | 5b54a42c0f1178dbb367866f92cd4efe88710bd6 (patch) | |
tree | 55464f3be2aa42cdf522652eb39e7969d85a5c24 /llvm/lib/ObjectYAML/MachOYAML.cpp | |
parent | cddeb751a11ce5771bedaa36f04775fb0aa56212 (diff) | |
download | bcm5719-llvm-5b54a42c0f1178dbb367866f92cd4efe88710bd6.tar.gz bcm5719-llvm-5b54a42c0f1178dbb367866f92cd4efe88710bd6.zip |
Add LC_BUILD_VERSION load command
Summary:
Add a new load command LC_BUILD_VERSION. It is a generic version of
LC_*_VERSION_MIN load_command used on Apple platforms. Instead of having
a seperate load command for each platform, LC_BUILD_VERSION is recording
platform info as an enum. It also records SDK version, min_os, and tools
that used to build the binary.
rdar://problem/29781291
Reviewers: enderby
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D29044
llvm-svn: 292824
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r-- | llvm/lib/ObjectYAML/MachOYAML.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp index f04956332e0..6b0e4e3762d 100644 --- a/llvm/lib/ObjectYAML/MachOYAML.cpp +++ b/llvm/lib/ObjectYAML/MachOYAML.cpp @@ -230,6 +230,12 @@ void mapLoadCommandData<MachO::dylinker_command>( IO.mapOptional("PayloadString", LoadCommand.PayloadString); } +template <> +void mapLoadCommandData<MachO::build_version_command>( + IO &IO, MachOYAML::LoadCommand &LoadCommand) { + IO.mapOptional("Tools", LoadCommand.Tools); +} + void MappingTraits<MachOYAML::LoadCommand>::mapping( IO &IO, MachOYAML::LoadCommand &LoadCommand) { MachO::LoadCommandType TempCmd = static_cast<MachO::LoadCommandType>( @@ -282,6 +288,12 @@ void MappingTraits<MachOYAML::Section>::mapping(IO &IO, IO.mapOptional("reserved3", Section.reserved3); } +void MappingTraits<MachO::build_tool_version>::mapping( + IO &IO, MachO::build_tool_version &tool) { + IO.mapRequired("tool", tool.tool); + IO.mapRequired("version", tool.version); +} + void MappingTraits<MachO::dylib>::mapping(IO &IO, MachO::dylib &DylibStruct) { IO.mapRequired("name", DylibStruct.name); IO.mapRequired("timestamp", DylibStruct.timestamp); @@ -566,6 +578,15 @@ void MappingTraits<MachO::note_command>::mapping( IO.mapRequired("size", LoadCommand.size); } +void MappingTraits<MachO::build_version_command>::mapping( + IO &IO, MachO::build_version_command &LoadCommand) { + + IO.mapRequired("platform", LoadCommand.platform); + IO.mapRequired("minos", LoadCommand.minos); + IO.mapRequired("sdk", LoadCommand.sdk); + IO.mapRequired("ntools", LoadCommand.ntools); +} + } // namespace llvm::yaml } // namespace llvm |