diff options
author | Chris Bieneman <beanz@apple.com> | 2016-05-19 20:48:54 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2016-05-19 20:48:54 +0000 |
commit | f605d10a061ebecf9f1495ce40ea054966e5e698 (patch) | |
tree | 0b11ea7ae5c946d862c76985f3cef6d6a35b4725 /llvm/lib/ObjectYAML/MachOYAML.cpp | |
parent | bc744272f8f761284514efe44a59fa23d6455bb7 (diff) | |
download | bcm5719-llvm-f605d10a061ebecf9f1495ce40ea054966e5e698.tar.gz bcm5719-llvm-f605d10a061ebecf9f1495ce40ea054966e5e698.zip |
Revert "[obj2yaml] [yaml2obj] Support for MachO Load Command data"
This reverts commit r270115.
This failed on several builders using GCC.
llvm-svn: 270121
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r-- | llvm/lib/ObjectYAML/MachOYAML.cpp | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp index 60ed53f7d1e..2faefca432e 100644 --- a/llvm/lib/ObjectYAML/MachOYAML.cpp +++ b/llvm/lib/ObjectYAML/MachOYAML.cpp @@ -96,33 +96,6 @@ void MappingTraits<MachOYAML::Object>::mapping(IO &IO, IO.setContext(nullptr); } -template <typename StructType> -void mapLoadCommandData(IO &IO, MachOYAML::LoadCommand &LoadCommand) {} - -template <> -void mapLoadCommandData<MachO::segment_command>( - IO &IO, MachOYAML::LoadCommand &LoadCommand) { - IO.mapOptional("Sections", LoadCommand.Sections); -} - -template <> -void mapLoadCommandData<MachO::segment_command_64>( - IO &IO, MachOYAML::LoadCommand &LoadCommand) { - IO.mapOptional("Sections", LoadCommand.Sections); -} - -template <> -void mapLoadCommandData<MachO::dylib_command>( - IO &IO, MachOYAML::LoadCommand &LoadCommand) { - IO.mapOptional("PayloadString", LoadCommand.PayloadString); -} - -template <> -void mapLoadCommandData<MachO::dylinker_command>( - IO &IO, MachOYAML::LoadCommand &LoadCommand) { - IO.mapOptional("PayloadString", LoadCommand.PayloadString); -} - void MappingTraits<MachOYAML::LoadCommand>::mapping( IO &IO, MachOYAML::LoadCommand &LoadCommand) { IO.mapRequired( @@ -133,14 +106,15 @@ void MappingTraits<MachOYAML::LoadCommand>::mapping( case MachO::LCName: \ MappingTraits<MachO::LCStruct>::mapping(IO, \ LoadCommand.Data.LCStruct##_data); \ - mapLoadCommandData<MachO::LCStruct>(IO, LoadCommand); \ break; switch (LoadCommand.Data.load_command_data.cmd) { #include "llvm/Support/MachO.def" } - IO.mapOptional("PayloadBytes", LoadCommand.PayloadBytes); - IO.mapOptional("ZeroPadBytes", LoadCommand.ZeroPadBytes, 0ull); + if (LoadCommand.Data.load_command_data.cmd == MachO::LC_SEGMENT || + LoadCommand.Data.load_command_data.cmd == MachO::LC_SEGMENT_64) { + IO.mapOptional("Sections", LoadCommand.Sections); + } } void MappingTraits<MachO::dyld_info_command>::mapping( |