Supoort mach-o encoded in yaml.
authorNick Kledzik <kledzik@apple.com>
Tue, 8 Oct 2013 00:43:34 +0000 (00:43 +0000)
committerNick Kledzik <kledzik@apple.com>
Tue, 8 Oct 2013 00:43:34 +0000 (00:43 +0000)
commit30332b19d3a305536d66dac5c9c8d58a8f8a6419
treeffd70aa9b4d18d80c33d49a6c4467a10300bfb34
parent84ff5ee44810adfbe948e473c8bd1da085c8186e
Supoort mach-o encoded in yaml.

This is the first step in how I plan to get mach-o object files support into
lld. We need to be able to test the mach-o Reader and Write on systems without
a mach-o tools. Therefore, we want to support a textual way (YAML) to represent
mach-o files.

MachONormalizedFile.h defines an in-memory abstraction of the content of mach-o
files. The in-memory data structures are always native endianess and always
use 64-bit sizes. That internal data structure can then be converted to or
from three different formats: 1) yaml (text) encoded mach-o, 2) binary mach-o
files, 3) lld Atoms.

This patch defines the internal model and uses YAML I/O to implement the
conversion to and from the model to yaml. The next patch will implement
the conversion from normalized to binary mach-o.

This patch includes unit tests to validate the yaml conversion APIs.

llvm-svn: 192147
lld/include/lld/ReaderWriter/MachOLinkingContext.h
lld/lib/ReaderWriter/MachO/CMakeLists.txt
lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFile.h [new file with mode: 0644]
lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp [new file with mode: 0644]
lld/unittests/CMakeLists.txt
lld/unittests/MachOTests/CMakeLists.txt [new file with mode: 0644]
lld/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp [new file with mode: 0644]