summaryrefslogtreecommitdiffstats
path: root/llvm/tools/obj2yaml/macho2yaml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/obj2yaml/macho2yaml.cpp')
-rw-r--r--llvm/tools/obj2yaml/macho2yaml.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/tools/obj2yaml/macho2yaml.cpp b/llvm/tools/obj2yaml/macho2yaml.cpp
index 060a2b82726..c9a1385f173 100644
--- a/llvm/tools/obj2yaml/macho2yaml.cpp
+++ b/llvm/tools/obj2yaml/macho2yaml.cpp
@@ -10,7 +10,7 @@
#include "Error.h"
#include "obj2yaml.h"
#include "llvm/Object/MachOUniversal.h"
-#include "llvm/ObjectYAML/MachOYAML.h"
+#include "llvm/ObjectYAML/ObjectYAML.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
@@ -467,15 +467,18 @@ Error macho2yaml(raw_ostream &Out, const object::MachOObjectFile &Obj) {
if (!YAML)
return YAML.takeError();
+ yaml::YamlObjectFile YAMLFile;
+ YAMLFile.MachO = std::move(YAML.get());
+
yaml::Output Yout(Out);
- Yout << *(YAML.get());
+ Yout << YAMLFile;
return Error::success();
}
Error macho2yaml(raw_ostream &Out, const object::MachOUniversalBinary &Obj) {
- MachOYAML::MachFile YAMLFile;
- YAMLFile.isFat = true;
- MachOYAML::UniversalBinary &YAML = YAMLFile.FatFile;
+ yaml::YamlObjectFile YAMLFile;
+ YAMLFile.FatMachO.reset(new MachOYAML::UniversalBinary());
+ MachOYAML::UniversalBinary &YAML = *YAMLFile.FatMachO;
YAML.Header.magic = Obj.getMagic();
YAML.Header.nfat_arch = Obj.getNumberOfObjects();
OpenPOWER on IntegriCloud