summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/COFFYAML.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-06-27 19:53:53 +0000
committerChris Bieneman <beanz@apple.com>2016-06-27 19:53:53 +0000
commit8ff0c113575167809365d2de5f6a204ff9c9c2bb (patch)
treebcfa2a036127dcd47a729941ec0389ec8022af0c /llvm/lib/ObjectYAML/COFFYAML.cpp
parentf0fa61ffcfc8550f1b4282e456b3763d71b60c76 (diff)
downloadbcm5719-llvm-8ff0c113575167809365d2de5f6a204ff9c9c2bb.tar.gz
bcm5719-llvm-8ff0c113575167809365d2de5f6a204ff9c9c2bb.zip
[yaml2obj] Remove --format option in favor of YAML tags
Summary: Our YAML library's handling of tags isn't perfect, but it is good enough to get rid of the need for the --format argument to yaml2obj. This patch does exactly that. Instead of requiring --format, it infers the format based on the tags found in the object file. The supported tags are: !ELF !COFF !mach-o !fat-mach-o I have a corresponding patch that is quite large that fixes up all the in-tree test cases. Reviewers: rafael, Bigcheese, compnerd, silvas Subscribers: compnerd, llvm-commits Differential Revision: http://reviews.llvm.org/D21711 llvm-svn: 273915
Diffstat (limited to 'llvm/lib/ObjectYAML/COFFYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/COFFYAML.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/COFFYAML.cpp b/llvm/lib/ObjectYAML/COFFYAML.cpp
index 02ae0535615..7f9f4c1f8c2 100644
--- a/llvm/lib/ObjectYAML/COFFYAML.cpp
+++ b/llvm/lib/ObjectYAML/COFFYAML.cpp
@@ -493,6 +493,7 @@ void MappingTraits<COFFYAML::Section>::mapping(IO &IO, COFFYAML::Section &Sec) {
}
void MappingTraits<COFFYAML::Object>::mapping(IO &IO, COFFYAML::Object &Obj) {
+ IO.mapTag("!COFF", true);
IO.mapOptional("OptionalHeader", Obj.OptionalHeader);
IO.mapRequired("header", Obj.Header);
IO.mapRequired("sections", Obj.Sections);
OpenPOWER on IntegriCloud