diff options
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r-- | llvm/lib/ObjectYAML/MachOYAML.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp index d54140b6794..af80c1645a6 100644 --- a/llvm/lib/ObjectYAML/MachOYAML.cpp +++ b/llvm/lib/ObjectYAML/MachOYAML.cpp @@ -16,6 +16,8 @@ namespace llvm { +MachOYAML::LoadCommand::~LoadCommand() {} + namespace yaml { void MappingTraits<MachOYAML::FileHeader>::mapping( @@ -40,9 +42,18 @@ void MappingTraits<MachOYAML::Object>::mapping(IO &IO, IO.mapTag("!mach-o", true); } IO.mapRequired("FileHeader", Object.Header); + IO.mapOptional("LoadCommands", Object.LoadCommands); IO.setContext(nullptr); } +void MappingTraits<std::unique_ptr<MachOYAML::LoadCommand>>::mapping( + IO &IO, std::unique_ptr<MachOYAML::LoadCommand> &LoadCommand) { + if (!IO.outputting()) + LoadCommand.reset(new MachOYAML::LoadCommand()); + IO.mapRequired("cmd", LoadCommand->cmd); + IO.mapRequired("cmdsize", LoadCommand->cmdsize); +} + } // namespace llvm::yaml } // namespace llvm |