summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/MachOYAML.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-12-22 21:58:03 +0000
committerChris Bieneman <beanz@apple.com>2016-12-22 21:58:03 +0000
commit55de3a2449ae2f914c0dbc0a25627e04bcf21a05 (patch)
tree26c34af4dbf8a08b92f3e2011a8cb6e5969792dc /llvm/lib/ObjectYAML/MachOYAML.cpp
parentfa5960a28ba2ad10c3f9b0e0b1db6c0557250fc3 (diff)
downloadbcm5719-llvm-55de3a2449ae2f914c0dbc0a25627e04bcf21a05.tar.gz
bcm5719-llvm-55de3a2449ae2f914c0dbc0a25627e04bcf21a05.zip
[ObjectYAML] MachO support for endianness
This patch adds support to the macho<->yaml tools for preserving endianness in MachO structures and DWARF data. llvm-svn: 290381
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/MachOYAML.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp
index 7ebb1bed088..a033a79189b 100644
--- a/llvm/lib/ObjectYAML/MachOYAML.cpp
+++ b/llvm/lib/ObjectYAML/MachOYAML.cpp
@@ -14,6 +14,7 @@
#include "llvm/ObjectYAML/MachOYAML.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Format.h"
+#include "llvm/Support/Host.h"
#include "llvm/Support/MachO.h"
#include <string.h> // For memcpy, memset and strnlen.
@@ -100,6 +101,10 @@ void MappingTraits<MachOYAML::Object>::mapping(IO &IO,
IO.setContext(&Object);
}
IO.mapTag("!mach-o", true);
+ IO.mapOptional("IsLittleEndian", Object.IsLittleEndian,
+ sys::IsLittleEndianHost);
+ Object.DWARF.IsLittleEndian = Object.IsLittleEndian;
+
IO.mapRequired("FileHeader", Object.Header);
IO.mapOptional("LoadCommands", Object.LoadCommands);
if(!Object.LinkEdit.isEmpty() || !IO.outputting())
OpenPOWER on IntegriCloud