summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/MachOYAML.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-05-12 17:44:43 +0000
committerChris Bieneman <beanz@apple.com>2016-05-12 17:44:43 +0000
commit24f07478b006005c980e8d72ea646a548c699d86 (patch)
tree58d11dffde20d8a9403535335fee18eddb9ce14c /llvm/lib/ObjectYAML/MachOYAML.cpp
parente60e5fee0a16e1792f336bf4ae97d2f5ec7abb4a (diff)
downloadbcm5719-llvm-24f07478b006005c980e8d72ea646a548c699d86.tar.gz
bcm5719-llvm-24f07478b006005c980e8d72ea646a548c699d86.zip
[obj2yaml] Include all mach_header fields in yaml
Since we want to be able to use yaml to describe degenerate object files as well as valid ones, we need to be explicit of some fields in your yaml definitions. llvm-svn: 269313
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/MachOYAML.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp
index 91d9583c98e..0ef716047c8 100644
--- a/llvm/lib/ObjectYAML/MachOYAML.cpp
+++ b/llvm/lib/ObjectYAML/MachOYAML.cpp
@@ -20,10 +20,12 @@ namespace yaml {
void MappingTraits<MachOYAML::FileHeader>::mapping(
IO &IO, MachOYAML::FileHeader &FileHdr) {
+ IO.mapRequired("magic", FileHdr.magic);
IO.mapRequired("cputype", FileHdr.cputype);
IO.mapRequired("cpusubtype", FileHdr.cpusubtype);
IO.mapOptional("filetype", FileHdr.filetype);
IO.mapRequired("ncmds", FileHdr.ncmds);
+ IO.mapRequired("sizeofcmds", FileHdr.sizeofcmds);
IO.mapRequired("flags", FileHdr.flags);
}
@@ -31,7 +33,7 @@ void MappingTraits<MachOYAML::Object>::mapping(IO &IO,
MachOYAML::Object &Object) {
// If the context isn't already set, tag the document as !mach-o.
// For Fat files there will be a different tag so they can be differentiated.
- if(!IO.getContext()) {
+ if (!IO.getContext()) {
IO.setContext(&Object);
IO.mapTag("!mach-o", true);
}
OpenPOWER on IntegriCloud